Skip to content

TST: numpy compiled with debug crashes in test_dict_recursion #29114

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
mattip opened this issue Jun 2, 2025 · 2 comments
Closed

TST: numpy compiled with debug crashes in test_dict_recursion #29114

mattip opened this issue Jun 2, 2025 · 2 comments

Comments

@mattip
Copy link
Member

mattip commented Jun 2, 2025

To reproduce, create a venv on python3.12 with the current requirements in build_requirements and test_requirements, then:

spin build --clean -- -Dbuildtype=debug
spin test

On ubuntu 24.04, x86_64, I get a segfault in test_dict_recursion, which is meant to fail with a RecursionError. The other similar tests for recursion properly raise the RecursionError. Setting sys.setrecursionlimit(100) (where it usually is 1000) does not cause the RecursionError to be raised. Is the recursion detection somehow different for dtype-from-dict than for dtype-from-list or dtype-from-tuple?

This is the only test that fails for me when using a debug build.

@mattip
Copy link
Member Author

mattip commented Jun 2, 2025

Probably missing a Py_EnterRecursiveCall, Py_LeaveRecursiveCall pair somewhere in the dtype-from-dict path, where the others call out to a python API that will check the stack depth without an explicit Py_EnterRecursiveCall

@mattip
Copy link
Member Author

mattip commented Jun 3, 2025

There are calls to Py_EnterRecursiveCall/Py_LeaveRecursiveCall. It seems the function _convert_from_dict is particularly stack-heavy. On my machine, the default stack size in bash is 8192. Setting it larger with ulimit -s 10240 cleared the segfault. If others see this too, maybe it is worth documenting in spin build --help? Closing for now.

@mattip mattip closed this as completed Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy