-
Notifications
You must be signed in to change notification settings - Fork 28
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
Setting process group consumes I/O from debugger. #9
Comments
I cannot produce the problem on Ubuntu but I suspect it's a lingering socket issue - this happens only after a restart right? |
I do set SO_REUSEADDR in https://github.com/ionelmc/python-remote-pdb/blob/master/src/remote_pdb.py#L69 - perhaps you could patch it up locally to additionally set SO_REUSEPORT and report results? I don't have an OSX system to play with. |
Thanks for the quick responses. The only pure Linux system I've got handy is a Raspberry Pi running Raspbian Jessie. I'll try it out on that to see if the problem occurs there and let you know the result. Then I'll try patching in SO_REUSEPORT and running it on OS X. More later ... |
I've confirmed the problem is not occurring in Linux. |
I added
at line 70. No effect on the problem (on OS X). Just to clarify, the connection has always succeeded. I see
with or without SO_REUSEPORT. The problem is that I don't get a Pdb prompt and nothing I type produces a response. |
I've been able to confirm the following on OS X
|
One way to figure this one out: install hunter and just add |
I'll definitely give that a try! I was looking earlier today for a tracing program to help a fellow engineer explore some unfamiliar Python code. This looks perfect. I think I'll need to trace into Pdb itself since that's where things seem to be going wrong. |
Pdb seems to be going down the rabbit hole trying to import readline.
More later. Have to eat dinner now. Hunter seems downright awesome! |
It's hanging during the import readline. I tried setting hunter to trace readline but that's a .so, so of course no luck ... |
Solved! It's an old OS X python issue that has either crept back in or was never fixed in Pdb. The fix is to set up to ignore SIGTTOU before importing readline. See http://bugs.python.org/issue14892 for details. I cured the problem by patching my local copy of pdb.Pdb as shown below.
Thanks much for your generous help and for hunter. Cheers, |
Nice find! I'll add this to the readme at the very least. |
First, thanks for writing remote_pdb! It works very well to set breaks in child processes in normal circumstances.
There seems to be a communication problem when the main python program is under control of a program such as entr or when the main program is launched from ipython and sets it's own process group.
Could you please take a look at the question I posted a couple of days ago on SO? It's rather long so I won't repost the contents here.
http://stackoverflow.com/questions/43823564/python-3-debug-child-process-running-under-control-of-entr
Thanks,
Mike Ellis
The text was updated successfully, but these errors were encountered: