libgreat

Ticket #18 (new)

Opened 4 years ago

Last modified 4 years ago

Cannot resolve functions used by dlsym()

Reported by: kate Owned by:
Keywords: Cc:

Description

If we're overriding a function called by dlym(), our call to dlsym() to resolve that function will cause an infinite loop. This is the case for isalnum() on NetBSD 3.1:

(gdb) bt
#0  0x00000000 in ?? ()
#1  0xbdbe65e3 in ?? ()
#2  0xbdba72b4 in strftime () from /usr/lib/libc.so.12
#3  0xbdba763d in localtime_r () from /usr/lib/libc.so.12
#4  0xbdbe797b in ?? ()
#5  0xbdbe7ddb in ?? ()
#6  0xbdbe8260 in ?? ()
#7  0xbdbe6f21 in ?? ()
#8  0xbdbe700f in ?? ()
#9  0xbdbe6367 in ?? ()
#10 0xbdbf6c40 in _rtld () from /usr/libexec/ld.elf_so
(gdb)

Change History

comment:1 Changed 4 years ago by kate

<DrNick> I don't know about other libraries, but internal glibc library calls aren't
         overridden when you do this
<DrNick> I suppose it's going to be very libc dependent
<kate`> how would it know?
<DrNick> there's no "knowing" involved, it's linked that way
<DrNick> libc's calls to it's own functions don't go through the PLT, therefore they can't
         be overridden
Note: See TracTickets for help on using tickets.