Problem with gcc -pg
Rajeskhar Bhattacharjee
raja@zenasis.com
Sat Jan 18 01:06:00 GMT 2003
Hello,
I have a problem using profiling on solaris 8 using gcc. When I compile
a small test program
with gcc -g -pg, it compiles and runs correctly. However, when I build
my main application
using the same flags at the compilationa and likning steps, the build
completes successfully but
the application gives a segemntation fault. Is it a bug? Does gcc have a
problem profiling in
presence of threads or shared libs?
Thanks in advance,
Rajsekhar Bhattacharjee (Raj)
The relevant details are as follows:
OS (using uname -a): SunOS 5.8 Generic_108528-15 sun4u sparc
SUNW,Sun-Blade-100
gcc version (using gcc -v): gcc version 2.95.3 20010315 (release)
debugger output :
GNU gdb 5.0
Copyright 2000 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 "sparc-sun-solaris2.8"...
Core was generated by `/home/raja/zentime/bin/solaris/gprof/zentime
/mnt/elmer/export/home1/TestSyst
em'.
Program terminated with signal 11, Segmentation Fault.
Reading symbols from /usr/lib/libdl.so.1...done.
Loaded symbols for /usr/lib/libdl.so.1
Reading symbols from /usr/lib/libpthread.so.1...done.
Loaded symbols for /usr/lib/libpthread.so.1
Reading symbols from /usr/lib/libcurses.so.1...done.
Loaded symbols for /usr/lib/libcurses.so.1
Reading symbols from /usr/lib/libsocket.so.1...done.
Loaded symbols for /usr/lib/libsocket.so.1
Reading symbols from /usr/lib/libnsl.so.1...done.
Loaded symbols for /usr/lib/libnsl.so.1
Reading symbols from /usr/openwin/lib/libX11.so.4...done.
Loaded symbols for /usr/openwin/lib/libX11.so.4
Reading symbols from /usr/lib/libc.so.1...done.
Loaded symbols for /usr/lib/libc.so.1
Reading symbols from /usr/lib/libmp.so.2...done.
Loaded symbols for /usr/lib/libmp.so.2
Reading symbols from /usr/openwin/lib/libXext.so.0...done.
Loaded symbols for /usr/openwin/lib/libXext.so.0
Reading symbols from /usr/lib/libthread.so.1...done.
Loaded symbols for /usr/lib/libthread.so.1
Reading symbols from
/usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1...done.
Loaded symbols for /usr/platform/SUNW,Ultra-1/lib/libc_psr.so.1
#0 0xfd7dbe8c in __csigsetjmp () from /usr/lib/libthread.so.1
(gdb)
More information about the Gcc-help
mailing list