Skip to content

Instantly share code, notes, and snippets.

@neunhoef
Created September 11, 2019 14:23
Show Gist options
  • Save neunhoef/37577a5def5eb25791a1aadab21d9177 to your computer and use it in GitHub Desktop.
Save neunhoef/37577a5def5eb25791a1aadab21d9177 to your computer and use it in GitHub Desktop.
Expose a problem on Alpine Linux and g++ and static linking
#include <pthread.h>
#ifdef REPAIR
void* g(void *p) {
return p;
}
void f() {
pthread_t t;
pthread_create(&t, nullptr, g, nullptr);
pthread_cancel(t);
pthread_join(t, nullptr);
}
#endif
int main(int argc, char*[]) {
#ifdef REPAIR
if (argc == -1) { f(); }
#endif
try { throw 42; } catch(int const& i) {};
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment