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
Program terminates during error handling #2959
Comments
What would you expect to happen if an exception is thrown that is not handled? |
Even if I handle the exception in main, the issue persists since the exception handler is never reached during unwinding. At least the debugger never stops at the break point I have placed within the handler. If I continue the execution after the exception has been thrown the debugger only stops within the destructor of Moreover, the error message is not the same as the one provided by the original exception. Since no other exceptions are thrown during the unwinding, I would except that the program displays the original error message even if I would not handle the exception. I have also recompiled both HPX and the example in a fresh Docker container to avoid issues with the ABI and get the same results. |
Could you please give us a small self-contained test that exposes the issue you're reporting on? The code in the original description does not expose any problems. |
That's weird. I can reproduce the issue with the provided code on my system every time. I use the following CMakeLists.txt to compile the code: cmake_minimum_required(VERSION 3.9)
project(thread_pool_executor_test)
find_package(HPX 1.1.0 REQUIRED)
set(SOURCE_FILES main.cpp)
add_executable(thread_pool_executor_test ${SOURCE_FILES})
hpx_setup_target(thread_pool_executor_test) Which compiler have you used to test the code? Maybe the issue is exposed by a specific combination of compiler, flags and libraries. I will investigate, try to come up with a reduced test case and report back ASAP. |
What I meant is not that I don't see the exception, what I meant is that the code above behaves as it should (if we abstract ourselves from the underlying issue in the executor). The code throws an exception and the program terminates as the exception is not handled. Could you please give us some code which actually demonstrates the issue you're reporting? |
I misunderstood your comment. Sorry. The following code crashes while I would expect it to terminate normally after printing "Failure" since the exception should be caught. #include <hpx/hpx_main.hpp>
#include <hpx/include/thread_executors.hpp>
#include <iostream>
int main()
{
try
{
hpx::threads::executors::local_priority_queue_os_executor exec(1);
}
catch (...)
{
std::cerr << "Failure" << std::endl;
}
return 0;
} |
While debugging the following code snippet
I encountered what seems to be a bug in the error handling path. The program aborts with the error
during unwinding.
The emitted stack trace is:
Since the original issue does not seem to be related to this bug, I will report it separately.
The text was updated successfully, but these errors were encountered: