system() cause core dump

2007-12-25 11:15:00

Heloo, all,

Thanks for all response.

The problem is solved, but I don't know why. In system() arguments, I

used compile another program. If argument's executable name is different

with program's executable name. works fine. I guess when I run program's

executable, e.g. a.out, the system() output a.out will overwrite it.

What I don't understand is that I run it same way on our university's

enterprise3000 and Ultrix without problem, it crash on my ultra2!

Thanks!

Feng

ORIGINAL QUESTION:

-------------------------------

> Hello, all,

> I have Ultra2 with solaris7. gcc 2.8.1 is installed.

> Every time I use system() function in my program, executable will

cause

> core dump.

> Is there someone know what cause this problem?

> Thanks!

RESPONSE:

--------------------------

Bertrand_Hutin@notes.amdahl.com

bad arguments to system().

David Robillard <David.Robillard@Matrox.COM>

Could that be it;

sparc-sun-solaris2.7

    Sun patch 107058-01 (1999-01-13) for SPARC Solaris 7 triggers a bug

in

    the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8

and

    later, including all EGCS releases. To avoid this problem, do not

    install Sun patch 107058-01 until after Sun releases a patch for bug

    4210064. Sun has a fix for this bug but (as of 1999-06-24) has not

yet

    released it as a patch.

In hope Sun does cares to make a patch for this, as we almost all use

gcc

instead of Sun's cc...

Adrian Stovall <adrians@solarsystems.com>

check the application specific notes for solaris 2.7 on www.gnu.org.

They

have a few notes about specific patches to Solaris 2.7 breaking gcc/g++.

David Foster <foster@dim.ucsd.edu>

     First, when you build a command string for system(), be sure you

include spaces

between the arguments; you don't in your second example.

I usually have my cmd strings printed out while I am debugging.

It`s not the system() call itself that's causing the core dump, it's

what

you're putting into it.

Try doing just system("ls").

kevin@joltin.com (Kevin Sheehan {Consulting Poster Child})

a) some code to look at would help

b) have you tried truss -f?

Comments

Got something to say?

You must be logged in to post a comment.