Skip to content

Conversation

@Guiliano99
Copy link
Contributor

Add optional faulthandler import via environment flag for debugging

Description

  • Adds environment flag PYOQS_ENABLE_FAULTHANDLER to control the optional import of the Python faulthandler module.
  • Prevents import errors during Robot Framework (RF) test execution when faulthandler is unavailable or unsupported.
  • Retains improved debugging capabilities for segmentation faults when the flag is enabled.

Motivation and Context

While running RF tests with the cmp-test-suite using liboqs-python, an import error occurred for the faulthandler module.
This module was originally added to improve debugging for segmentation faults caused by missing build-time flags ( when PQC stateful hash signature key generation support was not enabled in liboqs).

To maintain this helpful debugging functionality without breaking test environments, an environment variable PYOQS_ENABLE_FAULTHANDLER was introduced.
When set, it enables faulthandler explicitly; otherwise, the module is skipped gracefully.

- run: ruff format

Signed-off-by: Guiliano99 <guilianolehmann@live.de>
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

Successfully merging this pull request may close these issues.

1 participant