Mailing List Archive

[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output
New submission from STINNER Victor <vstinner@python.org>:

The AMD64 Arch Linux Asan 3.x buildbot worker started to fail at build 262:
https://buildbot.python.org/all/#/builders/582/builds/262
-----------
...
0:39:09 load avg: 1.15 running: test_multiprocessing_forkserver (30.0 sec)
0:39:39 load avg: 1.64 running: test_multiprocessing_forkserver (1 min)
0:39:53 load avg: 1.50 [419/420] test_multiprocessing_forkserver passed (1 min 12 sec)
0:39:53 load avg: 1.50 [420/420] test_dynamicclassattribute passed

command timed out: 1200 seconds without output running (...)
process killed by signal 9
program finished with exit code -1
elapsedTime=3595.378040
-----------

----------
components: Tests
messages: 385373
nosy: vstinner
priority: normal
severity: normal
status: open
title: AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output
versions: Python 3.10

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
Change by STINNER Victor <vstinner@python.org>:


----------
nosy: +pablogsal

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

It seems like something changed on the buildbot, not in Python, since it also fails on 3.8 and 3.9.

AMD64 Arch Linux Asan 3.9:
https://buildbot.python.org/all/#builders/579/builds/105

AMD64 Arch Linux Asan 3.8:
https://buildbot.python.org/all/#builders/580/builds/86

IMO we should disable ASAN (handling of signals) at runtime when we trigger a crash on purpose (ex: faulthandler._sigsegv()).

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

About SIGSEGV logs, one option is to use ASAN_OPTIONS="handle_segv=0".

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

Documentation of ASAN_OPTIONS:
https://github.com/google/sanitizers/wiki/SanitizerCommonFlags
https://github.com/google/sanitizers/wiki/AddressSanitizerFlags

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
Senthil Kumaran <senthil@uthcode.com> added the comment:

> IMO we should disable ASAN (handling of signals) at runtime when we trigger a crash on purpose (ex: faulthandler._sigsegv()).

> ASAN_OPTIONS="handle_segv=0".

Both sound reasonable. But not sure if they will resolve this crash tough.

----------
nosy: +orsenthil

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

> Both sound reasonable. But not sure if they will resolve this crash tough.

Many tests do crash *on purpose*. Example on test_concurrent_futures.py:

def _crash(delay=None):
"""Induces a segfault."""
if delay:
time.sleep(delay)
import faulthandler
faulthandler.disable()
faulthandler._sigsegv()

Internally, faulthandler._sigsegv() disables crash reports.

There is also test.support.SuppressCrashReport context manager to disable crash reports. But I failed to find a way to disable ASAN signal handler at runtime.

It's possible to disable the ASAN signal handler at runtime using signal.signal(SIGSEGV, signal.SIG_DFT), but that should be done before Python installs its own signal handler for that, like before calling faulthandler.enable(). It would require to inject code in test_faulthandler to restore the default handler *before* calling faulthandler.enable(). Right now, test_faulthandler is skipped on the ASAN buildbots.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
Pablo Galindo Salgado <pablogsal@gmail.com> added the comment:

> About SIGSEGV logs, one option is to use ASAN_OPTIONS="handle_segv=0".

Opened https://github.com/python/buildmaster-config/pull/222

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

For faulthandler.enable(), maybe we reset SIGSEGV signal handler to the default handler if __has_feature(address_sanitizer) is true:
https://clang.llvm.org/docs/AddressSanitizer.html#conditional-compilation-with-has-feature-address-sanitizer

But we cannot do that in faulthandler._sigsegv() since this function is used to test_faulthandler to check the signal handler installed by faulthandler previously.

Maybe we should add a function to test.support which resets the signal handler and then trigger a crash.

There are multiple functions which trigger crashes on purpose:

* _testcapi.crash_no_current_thread() => Py_FatalError()
* _testcapi.return_null_without_error() => Py_FatalError()
* _testcapi.return_result_wit_error() => Py_FatalError()
* _testcapi.negative_refcount() => Py_FatalError()
* _testcapi.pymem_buffer_overflow() => Py_FatalError()
* _testcapi.set_nomemory(0) is used to trigger a _PyErr_NormalizeException crash => Py_FatalError()
* etc.

Py_FatalError() calls abort() which raises SIGABRT signal, but ASAN doesn't catch this signal.

More generally, search for support.SuppressCrashReport usage in tests.

See also faulthandler_suppress_crash_report() C function.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

Pablo added ASAN_OPTIONS=handle_segv=0 env var to his buildbot worker:
https://github.com/python/buildmaster-config/commit/3ae3e1b21a20a06628a225579174e2aa46830583

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue42985] AMD64 Arch Linux Asan 3.x fails: command timed out: 1200 seconds without output [ In reply to ]
STINNER Victor <vstinner@python.org> added the comment:

> The AMD64 Arch Linux Asan 3.x buildbot worker started to fail at build 262:
> https://buildbot.python.org/all/#/builders/582/builds/262

It no longer fails, so I close the issue:
https://buildbot.python.org/all/#/builders/582/builds/278

----------
resolution: -> fixed
stage: -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue42985>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com