From: Hong C. <hc...@N-...> - 2003-05-27 18:53:14
|
I fixed this by rebuilding the applcation with debug option ( -g ), and it works now.( One of the libs doesn't contain debug info before ). As you said , the problem is caused by uninitialized variable, following is the detailed messages when the app is running : ==4193== Conditional jump or move depends on uninitialised value(s) ==4193== at 0x403AD7AC: __wcslen (in /lib/libc-2.3.2.so) ==4193== by 0x403AEA0E: __wcsrtombs (in /lib/libc-2.3.2.so) ==4193== by 0x40377136: _IO_vfprintf_internal (in /lib/libc-2.3.2.so) ==4193== by 0x403974B3: _IO_vsnprintf (in /lib/libc-2.3.2.so) ==4193== ==4193== Conditional jump or move depends on uninitialised value(s) ==4193== at 0x40348829: internal_ascii_loop (in /lib/libc-2.3.2.so) ==4193== by 0x40347084: __gconv_transform_internal_ascii (in /lib/libc-2.3.2.so) ==4193== by 0x403AEAC9: __wcsrtombs (in /lib/libc-2.3.2.so) ==4193== by 0x40377136: _IO_vfprintf_internal (in /lib/libc-2.3.2.so) ==4193== ==4193== Conditional jump or move depends on uninitialised value(s) ==4193== at 0x403AEFEE: __wcsnlen (in /lib/libc-2.3.2.so) ==4193== by 0x403AE94A: __wcsrtombs (in /lib/libc-2.3.2.so) ==4193== by 0x403771BC: _IO_vfprintf_internal (in /lib/libc-2.3.2.so) ==4193== by 0x403974B3: _IO_vsnprintf (in /lib/libc-2.3.2.so) ==4193== ==4193== Conditional jump or move depends on uninitialised value(s) ==4193== at 0x40348829: internal_ascii_loop (in /lib/libc-2.3.2.so) ==4193== by 0x40347084: __gconv_transform_internal_ascii (in /lib/libc-2.3.2.so) ==4193== by 0x403AE9A8: __wcsrtombs (in /lib/libc-2.3.2.so) ==4193== by 0x403771BC: _IO_vfprintf_internal (in /lib/libc-2.3.2.so) As this comes from the libc, perhaps it's not a bug of valgrind. thanks for your help hong On Tue, 2003-05-27 at 12:09, Nicholas Nethercote wrote: > On 27 May 2003, Hong Chen wrote: > > > I'm using valgrind to detect leaks in my program without any luck. When > > I start valgrind : > > valgrind -v myapp args > > > > it worked fine at the very beginning, but when it tried to load a shared > > object , following error messages showed up : > > > > ==2684== Jump to the invalid address stated on the next line > > ==2684== at 0x0: ??? > > ==2684== Address 0x0 is not stack'd, malloc'd or free'd > > Segmentation fault > > > > Without valgrind, I haven't get any trouble to run myapp. Could anyone > > give me a pointer ? any input would be appreciated. > > That's the message you have a variable that is uninitialised, and then you > try to jump to the "address" stored in that variable. But since your > program works fine normally, I'd guess it's a Valgrind bug. Can you > provide the full output from running with -v? Better still, can you trim > down your program into a small example that triggers the error? > > Thanks. > > N |