Skip to content

test_lazy_import.test_deeply_dotted_name() does crash on Alpine Linux (SIGSEGV) and FreeBSD (SIGILL) #159535

Open

Description

@vstinner

AMD64 Alpine Linux NoGIL PR: https://buildbot.python.org/#/builders/1820/builds/75

0:06:52 load avg: 5.30 mem: 391.1 MiB [486/560/2] test_lazy_import worker non-zero exit code (Exit code -11 (SIGSEGV)) -- running (1): test_imaplib (44.2 sec)
(...)
test_module_getattr_does_not_shadow_own_lazy_import (test.test_lazy_import.LazyImportTests.test_module_getattr_does_not_shadow_own_lazy_import)
Module __getattr__ should not shadow the module's own lazy imports. ... ok
test_sys_lazy_modules (test.test_lazy_import.LazyImportTests.test_sys_lazy_modules) ... ok
test_deeply_dotted_name (test.test_lazy_import.LazyImportTypeTests.test_deeply_dotted_name)
A long dotted name must not overflow the C stack. ...

Activity

  1. vstinner commented on Oct 16, 2026

    @vstinner
    MemberAuthor

    test_lazy_import does crash with SIGILL on FreeBSD.

    FreeBSD 16: https://buildbot.python.org/#/builders/1859/builds/10

    0:08:25 load avg: 8.55 mem: 759.4 MiB [471/560/1] test_lazy_import worker non-zero exit code (Exit code -4 (SIGILL)) -- running (5): test.test_multiprocessing_spawn.test_misc (32.1 sec), test_subprocess (54.7 sec), test.test_multiprocessing_spawn.test_processes (1 min 44 sec), test.test_multiprocessing_forkserver.test_processes (35.5 sec), test_tokenize (1 min 21 sec)
    (...)
    test_sys_lazy_modules (test.test_lazy_import.LazyImportTests.test_sys_lazy_modules) ... ok
    test_deeply_dotted_name (test.test_lazy_import.LazyImportTypeTests.test_deeply_dotted_name)
    A long dotted name must not overflow the C stack. ...
    
  2. vstinner commented on Oct 16, 2026

    @vstinner
    MemberAuthor

    On FreeBSD, pid 5192 comm python tid 101381 stack overflow is logged when I run the test manually:

    $ ./python -m test test_lazy_import -v -m test_deeply_dotted_name
    == CPython 3.16.0a1+dev (heads/main:c7a17162964, Oct 16 2026, 16:10:54) [Clang 21.1.8 (https://github.com/llvm/llvm-project.git llvmorg-21.1.8-0-g2078da
    == FreeBSD-16.0-CURRENT-amd64-64bit-ELF little-endian
    == Python build: debug
    (...)
    test_deeply_dotted_name (test.test_lazy_import.LazyImportTypeTests.test_deeply_dotted_name)
    A long dotted name must not overflow the C stack. ... 
    
    pid 5192 comm python tid 101381 stack overflow
    pid 5192 comm python tid 101381 stack overflow
    pid 5192 comm python has trashed its stack, killing
    
    Illegal instruction        (core dumped)./python -m test test_lazy_import -v -m test_deeply_dotted_name
    
  3. vstinner commented on Oct 16, 2026

    @vstinner
    MemberAuthor

    #159376 should fix the crash in the main branch.

  4. vstinner commented on Oct 16, 2026

    @vstinner
    MemberAuthor

    The test was added by #159289.

  5. changed the title [-]test_lazy_import: test_deeply_dotted_name() does crash (SIGSEGV) on Alpine Linux[/-] [+]`test_lazy_import.test_deeply_dotted_name()` does crash on Alpine Linux (SIGSEGV) and FreeBSD (SIGILL)[/+] on Oct 16, 2026
  6. vstinner commented on Oct 17, 2026

    @vstinner
    MemberAuthor

    #159376 should fix the crash in the main branch.

    Ah. It may fix the issue on Alpine, but not on FreeBSD: FreeBSD doesn't have pthread_getattr_np() function.

  7. vstinner commented on Oct 17, 2026

    @vstinner
    MemberAuthor

    I wrote #159604 to fix test_lazy_import.test_deeply_dotted_name() on FreeBSD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-lazy-importstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions