Dwarves Archive on lore.kernel.org
 help / color / Atom feed
* pfunct crash on libSDL
@ 2008-11-09 19:25 Diego 'Flameeyes' Pettenò
       [not found] ` <m21vxkk8gm.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2008-11-09 19:25 UTC (permalink / raw)
  To: dwarves-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1: Type: text/plain, Size: 404 bytes --]


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.

-- 
Diego "Flameeyes" Pettenò
http://blog.flameeyes.eu/


[-- Attachment #2: Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pfunct crash on libSDL
       [not found] ` <m21vxkk8gm.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2008-11-10 15:08   ` Arnaldo Carvalho de Melo
  2008-11-10 15:57     ` Diego 'Flameeyes' Pettenò
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-11-10 15:08 UTC (permalink / raw)
  To: Diego 'Flameeyes' Pettenò; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Sun, Nov 09, 2008 at 08:25:29PM +0100, Diego 'Flameeyes' Pettenò escreveu:
> 
> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pfunct crash on libSDL
  2008-11-10 15:08   ` Arnaldo Carvalho de Melo
@ 2008-11-10 15:57     ` Diego 'Flameeyes' Pettenò
       [not found]       ` <m2wsfbineo.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Diego 'Flameeyes' Pettenò @ 2008-11-10 15:57 UTC (permalink / raw)
  To: dwarves-u79uwXL29TY76Z2rM5mHXA


[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

Arnaldo Carvalho de Melo <acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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

-- 
Diego "Flameeyes" Pettenò
http://blog.flameeyes.eu/

[-- Attachment #2: Type: application/pgp-signature, Size: 196 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pfunct crash on libSDL
       [not found]       ` <m2wsfbineo.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2008-11-10 16:12         ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2008-11-10 16:12 UTC (permalink / raw)
  To: Diego 'Flameeyes' Pettenò; +Cc: dwarves-u79uwXL29TY76Z2rM5mHXA

Em Mon, Nov 10, 2008 at 04:57:51PM +0100, Diego 'Flameeyes' Pettenò escreveu:
> Arnaldo Carvalho de Melo <acme-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-09 19:25 pfunct crash on libSDL Diego 'Flameeyes' Pettenò
     [not found] ` <m21vxkk8gm.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-11-10 15:08   ` Arnaldo Carvalho de Melo
2008-11-10 15:57     ` Diego 'Flameeyes' Pettenò
     [not found]       ` <m2wsfbineo.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-11-10 16:12         ` Arnaldo Carvalho de Melo

Dwarves Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dwarves/0 dwarves/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dwarves dwarves/ https://lore.kernel.org/dwarves \
		dwarves@vger.kernel.org
	public-inbox-index dwarves

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dwarves


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git