Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Oct 2007 01:32:26 +0200
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   Profiling on RELENG_7 (and probably HEAD)?
Message-ID:  <ffokmg$7p0$1@ger.gmane.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigAD7B571F21B9041C5BBF1D96
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

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 detail=
s.
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=3DCannot access memory at address 0xc
) at foo.c:5
5               getopt(argc, argv, "h");
(gdb) bt
#0  0x080481be in main (argc=3DCannot 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?


--------------enigAD7B571F21B9041C5BBF1D96
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHH9YQldnAQVacBcgRAiMxAKDC6F7B4NozxC34S4w1k4/3ogNzigCfeBDJ
gHldtVBbr66GwRxRab9K5C4=
=hXr7
-----END PGP SIGNATURE-----

--------------enigAD7B571F21B9041C5BBF1D96--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ffokmg$7p0$1>