strange problem with os.system() call

Wen Jiang wj691781 at bcm.tmc.edu
Tue Aug 14 12:48:14 EDT 2001


hi,
I am having a really strange problem with os.system() call on a RedHat
6.2 system.

Here is the problem:

a simplge c program

main(int argc, char** argv){
	system("./mmy_rec");
}

this will work fine, "my_rec" runs.


but if I run it in python:

#!/usr/bin/env python	
import os
os.system("./testc")

this would immdediately core dumped at the point in the c program
system() call.

the debugging information says it crashed at the entry point for
"my_rec" main() function.

to make this problem more strange:

1. if I change the program "my_rec" to other programs, no problem at
all. I tried to compile "my_rec" with different compilers (gcc, g++,
pgcc), all crashed.

2. if I run the exact same thing on a Mandrake 8 system, no proble at
all.

3. if I use Perl, no problem ( I think this also uses the c system()
call)
open(CMD,"| my_rec")

4. I tried the Python 1.5.2 came with RedHat 6.2, and my own Python 2.1
compiled from the src package, both crashed.


I have tried to find out what execatly is going for this strange
problem, could any one give me some clue what the problem is?

Thanks,

Wen



More information about the Python-list mailing list