lib/deploy: Use _exit() for FIFREEZE watchdog
authorColin Walters <walters@verbum.org>
Wed, 11 Oct 2017 21:02:02 +0000 (17:02 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 11 Oct 2017 21:24:39 +0000 (21:24 +0000)
This works around an (IMO) SpiderMonkey bug - it tries to
clean up in a shared library destructor, but doesn't install a
`pthread_atfork()` handler to unset its state.

Closes: https://github.com/ostreedev/ostree/issues/1262
Closes: #1264
Approved by: dbnicholson

src/libostree/ostree-sysroot-deploy.c

index c1f5af9ed663fc6635b8577073b4260194a5da81..c34e0097f7fd0673c0055508b3233e3e12ec4104 100644 (file)
@@ -1301,7 +1301,12 @@ fsfreeze_thaw_cycle (OstreeSysroot *self,
         }
       if (debug_fifreeze)
         g_printerr ("fifreeze watchdog was run\n");
-      exit (EXIT_SUCCESS);
+      /* We use _exit() rather than exit() to avoid tripping over any shared
+       * libraries in process that aren't fork() safe; for example gjs/spidermonkey:
+       * https://github.com/ostreedev/ostree/issues/1262
+       * This doesn't help for the err()/errx() calls above, but eh...
+       */
+      _exit (EXIT_SUCCESS);
     }
   else /* Parent process. */
     {