Bug 109664 - Deadlocks with gomp_fatal called from libgomp/plugins/
Summary: Deadlocks with gomp_fatal called from libgomp/plugins/
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: libgomp (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: openacc, openmp
Depends on:
Blocks:
 
Reported: 2023-04-28 10:06 UTC by Tobias Burnus
Modified: 2024-12-04 09:53 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-12-04 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2023-04-28 10:06:02 UTC
See thread starting at:
https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603616.html


Issue:

Fatal errors inside mutex-locked regions (i.e. basically anything in the plugin) will cause it to hang up trying to take the lock to clean everything up.


Possible solutions:

would be not use gomp_fatal from within the
plugins, but use gomp_error instead and through possibly adjusted plugin
APIs tell libgomp that there was a fatal error and let libgomp unlock
anything that needs unlocking and exit (EXIT_FAILURE); afterwards.


another possibility would be not use gomp_fatal from within the
plugins, but use gomp_error instead and through possibly adjusted plugin
APIs tell libgomp that there was a fatal error and let libgomp unlock
anything that needs unlocking and exit (EXIT_FAILURE); afterwards.
Comment 1 Tobias Burnus 2023-04-28 10:45:54 UTC
Once done, we might want to change some error propagation from a chain of boolean-returning functions to just GOMP_PLUGIN_fatal – or not.

Cf. for instance: https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616992.html
Comment 2 Thomas Schwinge 2024-12-04 09:53:47 UTC
Wild idea: switch libgomp to C++, and use 'throw' and other C++ idioms for proper error propagation and unlocking as part of that?