Operating System - HP-UX
1832865 Members
3057 Online
110048 Solutions
New Discussion

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

 
Anthony Pun
New Member

Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

Hi Everyone,

We've recently upgraded OS from 11.00 to 11.11 (HP-UX hfiledev B.11.11 U 9000/800 668319303 unlimited-user license), and also our gcc compiler to version 3.3.2...

(/home/apun/test)
hfiledev[20]% gcc -v
Reading specs from /usr/local/lib/gcc-lib/hppa2.0w-hp-hpux11.11/3.3.2/specs
Configured with: /scratch/root/gcc-pkg/3.3.1/hpux-11/gcc-3.3.2/configure --enable-languages=c,c++ --enable-threads=posix --disable-nls --with-gnu-as --without-gnu-ld --with-as=/usr/local/bin/as --prefix=/usr/local
Thread model: posix
gcc version 3.3.2

I'm running into a SIGSEGV on a return statement in one of our programs. GDB output...

#0 0xc019a518 in free () from /usr/lib/libc.2
(gdb) bt
#0 0xc019a518 in free () from /usr/lib/libc.2
#1 0xc23f57a8 in operator delete(void*) () from /usr/local/lib/libstdc++.sl.5
#2 0xc23f5820 in operator delete[](void*) ()
from /usr/local/lib/libstdc++.sl.5
#3 0xc23a2f04 in std::ios_base::~ios_base() ()
from /usr/local/lib/libstdc++.sl.5
#4 0xc239b6b8 in std::basic_ofstream >::~basic_ofstream() () from /usr/local/lib/libstdc++.sl.5
#5 0x00023734 in Database::genMakefile() (this=0x40025318) at makefile.cpp:487
#6 0x0000531c in main (argc=10, argv=0x7f7f037c) at main.cpp:140
(gdb)

Line 487 of makefile.cpp is a return out of a function.

Anyway, Here's some of the things I've done so far...

- Checked the Kernel parameters.
- Compiled PA-RISC 1.1
- Compiled PA-RISC 2.0 32-bit
- Compiled PA-RISC 2.0 64-bit

Here's a tail of tusc...

mmap(NULL, 45056, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_
SHLIB, -1, NULL) = 0x7b043000
@
"tusc.log" 151 lines, 10638 characters
brk(0x40060000) .......................................... = 0
stat("/usr/lib/tztab", 0x7f7f0b68) ....................... = 0
open("/usr/lib/tztab", O_RDONLY, 0) ...................... = 4
mmap(NULL, 12794, PROT_READ, MAP_PRIVATE, 4, NULL) ....... = 0x7b014000
close(4) ................................................. = 0
ioctl(3, TCGETA, 0x7f7f1888) ............................. ERR#25 ENOTTY
write(3, "# # # # # # # # # # # # # # # # ".., 2056) ..... = 2056
close(3) ................................................. = 0
Received signal 11, SIGSEGV, in user mode, [SIG_DFL], partial siginfo
Siginfo: si_code: I_NONEXIST, faulting address: 0xfffffff3, si_errno: 0
PC: 0xc019a51b, instruction: 0x4afa0000
exit(11) [implicit] ...................................... WIFSIGNALED(SIGSEGV)|
WCOREDUMP


Any input would be greatly appreciated. Thanks!

8 REPLIES 8
Anthony Pun
New Member

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

Also, here's where I downloaded gcc 3.3.2 and binutils...

http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,547,00.html

H.Merijn Brand (procura
Honored Contributor

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

As for gcc is one of the few exceptions to the rule, you need a different gcc on 11i than on 11.00. They are not compatible.

So if you got the gcc-3.3.2 from HP somewhere, be sure to check if it was built on and for 11i, and not for 11.00

If you want to be sure, fetch a gcc-3.3.3 binary including binutils-2.14 and gdb-6.0 from my HP ITRC site.

My HP ITRC site pages can be found at

Singapore https://www.beepz.com/personal/merijn/
Rotterdam http://www.cmve.net/~merijn/
Seattle http://ww.hpux.ws/merijn/

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Anthony Pun
New Member

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

Thanks for the reply.

I'm sure that the gcc I've installed is for 11.11. I probably should have mentioned, that I've already tried the one off of your website.

A big thanks, for maintaining your website.

Tony
H.Merijn Brand (procura
Honored Contributor

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

Did my version caused segv's too?

Just curious. Cannot do much about it.

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Albert Smith_1
Regular Advisor

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

Looks like your libstdc is out of date not compliant with your version of GCC. I normally get my GCC and related apps from the HP Porting Archive.
Anthony Pun
New Member

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

The one from your site had the same problem. I'm going to rebuild gcc and see if that fixes it.

Thanks.
Anthony Pun
New Member

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

Rebuild gcc 3.3.2 from source, bootstrap4. Still dumping in libstdc++.sl.5...

GNU gdb 6.0
Copyright 2003 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 "hppa2.0w-hp-hpux11.11"...
Core was generated by `generate'.
Program terminated with signal 11, Segmentation fault.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.


warning: Can't find file generate referenced in dld_list.
Reading symbols from /usr/local/lib/libstdc++.sl.5...done.
Reading symbols from /usr/lib/libpthread.1...done.
Reading symbols from /usr/lib/libm.2...done.
Reading symbols from /usr/local/lib/libgcc_s.sl...done.
Reading symbols from /usr/lib/libc.2...done.
Reading symbols from /usr/lib/libdld.2...done.
0xc23ac53c in std::locale::~locale() () from /usr/local/lib/libstdc++.sl.5
(gdb) bt
#0 0xc23ac53c in std::locale::~locale() () from /usr/local/lib/libstdc++.sl.5
(gdb) where
#0 0xc23ac53c in std::locale::~locale() () from /usr/local/lib/libstdc++.sl.5
(gdb) up
Initial frame selected; you cannot go up.
(gdb) up
Initial frame selected; you cannot go up.
(gdb) down


Any ideas? Thanks!

H.Merijn Brand (procura
Honored Contributor

Re: Upgrade from gcc 2.95 to gcc 3.3.2 causes program to sigsegv.

Did you set any locale? like in $LANG, or $LC_ALL?

Could you try without, or with $LANG=C?

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn