Bug 9904 - coredumps by gcore are corrupt
Summary: coredumps by gcore are corrupt
Status: RESOLVED DUPLICATE of bug 11804
Alias: None
Product: gdb
Classification: Unclassified
Component: corefiles (show other bugs)
Version: 6.8
: P2 normal
Target Milestone: 6.8
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-25 22:01 UTC by Albert Zeyer
Modified: 2012-07-28 06:19 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Some more information (info target and info addr _r_debug) (16.53 KB, text/plain)
2009-02-25 23:54 UTC, Albert Zeyer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Zeyer 2009-02-25 22:01:52 UTC
Basically what I am doing is: attach to the app, gcore, quit, load the core

Here some output which demonstrates the problem:

az@acompneu ~/Programmierung/openlierox $ gdb bin/openlierox 3661GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Attaching to program: /home/az/Programmierung/openlierox/bin/openlierox, process
3661
Reading symbols from /usr/lib/libSDL-1.2.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libSDL-1.2.so.0.11.2.debug...done.
done.
Loaded symbols for /usr/lib/libSDL-1.2.so.0
Reading symbols from /lib/libpthread.so.0...Reading symbols from
/usr/lib/debug/lib/libpthread-2.6.1.so.debug...done.
[Thread debugging using libthread_db enabled]
[New Thread 0xb64c2910 (LWP 3661)]
[New Thread 0xa1c1eb90 (LWP 3702)]
[New Thread 0xa2bc8b90 (LWP 3701)]
[New Thread 0xa33cfb90 (LWP 3700)]
[New Thread 0xa3bd6b90 (LWP 3699)]
[New Thread 0xa43ddb90 (LWP 3698)]
[New Thread 0xa4be4b90 (LWP 3697)]
[New Thread 0xa53ebb90 (LWP 3696)]
[New Thread 0xa5bf2b90 (LWP 3695)]
[New Thread 0xa63f9b90 (LWP 3694)]
[New Thread 0xa6c00b90 (LWP 3693)]
[New Thread 0xa7407b90 (LWP 3692)]
[New Thread 0xa7c0eb90 (LWP 3691)]
[New Thread 0xa8415b90 (LWP 3690)]
[New Thread 0xa8c1cb90 (LWP 3689)]
[New Thread 0xa9423b90 (LWP 3688)]
[New Thread 0xa9c2ab90 (LWP 3687)]
[New Thread 0xaa431b90 (LWP 3686)]
[New Thread 0xaac38b90 (LWP 3685)]
[New Thread 0xab43fb90 (LWP 3684)]
[New Thread 0xabc46b90 (LWP 3683)]
[New Thread 0xac44db90 (LWP 3682)]
[New Thread 0xacc54b90 (LWP 3681)]
[New Thread 0xad45bb90 (LWP 3680)]
[New Thread 0xadc62b90 (LWP 3679)]
[New Thread 0xae469b90 (LWP 3678)]
[New Thread 0xaec70b90 (LWP 3677)]
[New Thread 0xaf477b90 (LWP 3676)]
[New Thread 0xafc7eb90 (LWP 3675)]
[New Thread 0xb0485b90 (LWP 3674)]
[New Thread 0xb0c8cb90 (LWP 3673)]
[New Thread 0xb1493b90 (LWP 3672)]
[New Thread 0xb1c9ab90 (LWP 3671)]
[New Thread 0xb24a1b90 (LWP 3670)]
[New Thread 0xb2ca8b90 (LWP 3669)]
[New Thread 0xb34afb90 (LWP 3668)]
[New Thread 0xb3cb6b90 (LWP 3667)]
[New Thread 0xb44bdb90 (LWP 3666)]
[New Thread 0xb4cbeb90 (LWP 3665)]
[New Thread 0xb54bfb90 (LWP 3664)]
[New Thread 0xb5cc0b90 (LWP 3663)]
[New Thread 0xb64c1b90 (LWP 3662)]
done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/libSDL_image-1.2.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libSDL_image-1.2.so.0.1.5.debug...done.
done.
Loaded symbols for /usr/lib/libSDL_image-1.2.so.0
Reading symbols from /lib/libz.so.1...Reading symbols from
/usr/lib/debug/lib/libz.so.1.2.3.debug...done.
done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /usr/lib/libxml2.so.2...Reading symbols from
/usr/lib/debug/usr/lib/libxml2.so.2.7.2.debug...done.
done.
Loaded symbols for /usr/lib/libxml2.so.2
Reading symbols from /usr/lib/libSDL_mixer-1.2.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libSDL_mixer-1.2.so.0.2.6.debug...done.
done.
Loaded symbols for /usr/lib/libSDL_mixer-1.2.so.0
Reading symbols from /usr/lib/libgd.so.2...Reading symbols from
/usr/lib/debug/usr/lib/libgd.so.2.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libgd.so.2
Reading symbols from /usr/lib/NL.so.1.6...Reading symbols from
/usr/lib/debug/usr/lib/libNL.so.1.6.8.debug...done.
done.
Loaded symbols for /usr/lib/NL.so.1.6
Reading symbols from /usr/lib/libzip.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libzip.so.1.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libzip.so.1
Reading symbols from /usr/lib/libX11.so.6...Reading symbols from
/usr/lib/debug/usr/lib/libX11.so.6.2.0.debug...done.
done.
Loaded symbols for /usr/lib/libX11.so.6
Reading symbols from
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/libstdc++.so.6...Reading symbols from
/usr/lib/debug/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/libstdc++.so.6.0.10.debug...done.
done.
Loaded symbols for /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/libstdc++.so.6
Reading symbols from /lib/libm.so.6...Reading symbols from
/usr/lib/debug/lib/libm-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/libm.so.6
Reading symbols from
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/libgcc_s.so.1...Reading symbols from
/usr/lib/debug/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/libgcc_s.so.1.debug...done.
done.
Loaded symbols for /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/libgcc_s.so.1
Reading symbols from /lib/libc.so.6...Reading symbols from
/usr/lib/debug/lib/libc-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/libdl.so.2...Reading symbols from
/usr/lib/debug/lib/libdl-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /usr/lib/libesd.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libesd.so.0.2.39.debug...done.
done.
Loaded symbols for /usr/lib/libesd.so.0
Reading symbols from /usr/lib/libggi.so.2...Reading symbols from
/usr/lib/debug/usr/lib/libggi.so.2.0.2.debug...done.
done.
Loaded symbols for /usr/lib/libggi.so.2
Reading symbols from /usr/lib/libgii.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libgii.so.1.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libgii.so.1
Reading symbols from /usr/lib/libgg.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libgg.so.1.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libgg.so.1
Reading symbols from /usr/lib/libaa.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libaa.so.1.0.4.debug...done.
done.
Loaded symbols for /usr/lib/libaa.so.1
Reading symbols from /usr/lib/libcaca.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libcaca.so.0.99.14.debug...done.
done.
Loaded symbols for /usr/lib/libcaca.so.0
Reading symbols from /usr/lib/libcucul.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libcucul.so.0.99.14.debug...done.
done.
Loaded symbols for /usr/lib/libcucul.so.0
Reading symbols from /lib/ld-linux.so.2...Reading symbols from
/usr/lib/debug/lib/ld-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/libmikmod.so.2...Reading symbols from
/usr/lib/debug/usr/lib/libmikmod.so.2.0.4.debug...done.
done.
Loaded symbols for /usr/lib/libmikmod.so.2
Reading symbols from /usr/lib/libXpm.so.4...Reading symbols from
/usr/lib/debug/usr/lib/libXpm.so.4.11.0.debug...done.
done.
Loaded symbols for /usr/lib/libXpm.so.4
Reading symbols from /usr/lib/libjpeg.so.62...Reading symbols from
/usr/lib/debug/usr/lib/libjpeg.so.62.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libjpeg.so.62
Reading symbols from /usr/lib/libfreetype.so.6...Reading symbols from
/usr/lib/debug/usr/lib/libfreetype.so.6.3.18.debug...done.
done.
Loaded symbols for /usr/lib/libfreetype.so.6
Reading symbols from /usr/lib/libpng12.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libpng12.so.0.35.0.debug...done.
done.
Loaded symbols for /usr/lib/libpng12.so.0
Reading symbols from /usr/lib/libxcb-xlib.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libxcb-xlib.so.0.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libxcb-xlib.so.0
Reading symbols from /usr/lib/libxcb.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libxcb.so.1.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libxcb.so.1
Reading symbols from /usr/lib/libasound.so.2...Reading symbols from
/usr/lib/debug/usr/lib/libasound.so.2.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libasound.so.2
Reading symbols from /usr/lib/libaudiofile.so.0...Reading symbols from
/usr/lib/debug/usr/lib/libaudiofile.so.0.0.2.debug...done.
done.
Loaded symbols for /usr/lib/libaudiofile.so.0
Reading symbols from /lib/libncurses.so.5...Reading symbols from
/usr/lib/debug/lib/libncurses.so.5.6.debug...done.
done.
Loaded symbols for /lib/libncurses.so.5
Reading symbols from /usr/lib/libXxf86vm.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libXxf86vm.so.1.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libXxf86vm.so.1
Reading symbols from /usr/lib/libXxf86dga.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libXxf86dga.so.1.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libXxf86dga.so.1
Reading symbols from /usr/lib/libXext.so.6...Reading symbols from
/usr/lib/debug/usr/lib/libXext.so.6.4.0.debug...done.
done.
Loaded symbols for /usr/lib/libXext.so.6
Reading symbols from /usr/lib/libXau.so.6...Reading symbols from
/usr/lib/debug/usr/lib/libXau.so.6.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libXau.so.6
Reading symbols from /usr/lib/libXdmcp.so.6...Reading symbols from
/usr/lib/debug/usr/lib/libXdmcp.so.6.0.0.debug...done.
done.
Loaded symbols for /usr/lib/libXdmcp.so.6
Reading symbols from /lib/libncursesw.so.5...Reading symbols from
/usr/lib/debug/lib/libncursesw.so.5.6.debug...done.
done.
Loaded symbols for /lib/libncursesw.so.5
Reading symbols from /usr/lib/opengl/nvidia/lib/libGL.so.1...done.
Loaded symbols for //usr//lib/opengl/nvidia/lib/libGL.so.1
Reading symbols from /usr/lib/libglut.so.3...Reading symbols from
/usr/lib/debug/usr/lib/libglut.so.3.8.0.debug...done.
done.
Loaded symbols for /usr/lib/libglut.so.3
Reading symbols from /lib/librt.so.1...Reading symbols from
/usr/lib/debug/lib/librt-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /usr/lib/opengl/nvidia/lib/libGLcore.so.1...done.
Loaded symbols for //usr//lib/opengl/nvidia/lib/libGLcore.so.1
Reading symbols from /usr/lib/opengl/nvidia/lib/libnvidia-tls.so.1...done.
Loaded symbols for //usr//lib/opengl/nvidia/lib/libnvidia-tls.so.1
Reading symbols from /usr/lib/libGLU.so.1...Reading symbols from
/usr/lib/debug/usr/lib/libGLU.so.1.3.060502.debug...done.
done.
Loaded symbols for /usr/lib/libGLU.so.1
Reading symbols from /lib/libnss_files.so.2...Reading symbols from
/usr/lib/debug/lib/libnss_files-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/libnss_files.so.2
Reading symbols from /lib/libnss_dns.so.2...Reading symbols from
/usr/lib/debug/lib/libnss_dns-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/libnss_dns.so.2
Reading symbols from /lib/libresolv.so.2...Reading symbols from
/usr/lib/debug/lib/libresolv-2.6.1.so.debug...done.
done.
Loaded symbols for /lib/libresolv.so.2
0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e78566 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb7ed9929 in SDL_CondWait (cond=0xfffffe00, mutex=0x998c6d8)
    at ./src/thread/pthread/SDL_syscond.c:150
#3  0x083a4667 in ThreadPool::wait (this=0x998c7b8, thread=0x99918f8, 
    status=0x0)
    at /home/az/Programmierung/openlierox/src/common/ThreadPool.cpp:154
#4  0x08168503 in main (argc=10, argv=0xbfa33874)
    at /home/az/Programmierung/openlierox/src/main.cpp:392
(gdb) t 2
[Switching to thread 2 (Thread 0xa1c1eb90 (LWP 3702))]#0  0xffffe424 in
__kernel_vsyscall ()
(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e7b7e6 in nanosleep () from /lib/libpthread.so.0
#2  0xb7edce3f in SDL_Delay (ms=1) at ./src/timer/unix/SDL_systimer.c:118
#3  0xb7edce83 in RunTimer (unused=0x0) at ./src/timer/unix/SDL_systimer.c:203
#4  0xb7e955ff in SDL_RunThread (data=0x9a8de50)
    at ./src/thread/SDL_thread.c:202
#5  0xb7ed94a5 in RunThread (data=0x9a8de50)
    at ./src/thread/pthread/SDL_systhread.c:47
#6  0xb7e7417b in start_thread (arg=0xa1c1eb90) at pthread_create.c:296
#7  0xb7a4f06e in clone () from /lib/libc.so.6
(gdb) t 10
[Switching to thread 10 (Thread 0xa63f9b90 (LWP 3694))]#0  0xffffe424 in
__kernel_vsyscall ()
(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e78566 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xb7ed9929 in SDL_CondWait (cond=0xfffffe00, mutex=0x998c6d8)
    at ./src/thread/pthread/SDL_syscond.c:150
#3  0x083a4ab6 in ThreadPool::threadWrapper (param=0x9998b88)
    at /home/az/Programmierung/openlierox/src/common/ThreadPool.cpp:72
#4  0xb7e955ff in SDL_RunThread (data=0x9998ad0)
    at ./src/thread/SDL_thread.c:202
#5  0xb7ed94a5 in RunThread (data=0x9998ad0)
    at ./src/thread/pthread/SDL_systhread.c:47
#6  0xb7e7417b in start_thread (arg=0xa63f9b90) at pthread_create.c:296
#7  0xb7a4f06e in clone () from /lib/libc.so.6
(gdb) gcore core.gdb-gcore
Saved corefile core.gdb-gcore
(gdb) quit
The program is running.  Quit anyway (and detach it)? (y or n) y
Detaching from program: /home/az/Programmierung/openlierox/bin/openlierox,
process 3661
az@acompneu ~/Programmierung/openlierox $ gdb bin/openlierox core.gdb-gcore 
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Core was generated by `/home/az/Programmierung/openlierox/bin/openlierox'.
[New process 3662]
[New process 3663]
[New process 3664]
[New process 3665]
[New process 3666]
[New process 3667]
[New process 3668]
[New process 3669]
[New process 3670]
[New process 3671]
[New process 3672]
[New process 3673]
[New process 3674]
[New process 3675]
[New process 3676]
[New process 3677]
[New process 3678]
[New process 3679]
[New process 3680]
[New process 3681]
[New process 3682]
[New process 3683]
[New process 3684]
[New process 3685]
[New process 3686]
[New process 3687]
[New process 3688]
[New process 3689]
[New process 3690]
[New process 3691]
[New process 3692]
[New process 3693]
[New process 3694]
[New process 3695]
[New process 3696]
[New process 3697]
[New process 3698]
[New process 3699]
[New process 3700]
[New process 3701]
[New process 3702]
[New process 3661]
#0  0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e78566 in ?? ()
#2  0x00000002 in ?? ()
#3  0x00000000 in ?? ()
(gdb) t 1
[Switching to thread 1 (process 3662)]#0  0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e78566 in ?? ()
#2  0x00000002 in ?? ()
#3  0x00000000 in ?? ()
(gdb) t 10
[Switching to thread 10 (process 3671)]#0  0xffffe424 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb7e78566 in ?? ()
#2  0x00000002 in ?? ()
#3  0x00000000 in ?? ()
(gdb) q
az@acompneu ~/Programmierung/openlierox $
Comment 1 Albert Zeyer 2009-02-25 22:04:12 UTC
Coredumps generated by the kernel are valid, GDB can read them just fine.

I can also attach the core together with debugging symbols if that helps.
Comment 2 Albert Zeyer 2009-02-25 23:54:37 UTC
Created attachment 3768 [details]
Some more information (info target and info addr _r_debug)
Comment 3 Scott Bunnell 2009-06-03 17:34:36 UTC
I've confirmed the same issue.  Not much more to add other than I tested the
same with the latest build (currenlty) http://ftp.gnu.org/gnu/gdb/gdb-6.8.tar.bz2.
uname -a:  2.6.16.60-0.39.3-smp #1 SMP Mon May 11 11:46:34 UTC 2009 i686 i686
i386 GNU/Linux

gdb -v
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".


Comment 4 Richard Hughes 2010-05-18 10:36:57 UTC
I had these symptoms - the core files were far too small to be valid (they 
contained metadata but no memory dump). A little debugging led me to http://
www.linuxquestions.org/questions/linux-kernel-70/proc-pid-maps-files-empty-for-
all-processes-787559/. Upgrading to Debian kernel 2.6.26-21lenny4 fixed it.
Comment 5 Jan Kratochvil 2010-08-30 10:30:02 UTC
Reproducer isn't provided here but guessing it could be a forward-"duplicate" of:
Fix gcore writer for -Wl,-z,relro (PR corefiles/11804)
Comment 6 Jan Kratochvil 2012-07-28 06:19:18 UTC
Other post has also confirmed this PR to be a duplicate:
[PATCH] refreshed patch for PR 11804 and PR 9904
http://sourceware.org/ml/gdb-patches/2012-07/msg00249.html

*** This bug has been marked as a duplicate of bug 11804 ***