Profiling on RELENG_7 (and probably HEAD)?

From: Ivan Voras <ivoras_at_freebsd.org>
Date: Thu, 25 Oct 2007 01:32:26 +0200
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?


Received on Wed Oct 24 2007 - 21:33:15 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:20 UTC