]> https://gitweb.dealii.org/ - dealii.git/commit
lac/constraints_move: Fix undefined behavior 10519/head
authorMatthias Maier <tamiko@43-1.org>
Fri, 12 Jun 2020 05:50:50 +0000 (00:50 -0500)
committerMatthias Maier <tamiko@43-1.org>
Fri, 12 Jun 2020 05:54:54 +0000 (00:54 -0500)
commit49f1fde635ebbe03cb6d67da23a3f45a1aa87372
treea03b56f0d4535b932ee7b7b502f77a78e16f9795
parentaadc07fbaf3fd4f1564178b65998fa108fe65695
lac/constraints_move: Fix undefined behavior

It is undefined behavior to access an object that has been moved. It is
also not possible to "move back" an object.

In this particular case with the recent changes to ThreadLocalStorage
and AffineConstraints we run into an exception:

constraints_move.debug: ../nptl/pthread_mutex_lock.c:117: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.

(The move operation destroys the mutex and accessing it afterwards
when we try to move back results in a crash.)
tests/lac/constraints_move.cc
tests/lac/constraints_move.output

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.