Skip to content

Commit d8706b6

Browse files
committed
Catch problems with abandon and don't lock up
1 parent d90a495 commit d8706b6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/llvmo/runtimeJit.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,13 @@ class ClaspAllocator : public JITLinkMemoryManager {
226226
}
227227
virtual void abandon(OnAbandonedFunction OnAbandoned) {
228228
printf("%s:%d:%s I have no idea what to do here - calling OnAbandoned and continuing\n", __FILE__, __LINE__, __FUNCTION__);
229-
OnAbandoned(std::move(llvm::Error::success()));
229+
if (getenv("CLASP_TRAP_ONABANDONED")!=NULL) {
230+
printf("!\n!\n!\n!\n You set CLASP_TRAP_ONABANDONED - sleeping for 9999 seconds - connect using debugger to pid %d\n!\n!\n!\n!\n", getpid());
231+
sleep(9999);
232+
}
233+
printf("!\n!\n!\n!\n If you want to trap here set CLASP_TRAP_ONABANDONED - restarting for now\n!\n!\n!\n!\n");
234+
exit(1);
235+
//OnAbandoned(std::move(llvm::Error::success()));
230236
}
231237
private:
232238
Error applyProtections() {

0 commit comments

Comments
 (0)