GSCreator: Fix hang due to calling exit() after fork()
ClosedPublic

Authored by abizjak on Jan 13 2020, 5:56 PM.

Details

Summary

After fork(), exit() invokes atexit handlers, which can result in a lockup if an atexit handler uses thread synchronization facilities, since all but the current thread no longer exist. An example backtrace can be found in the linked bug report. Fix it by using _exit() instead of exit().

BUG: 404652

Test Plan

I don't know the exact environment required to trigger this bug, but one precondition is to trigger generation of thumbnails via this code; maybe browsing folders with PDF files will do that. Once you see thumbnail.so processes staying around, you must have hit this bug. This patch should prevent this issue from occurring, and it did on my system.

Diff Detail

Repository
R373 Image Thumbnailers
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
abizjak requested review of this revision.Jan 13 2020, 5:56 PM
abizjak created this revision.
abizjak retitled this revision from Fix hang due to calling exit() after fork() to GSCreator: Fix hang due to calling exit() after fork().
elvisangelaccio accepted this revision.Jan 19 2020, 7:16 PM
elvisangelaccio added a subscriber: elvisangelaccio.

Looks safe enough to me.

Can you provide an email address for the git authorship? Thanks!

This revision is now accepted and ready to land.Jan 19 2020, 7:16 PM

Ambroz Bizjak <abizjak.pro@gmail.com>

This revision was automatically updated to reflect the committed changes.