Skip to contentSkip to conversation

pfunct crash on libSDL

DISCUSSION Diego 'Flameeyes' Pettenò 2 participants 4 messages Nov 9, 2008 – Nov 10, 2008 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

Em Sun, Nov 09, 2008 at 08:25:29PM +0100, Diego 'Flameeyes' Pettenò escreveu:

Quoted 11 lines

Hi,

at http://www.flameeyes.eu/tmp/dwarves-crash-20081109.tar.bz2 I've uploaded a libSDL compiled on my system that crashes pfunct, both with -l and with -f some_function.

The funny thing is that gdb is unable to provide me a backtrace ...

This is with both an old git copy I had and the latest newest git I can fetch today.

Strange:

[acme@doppio pahole]$ cat .git/refs/heads/master
bcf1c15d8bc8cfe2ce0977d249d49268dfcebaf1

acme@doppio pahole]$ pfunct -TVilf CheckMounts tmp/usr/lib/debug/usr/lib64/libSDL-1.2.so.0.11.2.debug /* <91a61> ./src/cdrom/linux/SDL_syscdrom.c:188 */
void CheckMounts(const char * mtab);
{ /* low_pc=0x49ae0 */

	FILE * mntfp;                                                 //   189
	struct mntent * mntent;                                       //   190
	struct stat stbuf;                                            //   191

{
char * tmp; // 195
char * mnt_type; // 196
size_t mnt_type_len; // 197
char * mnt_dev; // 198
size_t mnt_dev_len; // 199
{ /* CheckMounts+0xe1 */
size_t __s1_len; // 218
size_t __s2_len; // 218
} /* lexblock size=15 */
{
size_t __s1_len; // 242
size_t __s2_len; // 242
} /* lexblock size=0 */
} /* lexblock size=0 */
}/* size: 474, variables: 3 */

acme@doppio pahole]$ ldd which pfunct

	linux-vdso.so.1 =>  (0x00007fff741fe000)
	libdwarves.so.1 => /home/acme/git/pahole/build/libdwarves.so.1 (0x0000000000110000)
	libdwarves_emit.so.1 => /home/acme/git/pahole/build/libdwarves_emit.so.1 (0x0000000000604000)
	libz.so.1 => /lib64/libz.so.1 (0x000000371d000000)
	libdw.so.1 => /usr/lib64/libdw.so.1 (0x000000371c400000)
	libelf.so.1 => /usr/lib64/libelf.so.1 (0x000000371d800000)
	libc.so.6 => /lib64/libc.so.6 (0x000000371c000000)
	libdl.so.2 => /lib64/libdl.so.2 (0x000000371c800000)
	/lib64/ld-linux-x86-64.so.2 (0x000000371bc00000)

[acme@doppio pahole]$

And I'm using elfutils 0.137 on this machine.

Humm, I see, its the other file in this tarball, the one without debugging info, that makes the CTF code crash in pfunct, I'll fix that, but please use the file with .debug suffix for now, its there that the DWARF info is anyway :-)

Ahm and the backtrace is this:

(gdb) bt

#0  0x000000371c0f33a1 in ?? () from /lib64/libc.so.6
#1  0x000000371c0f38e4 in argp_parse () from /lib64/libc.so.6
#2  0x000000000011d5cf in ctf__load (self=0x604010, argp=0x603360, argc=4, argv=0x7fffffffe158) at /home/acme/git/pahole/ctf_loader.c:797
#3  0x000000000011b5b4 in cus__loadfl (self=0x604010, argp=0x603360, argc=4, argv=0x7fffffffe158) at /home/acme/git/pahole/dwarves.c:2584
#4  0x0000000000402044 in main (argc=4, argv=0x7fffffffe158) at /home/acme/git/pahole/pfunct.c:499

It tries to read the DWARF info, there is none, so it tries to find CTF data, but then hits a bug.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Arnaldo Carvalho de Melo <[email protected]>

Quoted 4 lines · writes:

Humm, I see, its the other file in this tarball, the one without debugging info, that makes the CTF code crash in pfunct, I'll fix that, but please use the file with .debug suffix for now, its there that the DWARF info is anyway :-)

Ah okay :) I'm used to just run on the main binary, hoping that the debug link is followed, I guess I'll have to change my process, but then I'll be feature-requesting for the debuglink to be followed :P

Signature · 2 lines
Diego "Flameeyes" Pettenò
http://blog.flameeyes.eu/
#5 lore raw
In reply to a message not in the archive

Em Mon, Nov 10, 2008 at 04:57:51PM +0100, Diego 'Flameeyes' Pettenò escreveu:

Quoted 11 lines

Arnaldo Carvalho de Melo <[email protected]>

Quoted 4 lines · writes:

Humm, I see, its the other file in this tarball, the one without debugging info, that makes the CTF code crash in pfunct, I'll fix that, but please use the file with .debug suffix for now, its there that the DWARF info is anyway :-)

Ah okay :) I'm used to just run on the main binary, hoping that the debug link is followed, I guess I'll have to change my process, but then I'll be feature-requesting for the debuglink to be followed :P

I thought that libdwfl would do that, lemme check... Yeah:

open("tmp/usr/lib64/libSDL-1.2.so.0.11.2", O_RDONLY) = 3
open("tmp/usr/lib64/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("tmp/usr/lib64/.debug/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/acme/git/pahole/tmp/usr/lib64/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("/home/acme/git/pahole/tmp/usr/lib64/.debug/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/debug/home/acme/git/pahole/tmp/usr/lib64/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = -1 ENOENT (No such file or directory)

So its just a matter of using one of the searched places :-)

To try this I just did a 'yum install SDL-debuginfo' and:

acme@doppio pahole]$ pfunct -TVIlf SDL_PauseAudio
/usr/lib64/libSDL-1.2.so.0
/* <1b92> src/audio/SDL_audio.c:589 */
void SDL_PauseAudio(int pause_on);
{ /* low_pc=0x88b0 */
SDL_AudioDevice * audio; // 590
}/* size: 20, variables: 1 */
[acme@doppio pahole]$

So it works, but this time by using build id :-)

[acme@doppio pahole]$ strace -e trace=open pfunct -TVIlf SDL_PauseAudio /usr/lib64/libSDL-1.2.so.0 2>&1 | grep debug open("/usr/lib/debug/.build-id/06/5ae7d6742b683430474e3415ae5081be5586a7.debug", O_RDONLY) = 3 [acme@doppio pahole]$

But...

[acme@doppio pahole]$ l
/usr/lib/debug/.build-id/06/5ae7d6742b683430474e3415ae5081be5586a7.debug lrwxrwxrwx 1 root root 42 2008-11-10 14:08 /usr/lib/debug/.build-id/06/5ae7d6742b683430474e3415ae5081be5586a7.debug -> ../../usr/lib64/libSDL-1.2.so.0.11.2.debug* [acme@doppio pahole]$

Let us try removing this symlink... It still works, but this time:

[acme@doppio pahole]$ strace -e trace=open pfunct -TVIlf SDL_PauseAudio /usr/lib64/libSDL-1.2.so.0 2>&1 | grep debug open("/usr/lib/debug/.build-id/06/5ae7d6742b683430474e3415ae5081be5586a7.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib64/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib64/.debug/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/debug/usr/lib64/libSDL-1.2.so.0.11.2.debug", O_RDONLY) = 3
[acme@doppio pahole]$

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html