Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Crash in getenv(3)

On Apr 10,  2:14pm, (Robert Swindells) wrote:
-- Subject: Re: Crash in getenv(3)

| >>I have got debug libraries built for this machine but haven't worked out
| >>how to link against them yet.
| >Build a system with MKDEBUG=yes and you'll get more info.
| It was built with MKDEBUG=yes, what else do I need to do to get gdb
| to pick up the debug libraries ?

Yes, I meant to fix that... The problem is that binaries that link with
/lib/ look for debug symbols in 


The following trick fixes it... I am not sure if adding a symlink in the
build for shared libraries in /lib is the proper way though (yet).


[11:24am] 2501#ln -s /usr/libdata/debug/usr/lib/ 
[11:24am] 2502#gdb /bin/ls
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
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 "x86_64--netbsd".
For bug reporting instructions, please see:
Reading symbols from /bin/ls...Reading symbols from 
(gdb) break __stat50
Function "__stat50" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y

Breakpoint 1 (__stat50) pending.
(gdb) r
Starting program: /bin/ls 

Breakpoint 1, 0x00007f7ff7102aa0 in __stat50 () from /lib/
(gdb) where
#0  0x00007f7ff7102aa0 in __stat50 () from /lib/
#1  0x00007f7ff709efad in fts_stat (sp=<optimized out>, p=0x7f7ff7b0b100, 
    follow=1) at /usr/src/lib/libc/gen/fts.c:941
#2  0x00007f7ff709fb8a in *__fts_open60 (argv=<optimized out>, 
    options=<optimized out>, compar=0x401a00 <mastercmp>)
    at /usr/src/lib/libc/gen/fts.c:171
#3  0x00000000004022a0 in traverse (argc=1, argv=<optimized out>, options=25)
    at /net/quasar/src-5/NetBSD/src/bin/ls/ls.c:413
#4  0x0000000000402a7b in ls_main (argc=0, argv=0x7f7fffffd750)
    at /net/quasar/src-5/NetBSD/src/bin/ls/ls.c:393
#5  0x0000000000401722 in ___start (cleanup=<optimized out>, 
    obj=<optimized out>, ps_strings=0x7f7fffffffe0)
    at /net/quasar/src-5/NetBSD/src/lib/csu/common/crt0-common.c:183
#6  0x00007f7ff7ffa000 in ?? ()
#7  0x0000000000000001 in ?? ()
#8  0x00007f7ffffff9f8 in ?? ()
#9  0x0000000000000000 in ?? ()
(gdb) q
A debugging session is active.

        Inferior 1 [process 6351] will be killed.

Quit anyway? (y or n) y

Home | Main Index | Thread Index | Old Index