pthreads, fork & exec vs. system(), solaris, others (fwd)

Steven W. Orr steveo at syslang.net
Mon Jan 17 22:08:01 EST 2005


A friend wrote me with a problem. The basic gist is that it works under 
Solaris but fails under AIX. Description below. Any takers?

Steve,

I've got a pernicious problem & wonder if you can shed light on it.
   Solaris *seems* cured ..
   AIX now crashes ..
This is a C/C++ ETL tool.

Symptom:  nulled-out pointers, usually following
     fork & exec
or
      system()

Large thread stack size (8 mb) may help.
Default is 65k.

IN SHORT:

What are the portable, pthread-safe
     coding choice
     compile & link options
for
     running executables with and without stdout/stderr redirect
     in several concurrent pthreads
     e.g. either:
           system()
           fork() & execle()
     and what compile / load options are appropriate for Forte compiler?

IN LONG:

Big ETL loads crashed Solaris (ok on AIX, HP-UX)

Purify on Solaris
found no problems in 2 runs.

But - then - it hung on
       vfork()
at the source line for
      system(commandstring);

So I converted all
      system()
to
       fork1() & execle()
and then failures on AIX began - occasionally.

Typical system() commands are:
     mv fileA fileB
     compress fileB
     cat fileA fileB fileC fileD > fileE
     grep <some string> inputfile
     sort -k n,m  -o outfile infile

ODBC libraries are used to talk to Oracle,
from DataDirect/Merant.

Compile/link options are:
Solaris:  -D_REENTRANT  -lpthread -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

AIX: -lpthread -qthreaded

Ideas:  convert fork() & execle() to
            system()
            on AIX

            Devote 1 thread to fork & exec

            Find purify-like compile + run options for AIX.

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net



More information about the gnhlug-discuss mailing list