Skip to content

test_external_inspection.TestGetStackTrace.test_self_trace fails when building with --enable-shared #125402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
colesbury opened this issue Oct 13, 2024 · 3 comments
Labels
tests Tests in the Lib/test dir

Comments

@colesbury
Copy link
Contributor

When Python is built with --enable-shared, TestGetStackTrace.test_self_trace hangs or fails.

OS: Ubuntu 22.04.2 LTS on x86-64

test_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace) ... /raid/sgross/cpython/python: error while loading shared libraries: libpython3.14d.so.1.0: cannot open shared object file: No such file or directory

Also seen:

test_self_trace (test.test_external_inspection.TestGetStackTrace.test_self_trace) ... ERROR

======================================================================
ERROR: test_self_trace (test.test_external_inspection.TestGetStackTrace.test_self_trace)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/raid/sgross/cpython/Lib/test/test_external_inspection.py", line 80, in test_self_trace
    stack_trace = get_stack_trace(os.getpid())
RuntimeError: No interpreter state found

----------------------------------------------------------------------
Ran 2 tests in 0.169s
@colesbury colesbury added the tests Tests in the Lib/test dir label Oct 13, 2024
@Zheaoli
Copy link
Contributor

Zheaoli commented Oct 14, 2024

Weird, I can not reproduce it in my environment

╰─ ./python -m unittest -v test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace
test_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace) ... abc
ok

----------------------------------------------------------------------
Ran 1 test in 0.097s

OK

╭─   manjusaka@manjusaka-garuda   ~/Documents/projects/cpython   3.13-dev                                                                                                                                                 main ⇣1 *4 !1 ?16   01:48:19  
╰─ uname -a 
Linux manjusaka-garuda 6.11.3-manjusakav4-xanmod1-1-manjusaka #1 SMP PREEMPT_DYNAMIC Fri, 11 Oct 2024 12:02:09 +0000 x86_64 GNU/Linux

@colesbury
Copy link
Contributor Author

This is the command that failed for me: ./python -m test test_external_inspection

@pablogsal
Copy link
Member

I cannot reproduce this anymore in an Ubuntu 22.04 container:

root@ae7c340c1327:/src# uname -a
Linux ae7c340c1327 6.12.10-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 18 Jan 2025 02:26:57 +0000 x86_64 x86_64 x86_64 GNU/Linux
root@ae7c340c1327:/src# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"
root@ae7c340c1327:/src# LD_LIBRARY_PATH=$PWD ./python -m sysconfig | grep shared
	BLDSHARED = "gcc -shared"
	CONFIG_ARGS = "'--with-pydebug' '--enable-shared'"
	LDCXXSHARED = "g++ -shared"
	LDSHARED = "gcc -shared"
root@ae7c340c1327:/src# LD_LIBRARY_PATH=$PWD ./python -m test test_external_inspection -v
== CPython 3.14.0a4+ (main, Jan 30 2025, 21:16:58) [GCC 11.4.0]
== Linux-6.12.10-arch1-1-x86_64-with-glibc2.35 little-endian
== Python build: debug shared
== cwd: /src/build/test_python_worker_14964æ
== CPU count: 36
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests

Using random seed: 1438977930
0:00:00 load avg: 1.84 Run 1 test sequentially in a single process
0:00:00 load avg: 1.84 [1/1] test_external_inspection
test_async_gather_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_gather_remote_stack_trace) ... ok
test_async_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_remote_stack_trace) ... ok
test_async_staggered_race_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_async_staggered_race_remote_stack_trace) ... ok
test_asyncgen_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_asyncgen_remote_stack_trace) ... ok
test_remote_stack_trace (test.test_external_inspection.TestGetStackTrace.test_remote_stack_trace) ... ok
test_self_trace (test.test_external_inspection.TestGetStackTrace.test_self_trace) ... ok

----------------------------------------------------------------------
Ran 6 tests in 0.631s

OK

== Tests result: SUCCESS ==

1 test OK.

Total duration: 697 ms
Total tests: run=6
Total test files: run=1/1
Result: SUCCESS

So I am closing this for now. Please reopen if we missed anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

No branches or pull requests

3 participants