Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread running (os.system or popen#) #38148

Closed
johanfo mannequin opened this issue Mar 11, 2003 · 6 comments
Closed

Thread running (os.system or popen#) #38148

johanfo mannequin opened this issue Mar 11, 2003 · 6 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@johanfo
Copy link
Mannequin

johanfo mannequin commented Mar 11, 2003

BPO 701836
Nosy @mwhudson, @facundobatista

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-05-30.19:29:34.000>
created_at = <Date 2003-03-11.21:46:44.000>
labels = ['interpreter-core']
title = 'Thread running (os.system or popen#)'
updated_at = <Date 2005-05-30.19:29:34.000>
user = 'https://bugs.python.org/johanfo'

bugs.python.org fields:

activity = <Date 2005-05-30.19:29:34.000>
actor = 'facundobatista'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2003-03-11.21:46:44.000>
creator = 'johanfo'
dependencies = []
files = []
hgrepos = []
issue_num = 701836
keywords = []
message_count = 6.0
messages = ['15079', '15080', '15081', '15082', '15083', '15084']
nosy_count = 3.0
nosy_names = ['mwh', 'facundobatista', 'johanfo']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue701836'
versions = ['Python 2.2']

@johanfo
Copy link
Mannequin Author

johanfo mannequin commented Mar 11, 2003

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>)

@johanfo johanfo mannequin closed this as completed Mar 11, 2003
@johanfo johanfo mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 11, 2003
@johanfo johanfo mannequin closed this as completed Mar 11, 2003
@johanfo johanfo mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Mar 11, 2003
@mwhudson
Copy link

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?

@johanfo
Copy link
Mannequin Author

johanfo mannequin commented Mar 12, 2003

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)....

@facundobatista
Copy link
Member

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

@facundobatista
Copy link
Member

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
>>>

@facundobatista
Copy link
Member

Logged In: YES
user_id=752496

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

. Facundo

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)
Projects
None yet
Development

No branches or pull requests

2 participants