question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Process hang while executing logging.warning under specific circumstances

See original GitHub issue

I identified a kernel hang when calling the python logging facility under certain circumstances. The hang is specific for usage of function in jupyter, i.e. it does not happen in a ipython command shell.

The hang happens when I import a specific module form this repository: https://github.com/secdev/scapy/ (the issue can be reproduced with the version from pip as well).

from scapy.route6 import *

The hang happens in line 234 when this method is called

warning("No route found for IPv6 destination %s (no default route?)" % dst)

warning() is a wrapper that calls

logging.getLogger("scapy.runtime").logging(x)

where x is the message. I am not able to reproduce this issue in a smaller test case, i.e. I cannot find other situations where a call to logging.warning() hangs the kernel.

The reason why I open this issue with jupyter is that the jupyter notebook is the only environment where this results in a hang. The code works without issues in the standard python2.7 interpreter, and in the ipython command shell

I experience the issue on Mac OS X with the following python, and package versions

$ python --version
Python 2.7.10  

ipython and jupyter versions are:

ipykernel==4.3.1
ipython==4.2.0
ipython-genutils==0.1.0
ipywidgets==5.1.2
jupyter==1.0.0
jupyter-client==4.2.2
jupyter-console==4.1.1
jupyter-core==4.1.0

Is there any additional information that I can provide to further debug this problem?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
takluyvercommented, Jul 4, 2016

On Windows I’d guess that the issue is trying to write to a nonexistant stderr; once some buffer fills up, the next write call will block. We’ve seen this before on Windows. This issue was reported on a Mac, so I doubt it’s the same, but the cause may be similar.

1reaction
slishakcommented, Jul 4, 2016

@takluyver do you think this is the same issue, and does it help identify what’s going wrong? Thanks!

https://github.com/ipython/ipyparallel/issues/161

Read more comments on GitHub >

github_iconTop Results From Across the Web

How should I log while using multiprocessing in Python?
I just now wrote a log handler of my own that just feeds everything to the parent process via a pipe. I've only...
Read more >
8 Python Logging Pitfalls to Avoid - Papertrail
The first pitfall on our list consists of using a too basic or simplistic approach to logging. In Python, this amounts to writing...
Read more >
Logging Cookbook — Python 3.11.1 documentation
This class is designed to look like a Logger , so that you can call debug() , info() , warning() , error() ,...
Read more >
How to analyze a process crash or hang when the cause is ...
Ensure the process is started · If the crash is known to happen in a specific process: Obtain the process ID of the...
Read more >
Understand and resolve SQL Server blocking problems
For information specific to troubleshooting blocking in Azure SQL Database ... If the query isn't executed within a transaction (and no lock ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found