|
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
|