← 输入框|github.com|刷新
Skip to content

Some python tests are crashing with segmentation fault when running on debug build #7941

Open

Description

@im-0

Summary

$ cargo run -- -m test.test_ssl ThreadedTests.test_socketserver
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/rustpython -m test.test_ssl ThreadedTests.test_socketserver`
test_ssl: testing with 'OpenSSL 3.3.0 (rustls/0.23)' (3, 3, 0, 0, 15)
          under 'Linux-6.19.14-400.asahi.fc44.aarch64+16k-aarch64-with-glibc2.43'
          HAS_SNI = True
          OP_ALL = 0x     bfb
          OP_NO_TLSv1_1 = 0x10000000

 server (('127.0.0.1', 34577):34577 ('TLS_AES_256_GCM_SHA384', 'TLSv1.3', 256)):
   [20/May/2026 23:23:31] "GET /test_ssl.py HTTP/1.1" 200 -
Segmentation fault         (core dumped) RUST_BACKTRACE=1 cargo run -- -m test.test_ssl ThreadedTests.test_socketserver

Following patch circumvents this, so I believe it is a stack overflow really:

diff --git a/Lib/test/ssl_servers.py b/Lib/test/ssl_servers.py
index 15b071e04dda..8d9331c6705f 100644
--- a/Lib/test/ssl_servers.py
+++ b/Lib/test/ssl_servers.py
@@ -125,6 +125,7 @@ def __init__(self, context, host=HOST, handler_class=None):
                                   handler_class or RootedHTTPRequestHandler,
                                   context)
         self.port = self.server.server_port
+        threading.stack_size(1024 * 1024 * 128)
         threading.Thread.__init__(self)
         self.daemon = True

Expected

No segmentation fault.

Actual

Segmentation fault.

Python Documentation

N/A

Activity

  1. fanninpm commented on May 20, 2026

    @fanninpm
    Contributor

    Do you believe this to be a bug in CPython?

  2. im-0 commented on May 20, 2026

    @im-0
    ContributorAuthor

    No, it is a RustPython bug. Patch for the test case is just to demonstrate that it is a stack overflow.

  3. JamesClarke7283 commented on May 27, 2026

    @JamesClarke7283
    Contributor

    take

  4. added 3 commits that reference this issue on Sep 16, 2026
    ea04e96
    42f519f
    a5e5bc6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

C-bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions