Skip to content
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

Do not allow access to return value of tasks that ended in exceptions. #15542

Merged
merged 3 commits into from Jul 3, 2023

Conversation

bangerth
Copy link
Member

Fixes #15495.

include/deal.II/base/thread_management.h Outdated Show resolved Hide resolved
@bangerth
Copy link
Member Author

Fixed as requested.

@tamiko tamiko added this to the Developer workshop 2023 milestone Jul 1, 2023
@tamiko
Copy link
Member

tamiko commented Jul 1, 2023

This triggers in a number of tests:

base/generate_normal_random_number_01.debug: RUN failed. ------ Partial output:
base/generate_normal_random_number_01.debug: RUN failed. ------ Additional output on stdout/stderr:
--------------------------------------------------------
An error occurred in line <235> of file </jenkins/workspace/dealii-serial_PR-15542/include/deal.II/base/thread_management.h> in function
    RT& dealii::Threads::internal::return_value<RT>::get() [with RT = std::pair<double, double>; dealii::Threads::internal::return_value<RT>::reference_type = std::pair<double, double>&]
The violated condition was: 
    value_is_initialized
Additional information: 
    You cannot read the return value of a thread or task if that value has
    not been set. This happens, for example, if a task or thread threw an
    exception.
--------------------------------------------------------
The following tests FAILED:
	244 - base/generate_normal_random_number_01.debug (Failed)
	3218 - multithreading/thread_local_storage_03.debug (Failed)
	3219 - multithreading/thread_local_storage_04.debug (Failed)
	3233 - multithreading/thread_validity_10.debug (Failed)
	3236 - multithreading/thread_validity_13.debug (Failed)
Errors while running CTest

@bangerth
Copy link
Member Author

bangerth commented Jul 1, 2023

Let me reconsider this once #15555 is merged. I believe that some of the failing tests will go away there because the class that triggers the issue is going to go away.

@tamiko tamiko marked this pull request as draft July 1, 2023 16:59
@bangerth bangerth marked this pull request as ready for review July 2, 2023 02:39
@bangerth
Copy link
Member Author

bangerth commented Jul 2, 2023

Seems to work now!

@tamiko tamiko merged commit 9d97575 into dealii:master Jul 3, 2023
14 checks passed
@bangerth bangerth deleted the tasks branch July 3, 2023 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Threads::Task::return_value() should not be allowed when a task ends with an exception.
3 participants