Bug 224209

Summary: [WPE][GTK] Null pointer dereference when child process exits immediately
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, cgarcia, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch none

Description Michael Catanzaro 2021-04-05 14:52:29 PDT
In https://github.com/flathub/org.gnome.Epiphany/issues/21 we discovered that when the child process exits immediately after it is spawned, g_subprocess_get_identifier() will return nullptr. In this case, we should crash cleanly with SIGABRT via g_error(), rather than crashing with a null pointer dereference inside g_ascii_strtoll(). SIGABRT is much nicer than SIGSEGV and indicates that we really do want to crash here, whereas SIGSEGV is just a bug.
Comment 1 Michael Catanzaro 2021-04-05 14:55:06 PDT
Created attachment 425210 [details]
Patch
Comment 2 Michael Catanzaro 2021-04-06 08:33:26 PDT
The crashing test is TestWebsiteData -p /webkit/WebKitWebsiteData/configuration:

ERROR:../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:220:void testWebsiteDataConfiguration(WebsiteDataTest*, gconstpointer): 'test->fetch(persistentCaches)' should be nullptr
Bail out! ERROR:../../Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:220:void testWebsiteDataConfiguration(WebsiteDataTest*, gconstpointer): 'test->fetch(persistentCaches)' should be nullptr

My patch causes this test to fail on EWS, but the test crashes for me locally in the same way without my change. I can only imagine what's going wrong with the website data....
Comment 3 Carlos Garcia Campos 2021-04-07 00:12:05 PDT
I think the api test failure is unrelated.
Comment 4 Michael Catanzaro 2021-04-07 06:05:19 PDT
Comment on attachment 425210 [details]
Patch

Let's find out, then....
Comment 5 EWS 2021-04-07 06:13:38 PDT
Committed r275605: <https://commits.webkit.org/r275605>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425210 [details].