This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Thread running (os.system or popen#)
Type: Stage:
Components: Interpreter Core Versions: Python 2.2
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: facundobatista, johanfo, mwh
Priority: normal Keywords:

Created on 2003-03-11 21:46 by johanfo, last changed 2022-04-10 16:07 by admin. This issue is now closed.

Messages (6)
msg15079 - (view) Author: Johan Fredrik Öhman (johanfo) Date: 2003-03-11 21:46
Bottom line: Some programs may lock up when 
spawned from a thread.


>>> import thread, os
>>> thread.start_new_thread(os.system,
("/usr/sbin/ntpdate ifi.uio.no",))

This starts a program "ntpdate" from a Python thread.  
Usually this is no problem. Ntpdate, is a simple program 
to adjust the clock of the system. However, when 
ntpdate is started from a thread it locks up and newer 
exits!!   With my limited debugging knowledge, it sems 
as it hangs in a "poll()" kernel call, however, this could 
be misleading. (I used stacktrace -p <pid>)

msg15080 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2003-03-12 12:40
Logged In: YES 
user_id=6656

IIRC, threads other than the main thread get a signal mask
that blocks everything.  That could be the problem, but I
don't know what to do about it...

What platform are you on?  Linux?
msg15081 - (view) Author: Johan Fredrik Öhman (johanfo) Date: 2003-03-12 16:12
Logged In: YES 
user_id=556425

I have verified this bug on both Redhat 8.0 and SuSE 8.1, 
linux yes.

Signal is one possible path, filedescriptors another.  I read 
somwhere that there was some issues with pthreads forking 
and filedescriptors.  However, this is not my area (too low 
level)....
msg15082 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-01-15 20:34
Logged In: YES 
user_id=752496

Please, could you verify if this problem persists in Python 2.3.4
or 2.4?

If yes, in which version? Can you provide a test case?

If the problem is solved, from which version?

Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".

Thank you! 

.    Facundo
msg15083 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-01-15 20:34
Logged In: YES 
user_id=752496

Works ok for me:

Python 2.3.4 (#1, Oct 26 2004, 16:42:40)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import thread, os
>>> thread.start_new_thread(os.system,("/usr/sbin/ntpdate
ifi.uio.no",))
-1210684496
>>>
msg15084 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2005-05-30 19:29
Logged In: YES 
user_id=752496

Deprecated. Reopen only if still happens in 2.3 or newer. 

.    Facundo
History
Date User Action Args
2022-04-10 16:07:34adminsetgithub: 38148
2003-03-11 21:46:44johanfocreate