fuhsnn / slimcc

C11 compiler with GNU extensions for x86-64 Linux, working towards C23
MIT License
58 stars 10 forks source link

Pass `Python v3.13.0` test `test_external_inspection` #105

Closed fuhsnn closed 3 hours ago

fuhsnn commented 1 week ago
test_python() {
 github_tar python cpython v3.13.0
 replace_line "#if defined(__GNUC__) || defined(__clang__)" "#if 1" Include/pyport.h
 ./configure && make -j4
 ./python -m test test_external_inspection
}
0:00:00 load avg: 1.73 [1/1] test_external_inspection
test_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace) ... ERROR
test_self_trace (test.test_external_inspection.TestGetStackTrace.test_self_trace) ... ERROR

======================================================================
ERROR: test_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/non-root/cpython/Lib/test/test_external_inspection.py", line 59, in test_remote_stack_trace
    stack_trace = get_stack_trace(p.pid)
RuntimeError: Failed to get .PyRuntime address

======================================================================
ERROR: test_self_trace (test.test_external_inspection.TestGetStackTrace.test_self_trace)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/non-root/cpython/Lib/test/test_external_inspection.py", line 80, in test_self_trace
    stack_trace = get_stack_trace(os.getpid())
RuntimeError: Failed to get .PyRuntime address

----------------------------------------------------------------------
Ran 2 tests in 0.082s

FAILED (errors=2)
test test_external_inspection failed
test_external_inspection failed (2 errors)

== Tests result: FAILURE ==

1 test failed:
    test_external_inspection
fuhsnn commented 1 day ago

Probably this Python/pylifecycle.c:103:__attribute__ ((section (".PyRuntime")))

fuhsnn commented 3 hours ago

https://github.com/fuhsnn/slimcc/commit/9d10c9e986e5dbb444be54d73bbc8d4987b772a7