Re: Bug#698064: Getting aranym 0.9.15-1 to wheezy
Hi Adam,
* Adam D. Barratt <adam@adam-barratt.org.uk> [2013-04-24 11:25] wrote:
> I see you've uploaded a 0.9.13-4 package, without providing a
> debdiff as requested.
>
> Please could you prepare a -5 package which fixes the reverted
> changes? The debdiff between -3.1 and -5 should then only contain
> your new patch and the associated series and changelog updates.
Oh, lord, I really need vacation. Sorry for that. -5 is on the way.
Debdiff attached.
Thank you,
Antonin
diff -Nru aranym-0.9.13/debian/changelog aranym-0.9.13/debian/changelog
--- aranym-0.9.13/debian/changelog 2012-05-06 23:50:52.000000000 +0200
+++ aranym-0.9.13/debian/changelog 2013-04-24 11:41:31.000000000 +0200
@@ -1,3 +1,16 @@
+aranym (0.9.13-5) testing-proposed-updates; urgency=low
+
+ * Reupload of -4 with merged previously forgotten NMU -3.1
+
+ -- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 24 Apr 2013 11:40:18 +0200
+
+aranym (0.9.13-4) testing-proposed-updates; urgency=low
+
+ * cherrypick patch for NatFeast problem (Closes: #698064)
+ to get ARAnyM to wheezy
+
+ -- Antonin Kral <A.Kral@sh.cvut.cz> Wed, 24 Apr 2013 08:56:45 +0200
+
aranym (0.9.13-3.1) unstable; urgency=low
* Non-maintainer upload.
diff -Nru aranym-0.9.13/debian/patches/0006-NatFeats-patch-to-address-Bug-698064.patch aranym-0.9.13/debian/patches/0006-NatFeats-patch-to-address-Bug-698064.patch
--- aranym-0.9.13/debian/patches/0006-NatFeats-patch-to-address-Bug-698064.patch 1970-01-01 01:00:00.000000000 +0100
+++ aranym-0.9.13/debian/patches/0006-NatFeats-patch-to-address-Bug-698064.patch 2013-04-24 11:41:31.000000000 +0200
@@ -0,0 +1,151 @@
+From: Antonin Kral <a.kral@bobek.cz>
+Date: Wed, 24 Apr 2013 08:47:40 +0200
+Subject: NatFeats patch to address Bug#698064
+
+---
+ src/include/natfeats.h | 98 ++++++++++++++++++++++++++++++++++++------------
+ 1 file changed, 74 insertions(+), 24 deletions(-)
+
+diff --git a/src/include/natfeats.h b/src/include/natfeats.h
+index e5ff8ab..c6155b8 100644
+--- a/src/include/natfeats.h
++++ b/src/include/natfeats.h
+@@ -1,3 +1,26 @@
++/*
++ * natfeats.h - common functions for all NatFeats
++ *
++ * Copyright (c) 2001-2013 Petr Stehlik of ARAnyM dev team (see AUTHORS)
++ *
++ * This file is part of the ARAnyM project which builds a new and powerful
++ * TOS/FreeMiNT compatible virtual machine running on almost any hardware.
++ *
++ * ARAnyM is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * ARAnyM is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with ARAnyM; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
++ */
++
+ #ifndef _NATFEATS_H
+ #define _NATFEATS_H
+
+@@ -14,6 +37,9 @@ extern uint32 nf_getparameter(int);
+ // should NatFeats work with physical (not MMU mapped) addresses
+ #define NATFEAT_PHYS_ADDR 1
+
++// should NatFeats use direct memcpy() to/from guest provided pointer (fast but less safe)
++#define NATFEAT_LIBC_MEMCPY 1
++
+ #if NATFEAT_PHYS_ADDR
+ # define ReadNFInt8 ReadAtariInt8
+ # define ReadNFInt16 ReadAtariInt16
+@@ -30,53 +56,77 @@ extern uint32 nf_getparameter(int);
+ # define WriteNFInt32 WriteInt32
+ #endif
+
+-static inline void Atari2Host_memcpy(void *dst, memptr src, size_t n)
++static inline void Atari2Host_memcpy(void *_dst, memptr src, size_t count)
+ {
+-#if NATFEAT_PHYS_ADDR
+- memcpy(dst, Atari2HostAddr(src), n);
++#if NATFEAT_LIBC_MEMCPY && NATFEAT_PHYS_ADDR
++ memptr src_end = src + count - 1;
++ if (! ValidAtariAddr(src, false, 1))
++ BUS_ERROR(src);
++ if (! ValidAtariAddr(src_end, false, 1))
++ BUS_ERROR(src_end);
++
++ memcpy(_dst, Atari2HostAddr(src), count);
+ #else
+- uint8 *dest = (uint8 *)dst;
+- while ( n-- )
+- *dest++ = (char)ReadInt8( (uint32)src++ );
++ uint8 *dst = (uint8 *)_dst;
++ while ( count-- )
++ *dst++ = (char)ReadNFInt8( src++ );
+ #endif
+ }
+
+-static inline void Host2Atari_memcpy(memptr dest, const void *src, size_t n)
++static inline void Host2Atari_memcpy(memptr dst, const void *_src, size_t count)
+ {
+-#if NATFEAT_PHYS_ADDR
+- memcpy(Atari2HostAddr(dest), src, n);
++#if NATFEAT_LIBC_MEMCPY && NATFEAT_PHYS_ADDR
++ memptr dst_end = dst + count - 1;
++ if (! ValidAtariAddr(dst, true, 1))
++ BUS_ERROR(dst);
++ if (! ValidAtariAddr(dst_end, true, 1))
++ BUS_ERROR(dst_end);
++
++ memcpy(Atari2HostAddr(dst), _src, count);
+ #else
+- uint8 *source = (uint8 *)src;
+- while ( n-- )
+- WriteInt8( dest++, *source++ );
++ uint8 *src = (uint8 *)_src;
++ while ( count-- )
++ WriteNFInt8( dst++, *src++ );
+ #endif
+ }
+
+-static inline void Atari2HostSafeStrncpy( char *dest, memptr source, size_t count )
++static inline void Atari2HostSafeStrncpy(char *dst, memptr src, size_t count)
+ {
+-#if NATFEAT_PHYS_ADDR
+- safe_strncpy(dest, (const char*)Atari2HostAddr(source), count);
++#if NATFEAT_LIBC_MEMCPY && NATFEAT_PHYS_ADDR
++ memptr src_end = src + count - 1;
++ if (! ValidAtariAddr(src, false, 1))
++ BUS_ERROR(src);
++ if (! ValidAtariAddr(src_end, false, 1))
++ BUS_ERROR(src_end);
++
++ safe_strncpy(dst, (const char*)Atari2HostAddr(src), count);
+ #else
+- while ( count > 1 && (*dest = (char)ReadInt8( source++ )) != 0 ) {
++ while ( count > 1 && (*dst = (char)ReadNFInt8( src++ )) != 0 ) {
+ count--;
+- dest++;
++ dst++;
+ }
+ if (count > 0)
+- *dest = '\0';
++ *dst = '\0';
+ #endif
+ }
+
+-static inline void Host2AtariSafeStrncpy( memptr dest, const char *source, size_t count )
++static inline void Host2AtariSafeStrncpy(memptr dst, const char *src, size_t count)
+ {
+-#if NATFEAT_PHYS_ADDR
+- safe_strncpy((char *)Atari2HostAddr(dest), source, count);
++#if NATFEAT_LIBC_MEMCPY && NATFEAT_PHYS_ADDR
++ memptr dst_end = dst + count - 1;
++ if (! ValidAtariAddr(dst, true, 1))
++ BUS_ERROR(dst);
++ if (! ValidAtariAddr(dst_end, true, 1))
++ BUS_ERROR(dst_end);
++
++ safe_strncpy((char *)Atari2HostAddr(dst), src, count);
+ #else
+- while ( count > 1 && *source ) {
+- WriteInt8( dest++, (uint8)*source++ );
++ while ( count > 1 && *src ) {
++ WriteNFInt8( dst++, (uint8)*src++ );
+ count--;
+ }
+ if (count > 0)
+- WriteInt8( dest, 0 );
++ WriteNFInt8( dst, 0 );
+ #endif
+ }
+ #endif /* _NATFEATS_H */
diff -Nru aranym-0.9.13/debian/patches/series aranym-0.9.13/debian/patches/series
--- aranym-0.9.13/debian/patches/series 2012-05-06 23:47:50.000000000 +0200
+++ aranym-0.9.13/debian/patches/series 2013-04-24 11:41:31.000000000 +0200
@@ -3,3 +3,4 @@
0003-fix-missing-libusb.h-on-kfreebsd-platforms-Closes-66.patch
0004-fix-spelling.patch
0005-fix-zlib-configure.patch
+0006-NatFeats-patch-to-address-Bug-698064.patch
Reply to: