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.

signal.ItimerError: [Errno 22] Invalid argument

See original GitHub issue

After installing scalene from pip, version 0.8.2, I get the following error:

(base) alberto@serenity:~$ python -m scalene scalene/test/testme.py
Scalene: An exception of type ItimerError occurred. Arguments:
(22, 'Invalid argument')
Traceback (most recent call last):
  File "/home/alberto/miniconda3/lib/python3.7/site-packages/scalene/scalene.py", line 712, in main
    profiler.start()
  File "/home/alberto/miniconda3/lib/python3.7/site-packages/scalene/scalene.py", line 488, in start
    Scalene.enable_signals()
  File "/home/alberto/miniconda3/lib/python3.7/site-packages/scalene/scalene.py", line 196, in enable_signals
    signal.setitimer(Scalene.cpu_timer_signal, Scalene.mean_signal_interval, Scalene.mean_signal_interval)
signal.ItimerError: [Errno 22] Invalid argument

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/alberto/miniconda3/lib/python3.7/site-packages/scalene/scalene.py", line 656, in exit_handler
    Scalene.disable_signals()
  File "/home/alberto/miniconda3/lib/python3.7/site-packages/scalene/scalene.py", line 648, in disable_signals
    signal.setitimer(Scalene.cpu_timer_signal, 0)
signal.ItimerError: [Errno 22] Invalid argument

I’m running Python 3.7.4 in Ubuntu 16.04.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
albertotbcommented, Apr 2, 2020

Ok, after installing Ubuntu 18.02 on WSL2, I can confirm that scalene runs just fine. Thanks!

1reaction
emerybergercommented, Apr 1, 2020

Interesting. I just verified that it works fine on Ubuntu 19.10, Python 3.7.5. It seems to be complaining that a particular signal (signal.ITIMER_VIRTUAL) doesn’t exist, which is pretty surprising.

Can you try invoking it with --wallclock? As in:

python3 -m scalene --wallclock scalene/test/testme.py

Also, please do a man setitimer and paste that in. Seems hard to believe that signal.ITIMER_VIRTUAL is not supported.

thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

OSError when setting SIGKILL handler in mac os and python
From the man 7 signal , it says. The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored. And also please refer...
Read more >
ianitor OSError: [Errno 22] Invalid argument · Issue #2 - GitHub
This is caused by SIGSTOP signal raising OSError exception when trying to bind it on python3.4. Unfortunately ianitor.script module was not ...
Read more >
signal.ITIMER_REAL Example - Program Talk
ITIMER_REAL, 0) return content except: signal.setitimer(signal. ... ItimerError("[Errno 22] Invalid argument") if interval < 0: raise signal.
Read more >
signal — Set handlers for asynchronous events ... - Python Docs
Raised to signal an error from the underlying setitimer() or getitimer() implementation. Expect this error if an invalid interval timer or a negative...
Read more >
17.4. signal — Set handlers for asynchronous events
Expect this error if an invalid interval timer or a negative time is passed to setitimer(). This error is a subtype of IOError....
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