RustPython / RustPython/RustPython

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

Open
#7,941 3 comments 0 reactions 1 assignee View on GitHub

@JamesClarke7283 is already working on this.

Since May 27, 2026.

C-bug
Dominant language
Rust
Stars
22.4k
Forks
1.5k
Avg merge
16h 33m
Merged PRs (30d)
165

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.