Opened 12 years ago

Closed 12 years ago

#164 closed defect (wontfix)

execv() doesn't stop the original program

Reported by: guest Owned by: bird
Priority: normal Milestone:
Component: libc Version: 0.6.2
Severity: major Keywords:
Cc: mozilla@…

Description

Programs compiled with GCC 3.3.5 (and linked against libc061 or libc062) fail to stop the original process when execv() (or _execv()) is used. Compiling and running the attached testcase using

gcc -Zomf exec_test.c

works fine with GCC 3.2.2 (libc 0.5.1) in that always only one process of the name exec_test is running. Compiled with GCC 3.3.5 the process list grows with every call of execv() until about 150 processes are reached at which point some memory area runs out of space here and the process crashes (and all others with it).

This problem basically keeps me from producing a high-memory enabled version of Firefox and Thunderbird.

Attachments (1)

exec_test.c (150 bytes) - added by guest 12 years ago.

Download all attachments as: .zip

Change History (2)

Changed 12 years ago by guest

comment:1 Changed 12 years ago by bird

  • Resolution set to wontfix
  • Status changed from new to closed

This is an known issue and not planned to be fixed for 0.6.x.

The exec* implementation in kLIBC doesn't quit the in-between process as I assume anyone using exec did a fork() first. The rational is that the kLIBC exec doesn't replace the process like on unix but spawns a child process with a new pid. So, if the parent then tries to use waitpid/id, kill or similar API taking a pid as argument on the forked child it won't be there any more and it'll get confused. kLIBC could perhaps do mapping of the pid internally, but then what if it's reused.

In short, do not use exec unless you fork. Use spawn.

Note: See TracTickets for help on using tickets.