-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
bugSomething isn't workingSomething isn't working
Description
It seems that proxy-fmu spawns one or more worker threads to perform some of its operations, and exceptions that are thrown within these threads are not handled properly.
I'm not familiar enough with the proxy-fmu API to provide a minimal test case. I discovered this when running the cosim CLI. Here is one way to reproduce it:
- Make sure that cosim CLI is available and compiled with proxy-fmu support.
- Delete/rename/move the proxyfmu executable so that the program can't find it.
- Run
cosim run path/to/OspSystemStructure.xml, where the system structure file is one that uses proxyfmu (for example this one).
Observe the following output (on Linux):
terminate called after throwing an instance of 'std::runtime_error'
what(): [proxyfmu] No proxyfmu executable found. [path redacted]/bin/proxyfmu does not exist!
Aborted (core dumped) cosim run OspSystemStructure.xm
Using GDB, I've observed that the exception originates in a worker thread and is never caught before it propagates to the thread entry point and causes the C++ runtime to call std::terminate().
Instead, there should be some mechanism to capture the exception, pass it to the main thread, and rethrow it there, enabling the whole program to exit gracefully.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working