This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[review] Fix resolving of PC in overlapping non-zero sized functions


Hi,

nanosleep(3) does not get sometimes resolved on Fedora Core 6:

reproducibility:
$ gcc -o threadcrash threadcrash.c -ggdb3 -Wall -pthread
$ gdb --command=gdb1

without the patch:

#0  0x00ab7402 in __kernel_vsyscall ()
#1  0x0077ec66 in ?? () from /lib/i686/nosegneg/libc.so.6
#2  0x0077ea5c in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:138
#3  0x08048880 in makeSyscall (ignored=0x0) at threadcrash.c:137
#4  0x00867402 in start_thread (arg=0xb7f55b90) at pthread_create.c:296
#5  0x007bf38e in clone () from /lib/i686/nosegneg/libc.so.6

with the patch:

#0  0x0095a402 in __kernel_vsyscall ()
#1  0x0077ec66 in nanosleep () from /lib/i686/nosegneg/libc.so.6
#2  0x0077ea5c in __sleep (seconds=0) at ../sysdeps/unix/sysv/linux/sleep.c:138
#3  0x08048880 in makeSyscall (ignored=0x0) at threadcrash.c:137
#4  0x00867402 in start_thread (arg=0xb7fbdb90) at pthread_create.c:296
#5  0x007bf38e in clone () from /lib/i686/nosegneg/libc.so.6


It occurs for GNU/Linux glibc `__nanosleep' overlapping later
`__nanosleep_nocancel' with PC at 0077ec66:

readelf(1) dump of glibc:
 Num:    Value  Size Type    Bind   Vis      Ndx Name
7247: 0077ec20   124 FUNC    WEAK   DEFAULT   11 __nanosleep
4651: 0077ec2a    32 FUNC    LOCAL  DEFAULT   11 __nanosleep_nocancel


Unfortunately the resolving code has already a lot of exceptions and it may
break something on some platform.


Regards,
Jan

Attachment: gdb-cvs-symbols-overlap.patch
Description: Text document

Attachment: gdb1
Description: Text document

Attachment: threadcrash.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]