SUMMARY: system() cause core dump

From: Feng Qiu (
Date: Mon Oct 18 1999 - 16:19:28 CDT

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!


> Hello, all,
> I have Ultra2 with solaris7. gcc 2.8.1 is installed.
> Every time I use system() function in my program, executable will
> core dump.
> Is there someone know what cause this problem?
> Thanks!

bad arguments to system().

David Robillard <David.Robillard@Matrox.COM>
Could that be it;

    Sun patch 107058-01 (1999-01-13) for SPARC Solaris 7 triggers a bug
    the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8
    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
    released it as a patch.

In hope Sun does cares to make a patch for this, as we almost all use
instead of Sun's cc...

Adrian Stovall <>
check the application specific notes for solaris 2.7 on
have a few notes about specific patches to Solaris 2.7 breaking gcc/g++.

David Foster <>
     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
you're putting into it.

Try doing just system("ls"). (Kevin Sheehan {Consulting Poster Child})

a) some code to look at would help
b) have you tried truss -f?

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:29 CDT