-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around bitwuzla/bitwuzla#96 on Ubuntu 20.04
Sadly, Ubuntu 20.04's version of `glibc` is susceptible to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909. We work around the issue by applying a workaround taken from https://bbs.archlinux.org/viewtopic.php?pid=2022393#p2022393.
- Loading branch information
1 parent
38ac8f1
commit 3193856
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/src/main/time_limit.cpp b/src/main/time_limit.cpp | ||
index 45238be4..f1ee25cb 100644 | ||
--- a/src/main/time_limit.cpp | ||
+++ b/src/main/time_limit.cpp | ||
@@ -6,6 +6,7 @@ | ||
#include <cstdlib> | ||
#include <iostream> | ||
#include <thread> | ||
+#include <pthread.h> | ||
|
||
namespace bzla::main { | ||
|
||
@@ -15,6 +16,18 @@ std::condition_variable cv; | ||
std::mutex cv_m; | ||
bool time_limit_set = false; | ||
|
||
+// Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58909 | ||
+// on old versions of glibc | ||
+void pthread_cond_bug() { | ||
+ pthread_cond_signal((pthread_cond_t *) nullptr); | ||
+ pthread_cond_init((pthread_cond_t *) nullptr, | ||
+ (const pthread_condattr_t *) nullptr); | ||
+ pthread_cond_destroy((pthread_cond_t *) nullptr); | ||
+ pthread_cond_timedwait((pthread_cond_t *) nullptr, (pthread_mutex_t *) | ||
+ nullptr, (const struct timespec *) nullptr); | ||
+ pthread_cond_wait((pthread_cond_t *) nullptr, (pthread_mutex_t *) nullptr); | ||
+} | ||
+ | ||
void | ||
timeout_reached() | ||
{ |