|
From: Peter B. <pe...@bo...> - 2005-03-13 12:25:36
|
I'm somewhat confused by this output from 2.4.0-rc3 when used on the
Snes9X 1.43 release:
-----8<--------------------------------------------------------
% valgrind snes9x Math\ Test.zip
==21305== Memcheck, a memory error detector for x86-linux.
==21305== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==21305== Using valgrind-2.4.0.rc3, a program supervision framework for x86-linux.
==21305== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==21305== For more details, rerun with: -v
==21305==
Rate: 22050, Buffer size: 2048, 16-bit: yes, Stereo: yes, Encoded: no
No ROM file header found.
"Math Test 2.0" [bad checksum] LoROM, 2Mbits, Type: ROM+RAM+BAT, Mode: 20, TV: NTSC, S-RAM: 32KB, ROMId: SNES Company: 00 CRC32: EB7DEC6D
==21305==
==21305== Process terminating with default action of signal 11 (SIGSEGV)
==21305== Bad permissions for mapped region at address 0xB127C480
==21305== at 0x80A9217: InitDSP() (dsp1emu.c:368)
==21305==
==21305== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 29 from 1)
==21305== malloc/free: in use at exit: 10600342 bytes in 17 blocks.
==21305== malloc/free: 29 allocs, 12 frees, 10627986 bytes allocated.
==21305== For counts of detected errors, rerun with: -v
==21305== searching for pointers to 17 not-freed blocks.
==21305== checked 12296084 bytes.
==21305==
==21305== LEAK SUMMARY:
==21305== definitely lost: 0 bytes in 0 blocks.
==21305== possibly lost: 0 bytes in 0 blocks.
==21305== still reachable: 10600342 bytes in 17 blocks.
==21305== suppressed: 0 bytes in 0 blocks.
==21305== Reachable blocks (those to which a pointer was found) are not shown.
==21305== To see them, rerun with: --show-reachable=yes
zsh: segmentation fault valgrind snes9x Math\ Test.zip
-----8<--------------------------------------------------------
That would make the SinTable2 the culprit in this loop, and commenting
it out makes it work. The CosTable2 with the same code does work, and
if I back down to valgrind-2.2.0 shipped with Debian testing it also
works.
unsigned int i;
for (i=0; i<INCR; i++){
CosTable2[i] = (cos((double)(2*PI*i/INCR)));
> SinTable2[i] = (sin((double)(2*PI*i/INCR)));
}
It dies with i=1908.
Prerequisites from the top of dsp1emu.c:
#define INCR 2048
double CosTable2[INCR];
double SinTable2[INCR];
Ref:
http://www.lysator.liu.se/snes9x/1.43/snes9x-1.43-src.tar.gz
Compiled with --with-debug
--
Peter Bortas http://peter.bortas.org
|
|
From: Jeremy F. <je...@go...> - 2005-03-13 16:47:27
|
Peter Bortas wrote:
>I'm somewhat confused by this output from 2.4.0-rc3 when used on the
>Snes9X 1.43 release:
>
>-----8<--------------------------------------------------------
>% valgrind snes9x Math\ Test.zip
>==21305== Memcheck, a memory error detector for x86-linux.
>==21305== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
>==21305== Using valgrind-2.4.0.rc3, a program supervision framework for x86-linux.
>==21305== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
>==21305== For more details, rerun with: -v
>==21305==
>Rate: 22050, Buffer size: 2048, 16-bit: yes, Stereo: yes, Encoded: no
>No ROM file header found.
>"Math Test 2.0" [bad checksum] LoROM, 2Mbits, Type: ROM+RAM+BAT, Mode: 20, TV: NTSC, S-RAM: 32KB, ROMId: SNES Company: 00 CRC32: EB7DEC6D
>==21305==
>==21305== Process terminating with default action of signal 11 (SIGSEGV)
>==21305== Bad permissions for mapped region at address 0xB127C480
>==21305== at 0x80A9217: InitDSP() (dsp1emu.c:368)
>
>
Hm, this looks like the same problem as described in the just-filed bug
101423. What happens if you use --pointercheck=no? Is it possible to
reproduce this in a smaller piece of stand-alone code?
J
|
|
From: Peter B. <pe...@bo...> - 2005-03-13 20:32:47
|
Jeremy Fitzhardinge <je...@go...> writes: > Hm, this looks like the same problem as described in the just-filed > bug 101423. Yes, that feels very similar. > What happens if you use --pointercheck=no? No change. > Is it possible to reproduce this in a smaller piece of stand-alone code? Replacing "float" with "double" in bug 101423 generates the same error. Reducing the snes9x code to just the loop does not. It so far away from the real code that it's hard to say if it's reduced to the minimum required to trigger it or if it's another bug. I'll stay glued to 101423 and test any developments there on my code. -- Peter Bortas http://peter.bortas.org |
|
From: Peter B. <pe...@bo...> - 2005-03-15 11:55:11
|
Peter Bortas <pe...@bo...> writes: >> Is it possible to reproduce this in a smaller piece of stand-alone code? > > Replacing "float" with "double" in bug 101423 generates the same > error. Reducing the snes9x code to just the loop does not. It so far > away from the real code that it's hard to say if it's reduced to the > minimum required to trigger it or if it's another bug. I'll stay glued > to 101423 and test any developments there on my code. The fix you posted for 101423 solves my problem too. Many thanks! -- Peter Bortas http://peter.bortas.org |
|
From: Peter B. <pe...@bo...> - 2005-03-15 12:03:10
|
Peter Bortas <pe...@bo...> writes: > Peter Bortas <pe...@bo...> writes: > > The fix you posted for 101423 solves my problem too. Many thanks! Just to confirm: rc4 also works flawlessly. -- Peter Bortas http://peter.bortas.org |