Profiling on RELENG_7 (and probably HEAD)?

Ivan Voras ivoras at freebsd.org
Wed Oct 24 16:33:16 PDT 2007


Hi,

I tried to profile an applications but there's a problem - the
application crashes in getopt(). I've constructed a simple test case
that demonstrates this:

--- foo.c --
#include <getopt.h>

int main(int argc, char **argv)
{
        getopt(argc, argv, "h");
        return 0;
}
------------

> gcc -pg -g -o foo foo.c
> ./foo
Segmentation fault (core dumped)
> gdb ./foo foo.core
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
Core was generated by `foo'.
Program terminated with signal 11, Segmentation fault.
#0  0x080481be in main (argc=Cannot access memory at address 0xc
) at foo.c:5
5               getopt(argc, argv, "h");
(gdb) bt
#0  0x080481be in main (argc=Cannot access memory at address 0xc
) at foo.c:5

> ldd ./foo
ldd: ./bla: not a dynamic executable

The same test case works on a 6.x machine. Am I missing something or is
profiling broken?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20071024/f1cfabc6/signature.pgp


More information about the freebsd-current mailing list