Segfault in winedump (spotted by valgrind)
Trying to dump a winme dll, winedump crashed with a segfault. Valgrind gives these results, have someone a clue ? This file comes from a working Win9x installation. [syl(a)wine system]$ file commctrl.dll commctrl.dll: MS-DOS executable (EXE), OS/2 or MS Windows [syl(a)wine system]$ valgrind winedump spec commdlg.dll ==26058== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==26058== Copyright (C) 2002-2003, and GNU GPL'd, by Julian Seward. ==26058== Using valgrind-20031012, a program supervision framework for x86-linux. ==26058== Copyright (C) 2000-2003, and GNU GPL'd, by Julian Seward. ==26058== Estimated CPU clock rate is 1407 MHz ==26058== For more details, rerun with: -v ==26058== Can't get a suitable file signature, aborting ==26058== discard syms in /c/windows/system/commdlg.dll due to munmap() ==26058== Invalid read of size 4 ==26058== at 0x804FD3D: dll_next_symbol (pe.c:1239) ==26058== by 0x804A431: main (main.c:413) ==26058== by 0x126BAE: __libc_start_main (in /lib/libc-2.3.2.so) ==26058== by 0x8048E48: (within /usr/local/bin/winedump) ==26058== Address 0x4 is not stack'd, malloc'd or free'd Erreur de segmentation ===== Sylvain Petreolle (spetreolle_at_users_dot_sourceforge_dot_net) ICQ #170597259 Say NO to software patents Dites NON aux brevets logiciels "What if tomorrow the War could be over ?" Morpheus, in "Reloaded". _________________________________________________________________ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com
Sylvain Petreolle wrote:
Trying to dump a winme dll, winedump crashed with a segfault.
Does this patch helps ? A+ -- Eric Pouech Index: tools/winedump/main.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/tools/winedump/main.c,v retrieving revision 1.13 diff -u -r1.13 main.c --- tools/winedump/main.c 13 May 2003 04:47:53 -0000 1.13 +++ tools/winedump/main.c 20 Dec 2003 17:53:58 -0000 @@ -404,7 +404,8 @@ if (globals.input_name == NULL) fatal("No file name has been given\n"); set_module_name(1); - dll_open (globals.input_name); + if (!dll_open (globals.input_name)) + break; output_spec_preamble (); output_header_preamble (); Index: tools/winedump/pe.c =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/tools/winedump/pe.c,v retrieving revision 1.30 diff -u -r1.30 pe.c --- tools/winedump/pe.c 11 Nov 2003 22:04:33 -0000 1.30 +++ tools/winedump/pe.c 20 Dec 2003 17:54:48 -0000 @@ -1224,9 +1224,9 @@ * * Open a DLL and read in exported symbols */ -void dll_open (const char *dll_name) +int dll_open (const char *dll_name) { - pe_analysis(dll_name, do_grab_sym, SIG_PE); + return pe_analysis(dll_name, do_grab_sym, SIG_PE); } /******************************************************************* Index: tools/winedump/winedump.h =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/tools/winedump/winedump.h,v retrieving revision 1.8 diff -u -r1.8 winedump.h --- tools/winedump/winedump.h 26 Nov 2003 03:55:01 -0000 1.8 +++ tools/winedump/winedump.h 20 Dec 2003 17:54:29 -0000 @@ -157,9 +157,9 @@ void dump_file(const char* name); /* DLL functions */ -void dll_open (const char *dll_name); +int dll_open (const char *dll_name); -int dll_next_symbol (parsed_symbol * sym); +int dll_next_symbol (parsed_symbol * sym); /* Symbol functions */ int symbol_init(parsed_symbol* symbol, const char* name);
participants (2)
-
Eric Pouech -
Sylvain Petreolle