VOGONS


First post, by Angus

User metadata
Rank Newbie
Rank
Newbie

Do you guys ever use valgrind? I just tried it, and got a load of errors that set of alarm bells for me when I'm developing, like conditionals based on uninitialized values. This might explain why some of very robust mods I made caused all these freezes.
This error report, btw, was not made with a modded DOSBox, but a fresh one:

==27761== Memcheck, a memory error detector.
==27761== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==27761== Using LibVEX rev 1313, a library for dynamic binary translation.
==27761== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==27761== Using valgrind-3.0.1.SVN, a dynamic binary instrumentation framework.
==27761== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==27761==
==27761== My PID = 27761, parent PID = 27760. Prog and args are:
==27761== src/dosbox
==27761== For more details, rerun with: -v
==27761==
==27761== Syscall param write(buf) points to uninitialised byte(s)
==27761== at 0x1B9E9353: __write_nocancel (in /lib/tls/libpthread-2.3.5.so)
==27761== by 0x1BE2F27D: (within /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BE2F5AE: _X11TransWrite (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BE12C34: (within /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BE12D5C: _XReply (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BDFE2A2: XInternAtom (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BA2E4F3: XInternAtom (SDL_x11sym.h:68)
==27761== by 0x1BA3962D: X11_SetCaptionNoLock (SDL_x11wm.c:254)
==27761== by 0x1BA37BE2: create_aux_windows (SDL_x11video.c:392)
==27761== by 0x1BA38B76: X11_VideoInit (SDL_x11video.c:555)
==27761== by 0x1BA27329: SDL_VideoInit (SDL_video.c:241)
==27761== by 0x1B9F65D2: SDL_InitSubSystem (SDL.c:68)
==27761== Address 0x1BEEA076 is 14 bytes inside a block of size 16384 alloc'd
==27761== at 0x1B900B88: calloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x1BE02AE3: XOpenDisplay (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BA2E72C: XOpenDisplay (SDL_x11sym.h:79)
==27761== by 0x1BA3895C: X11_VideoInit (SDL_x11video.c:456)
==27761== by 0x1BA27329: SDL_VideoInit (SDL_video.c:241)
==27761== by 0x1B9F65D2: SDL_InitSubSystem (SDL.c:68)
==27761== by 0x1B9F6621: SDL_Init (SDL.c:160)
==27761== by 0x80E8E6C: main (sdlmain.cpp:1276)
==27761==
==27761== Syscall param write(buf) points to uninitialised byte(s)
==27761== at 0x1B9E937B: (within /lib/tls/libpthread-2.3.5.so)
==27761== by 0x1BE2F27D: (within /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BE2F5AE: _X11TransWrite (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BE12C34: (within /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BE12D5C: _XReply (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BE0D784: XSync (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BA2EC80: XSync (SDL_x11sym.h:105)
==27761== by 0x1BA3758D: X11_SetGammaRamp (SDL_x11video.c:1323)
==27761== by 0x1BA383D5: X11_SetVideoMode (SDL_x11video.c:862)
==27761== by 0x1BA27643: SDL_SetVideoMode (SDL_video.c:667)
==27761== by 0x80E880C: GUI_StartUp(Section*) (sdlmain.cpp:1078)
==27761== by 0x813BE42: Section::ExecuteInit(bool) (setup.cpp:259)
==27761== Address 0x1BEF4253 is 19 bytes inside a block of size 16384 alloc'd
==27761== at 0x1B900B88: calloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x1BE02AE3: XOpenDisplay (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BA2E72C: XOpenDisplay (SDL_x11sym.h:79)
==27761== by 0x1BA38980: X11_VideoInit (SDL_x11video.c:483)
==27761== by 0x1BA27329: SDL_VideoInit (SDL_video.c:241)
==27761== by 0x1B9F65D2: SDL_InitSubSystem (SDL.c:68)
==27761== by 0x1B9F6621: SDL_Init (SDL.c:160)
==27761== by 0x80E8E6C: main (sdlmain.cpp:1276)
==27761==
==27761== Conditional jump or move depends on uninitialised value(s)
==27761== at 0x80A547E: FCB_Parsename(unsigned short, unsigned short, unsigned char, char*, unsigned char*) (dos_files.cpp:688)
==27761== by 0x814450B: DOS_Shell::Execute(char*, char*) (shell_misc.cpp:438)
==27761== by 0x8141AF7: DOS_Shell::DoCommand(char*) (shell_cmds.cpp:113)
==27761== by 0x813EB2B: DOS_Shell::ParseLine(char*) (shell.cpp:246)
==27761== by 0x813FDFB: DOS_Shell::Run() (shell.cpp:322)
==27761== by 0x813F660: SHELL_Init() (shell.cpp:584)
==27761== by 0x80E9128: main (sdlmain.cpp:1355)
==27761==
==27761== Conditional jump or move depends on uninitialised value(s)
==27761== at 0x80A547E: FCB_Parsename(unsigned short, unsigned short, unsigned char, char*, unsigned char*) (dos_files.cpp:688)
==27761== by 0x8144534: DOS_Shell::Execute(char*, char*) (shell_misc.cpp:439)
==27761== by 0x8141AF7: DOS_Shell::DoCommand(char*) (shell_cmds.cpp:113)
==27761== by 0x813EB2B: DOS_Shell::ParseLine(char*) (shell.cpp:246)
==27761== by 0x813FDFB: DOS_Shell::Run() (shell.cpp:322)
==27761== by 0x813F660: SHELL_Init() (shell.cpp:584)
==27761== by 0x80E9128: main (sdlmain.cpp:1355)
==27761==
==27761== ERROR SUMMARY: 355 errors from 4 contexts (suppressed: 78 from 4)
==27761== malloc/free: in use at exit: 70373 bytes in 2212 blocks.
==27761== malloc/free: 9635 allocs, 7423 frees, 19887483 bytes allocated.
==27761== For counts of detected errors, rerun with: -v
==27761== searching for pointers to 2212 not-freed blocks.
==27761== checked 30533488 bytes.
==27761==
==27761==
==27761== 14 bytes in 2 blocks are definitely lost in loss record 25 of 102
==27761== at 0x1B8FF8A6: malloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x1BFEB5D2: _XimEncodeString (imRm.c:722)
==27761== by 0x1BFEC8FE: _XimEncodeAttr (imRm.c:2645)
==27761== by 0x1BFECB72: _XimSetICValueData (imRm.c:2819)
==27761== by 0x1BFE7E80: _XimLocalCreateIC (imLcIc.c:170)
==27761== by 0x1BE2BE4B: XCreateIC (in /usr/X11R6/lib/libX11.so.6.2)
==27761== by 0x1BA37D95: create_aux_windows (SDL_x11video.c:421)
==27761== by 0x1BA38B76: X11_VideoInit (SDL_x11video.c:555)
==27761== by 0x1BA27329: SDL_VideoInit (SDL_video.c:241)
==27761== by 0x1B9F65D2: SDL_InitSubSystem (SDL.c:68)
==27761== by 0x1B9F6621: SDL_Init (SDL.c:160)
==27761== by 0x80E8E6C: main (sdlmain.cpp:1276)
==27761==
==27761==
==27761== 16 bytes in 1 blocks are definitely lost in loss record 26 of 102
==27761== at 0x1B8FFC42: operator new(unsigned) (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x80EB476: MAPPER_Init() (sdl_mapper.cpp:1556)
==27761== by 0x80E90F0: main (sdlmain.cpp:1351)
==27761==
==27761==
==27761== 28 bytes in 1 blocks are definitely lost in loss record 32 of 102
==27761== at 0x1B8FFC42: operator new(unsigned) (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x80EA9EB: CreateLayout() (sdl_mapper.cpp:1345)
==27761== by 0x80EB450: MAPPER_Init() (sdl_mapper.cpp:1628)
==27761== by 0x80E90F0: main (sdlmain.cpp:1351)
==27761==
==27761==
==27761== 136 bytes in 2 blocks are possibly lost in loss record 57 of 102
==27761== at 0x1B900B88: calloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x1B8F1CC8: allocate_dtv (in /lib/ld-2.3.5.so)
==27761== by 0x1B8F1F3B: _dl_allocate_tls (in /lib/ld-2.3.5.so)
==27761== by 0x1B9E48E4: pthread_create@@GLIBC_2.1 (in /lib/tls/libpthread-2.3.5.so)
==27761== by 0x1BA4ECE5: SDL_SYS_CreateThread (SDL_systhread.c:64)
==27761== by 0x1BA0026E: SDL_CreateThread (SDL_thread.c:249)
==27761== by 0x1BA51ACA: SDL_SYS_TimerInit (SDL_systimer.c:212)
==27761== by 0x1BA009CB: SDL_TimerInit (SDL_timer.c:79)
==27761== by 0x1B9F652D: SDL_InitSubSystem (SDL.c:103)
==27761== by 0x1B9F6621: SDL_Init (SDL.c:160)
==27761== by 0x80E8E6C: main (sdlmain.cpp:1276)
==27761==
==27761==
==27761== 140 (60 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 58 of 102
==27761== at 0x1B8FF8A6: malloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x1BA24D9F: SDL_CreateRGBSurface (SDL_surface.c:78)
==27761== by 0x1BA253EF: SDL_CreateRGBSurfaceFrom (SDL_surface.c:160)
==27761== by 0x80E863F: GUI_StartUp(Section*) (sdlmain.cpp:921)
==27761== by 0x813BE42: Section::ExecuteInit(bool) (setup.cpp:259)
==27761== by 0x813BE7E: Config::Init() (setup.cpp:252)
==27761== by 0x80E90C0: main (sdlmain.cpp:1342)
==27761==
==27761==
==27761== 132 (96 direct, 36 indirect) bytes in 3 blocks are definitely lost in loss record 61 of 102
==27761== at 0x1B8FFC42: operator new(unsigned) (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x80EA0FF: AddModButton(unsigned, unsigned, unsigned, unsigned, char const*, unsigned) (sdl_mapper.cpp:1202)
==27761== by 0x80EA8CF: CreateLayout() (sdl_mapper.cpp:1332)
==27761== by 0x80EB450: MAPPER_Init() (sdl_mapper.cpp:1628)
==27761== by 0x80E90F0: main (sdlmain.cpp:1351)
==27761==
==27761==
==27761== 3264 bytes in 102 blocks are definitely lost in loss record 90 of 102
==27761== at 0x1B8FFC42: operator new(unsigned) (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x80EA007: AddKeyButtonEvent(unsigned, unsigned, unsigned, unsigned, char const*, char const*, KBD_KEYS) (sdl_mapper.cpp:1180)
==27761== by 0x80EA1D4: CreateLayout() (sdl_mapper.cpp:1258)
==27761== by 0x80EB450: MAPPER_Init() (sdl_mapper.cpp:1628)
==27761== by 0x80E90F0: main (sdlmain.cpp:1351)
==27761==
==27761==
==27761== 8384 bytes in 262 blocks are possibly lost in loss record 97 of 102
==27761== at 0x1B900B88: calloc (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x1B93C719: (within /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B93F9EF: (within /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B93FB6F: (within /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B94019F: (within /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B93FEE8: (within /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B94026F: (within /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B9404A3: (within /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B942404: snd_config_update_r (in /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B942955: snd_config_update (in /usr/lib/libasound.so.2.0.0)
==27761== by 0x1B9ACF4E: snd_seq_open (in /usr/lib/libasound.so.2.0.0)
==27761== by 0x8127447: MidiHandler_alsa::Open(char const*) (midi_alsa.h:144)
==27761==
==27761==
==27761== 14444 (512 direct, 13932 indirect) bytes in 16 blocks are definitely lost in loss record 98 of 102
==27761== at 0x1B8FFC42: operator new(unsigned) (in /usr/lib/valgrind/vgpreload_memcheck.so)
==27761== by 0x80EA949: CreateLayout() (sdl_mapper.cpp:1338)
==27761== by 0x80EB450: MAPPER_Init() (sdl_mapper.cpp:1628)
==27761== by 0x80E90F0: main (sdlmain.cpp:1351)
==27761==
==27761== LEAK SUMMARY:
==27761== definitely lost: 3990 bytes in 126 blocks.
==27761== indirectly lost: 14048 bytes in 491 blocks.
==27761== possibly lost: 8520 bytes in 264 blocks.
==27761== still reachable: 43815 bytes in 1331 blocks.
==27761== suppressed: 0 bytes in 0 blocks.
==27761== Reachable blocks (those to which a pointer was found) are not shown.
==27761== To see them, rerun with: --show-reachable=yes

Reply 1 of 5, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

> like conditionals based on uninitialized values. This might explain why
> some of very robust mods I made caused all these freezes.

Surely not those that are in the valgrind report you posted.