lanl / ports-of-call

Performance Portability Utilities
https://lanl.github.io/ports-of-call/
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Remove [[noreturn]] from 'require' since it should return under most circumstances #31

Closed jhp-lanl closed 1 year ago

jhp-lanl commented 1 year ago

PR Summary

The require() function should usually not return since we would hope the condition is false. The [[noreturn]] decorator applied to a returning function is undefined behavior. With gcc 10, it looks like the compiler uses [[noreturn]] to just give up on keeping track of the stack pointer which leads to a segfault.

PR Checklist

Yurlungur commented 1 year ago

Thanks for fixing this @jhp-lanl . If we're making this change we may also wish to remove [[noreturn]] from abort and remove the while (true) {} loop in there, which is supposed to make the compiler not complain about [[noreturn]] but doesn't seem to work. But that can be for a future issue.

jhp-lanl commented 1 year ago

Thanks for fixing this @jhp-lanl . If we're making this change we may also wish to remove [[noreturn]] from abort and remove the while (true) {} loop in there, which is supposed to make the compiler not complain about [[noreturn]] but doesn't seem to work. But that can be for a future issue.

I'm less concerned about this since I've seen infinite loops used for asynchronous error handling in other places. Basically the loop can exist to give all processes something to do until the one that does all the aborting can actually abort.