Skip to content

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

@im-0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions