Segmentation fault on program exit

Hallo to everybody

To whoever could help me, I wish to describe a big problem I am facing on my SOLARIS 9 server (UltraSparc III+).

I am porting some C applications (without multithread) from UNIX SCO to Solaris 9 (I am using Sun Studio 10.),

but all the executables generated end with a Segmentation Fault(coredump).

For instance, when using dbx with my ua_wait executable, going step by step I can see the program execution without any error

till the end of the program (the last closing brackets): after that, the program crashes.

Additionally, when launching dbx with the following command:

dbx -C -I /usr1/source/UA605/UTOOLS bin/ua_wait

I get the following output:

Reading ua_wait

Reading ld.so.1

Reading rtcapihook.so

Reading libma.so

Reading libm.so.1

Reading libc.so.1

Reading libdl.so.1

Reading libc_psr.so.1

Reading rtcaudit.so

Reading libmapmalloc.so.1

Reading libgen.so.1

Reading rtcboot.so

Reading librtc.so

After setting the RTC features issuing the following command:

(dbx) check -all

and launching the execution with:

(dbx) run

I get the following output:

Running: ua_wait

(process id 10907)

RTC: Enabling Error Checking...

signal SEGV (no mapping at the fault address) in evfind at 0xf35148f4

0xf35148f4: evfind+0x001c:ld[%i1], %i5

dbx: Stopped within call to '__rtc_init'. Starting new command interpreter

Is there anyone who can help me to understand what's going on?

Please note that all the executables must be 32 bit ones, as they have to link to a 32 bit shared library (libma.so) previously installed by another software.

The output of the command

file libma.so

is:

libma.so:ELF 32-bit MSB dynamic lib SPARC Version 1, dynamically linked, not stripped

Additional information about the generation of the executables:

In order to generate the ua_wait executable, I first compiled the object files in this way:

cc -g -G -c <source-file> -DSun -xtarget=ultra3 -xarch=v8plus -xcode=pic32 -features=no%extinl

then I compiled the static libraries this way:

ar -c -r -u <static library> <object list>

and then I built the executable through the LD command this way:

ld -o ua_wait ua_wait.o staticlib1.a staticlib2.a staticlib3.a staticlib4.a libma.so -lm -lc

The output of the

file ua_wait

command is

ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped

Thanks in advance,

Diego Curti

[2703 byte] By [dcurti] at [2007-11-25 22:54:43]
# 1

Wouldn't this be more appropriate in one of the Sun Studio forums?

<a href="http://forum.sun.com/index.jspa" target="_blank">http://forum.sun.com/index.jspa</a>

... particularly for 32bit programming in a 64bit environment, on 64bit hardware ?

This is actually a "how do I install my OS from CD media" forum.

rukbat at 2007-7-5 17:10:04 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...