lib/deploy: Use _exit() for FIFREEZE watchdog
authorColin Walters <walters@verbum.org>
Wed, 11 Oct 2017 21:02:02 +0000 (17:02 -0400)
committerSimon McVittie <smcv@debian.org>
Thu, 26 Oct 2017 23:19:45 +0000 (00:19 +0100)
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
Origin: upstream, 2017.13, commit:8f6ec62bfb149ec8dfb6076228dd64e5df27a76b

Gbp-Pq: Topic 2017.13
Gbp-Pq: Name lib-deploy-Use-_exit-for-FIFREEZE-watchdog.patch

src/libostree/ostree-sysroot-deploy.c

index e37db3900bd04bc285d9902af7334d641330763e..d46d5c3d14f8c9b05c18a126c72cb0c38aed2314 100644 (file)
@@ -1291,7 +1291,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. */
     {