[Webkit-unassigned] [Bug 185611] [GTK][WPE]: Avoid trying to getenv with an unset varname

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 15 09:34:52 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=185611

--- Comment #8 from Thibault Saunier <tsaunier at gnome.org> ---
(In reply to Zan Dobersek from comment #5)
> Comment on attachment 340313 [details]
> [GTK][WPE]: Avoid trying to getenv with an unset varname
> 
> The early return would fit better inside the switch statement, under the
> default label. OTOH all the possible values of the ProcessType enum are
> handled there, so that's a soft guarantee that the early return isn't
> required at all.
> 
> Is this suppressing any real-world problem?

Yes, I am getting a segfault running the layout tests:

#0  0x00007f9f16830621 in getenv () from /usr/lib/libc.so.6
#1  0x00007f9f2e47999b in WebKit::ChildProcessProxy::getLaunchOptions (this=0x7f9f0d1b0000, launchOptions=...) at ../../Source/WebKit/UIProcess/ChildProcessProxy.cpp:79
#2  0x00007f9f2e6c487d in WebKit::PluginProcessProxy::getLaunchOptions (this=0x7f9f0d1b0000, launchOptions=...) at ../../Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp:94
#3  0x00007f9f2e479a8a in WebKit::ChildProcessProxy::connect (this=0x7f9f0d1b0000) at ../../Source/WebKit/UIProcess/ChildProcessProxy.cpp:89
#4  0x00007f9f2e6c461a in WebKit::PluginProcessProxy::PluginProcessProxy (this=0x7f9f0d1b0000, PluginProcessManager=0x7f9f36b8b4c0 <WebKit::PluginProcessManager::singleton()::pluginProcessManager>, pluginProcessAttributes=..., pluginProcessToken=1468176759767222162) at ../../Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp:78
#5  0x00007f9f2e6c44bc in WebKit::PluginProcessProxy::create (PluginProcessManager=0x7f9f36b8b4c0 <WebKit::PluginProcessManager::singleton()::pluginProcessManager>, pluginProcessAttributes=..., pluginProcessToken=1468176759767222162) at ../../Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp:64
#6  0x00007f9f2e6c24ef in WebKit::PluginProcessManager::getOrCreatePluginProcess (this=0x7f9f36b8b4c0 <WebKit::PluginProcessManager::singleton()::pluginProcessManager>, pluginProcessToken=1468176759767222162) at ../../Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp:141
#7  0x00007f9f2e6c2214 in WebKit::PluginProcessManager::fetchWebsiteData(WebKit::PluginModuleInfo const&, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::Function<void (WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul>)>&&) (this=0x7f9f36b8b4c0 <WebKit::PluginProcessManager::singleton()::pluginProcessManager>, plugin=..., fetchOptions=..., completionHandler=...) at ../../Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp:103
#8  0x00007f9f2e6eba85 in WebKit::WebsiteDataStore::State::fetchWebsiteDataForNextPlugin (this=0x55ff51c35550) at ../../Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:545
#9  0x00007f9f2e6eb7bd in WebKit::WebsiteDataStore::State::State(WTF::Ref<WebKit::WebsiteDataStore::fetchDataAndApply(WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::RefPtr<WTF::WorkQueue>&&, WTF::Function<void(WTF::Vector<WebKit::WebsiteDataRecord>)>&&)::CallbackAggregator, WTF::DumbPtrTraits<WebKit::WebsiteDataStore::fetchDataAndApply(WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::RefPtr<WTF::WorkQueue>&&, WTF::Function<void(WTF::Vector<WebKit::WebsiteDataRecord>)>&&)::CallbackAggregator> > &&, WTF::Vector<WebKit::PluginModuleInfo, 0, WTF::CrashOnOverflow, 16> &&) (this=0x55ff51c35550, callbackAggregator=..., plugins=...) at ../../Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:524
#10 0x00007f9f2e6eb734 in WebKit::WebsiteDataStore::State::fetchData(WTF::Ref<WebKit::WebsiteDataStore::fetchDataAndApply(WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::RefPtr<WTF::WorkQueue>&&, WTF::Function<void(WTF::Vector<WebKit::WebsiteDataRecord>)>&&)::CallbackAggregator, WTF::DumbPtrTraits<WebKit::WebsiteDataStore::fetchDataAndApply(WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::RefPtr<WTF::WorkQueue>&&, WTF::Function<void(WTF::Vector<WebKit::WebsiteDataRecord>)>&&)::CallbackAggregator> > &&, WTF::Vector<WebKit::PluginModuleInfo, 0, WTF::CrashOnOverflow, 16> &&) (callbackAggregator=..., plugins=...) at ../../Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:514
#11 0x00007f9f2e6ec8de in WebKit::WebsiteDataStore::fetchDataAndApply(WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::RefPtr<WTF::WorkQueue, WTF::DumbPtrTraits<WTF::WorkQueue> >&&, WTF::Function<void (WTF::Vector<WebKit::WebsiteDataRecord, 0ul, WTF::CrashOnOverflow, 16ul>)>&&) (this=0x7f9f0d1e4000, dataTypes=..., fetchOptions=..., queue=..., apply=...) at ../../Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:557
#12 0x00007f9f2e6e9517 in WebKit::WebsiteDataStore::fetchData(WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::Function<void (WTF::Vector<WebKit::WebsiteDataRecord, 0ul, WTF::CrashOnOverflow, 16ul>)>&&) (this=0x7f9f0d1e4000, dataTypes=..., fetchOptions=..., completionHandler=...) at ../../Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:225
#13 0x00007f9f2e6ecb1f in WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData(WTF::OptionSet<WebKit::WebsiteDataType>, WTF::OptionSet<WebKit::WebsiteDataFetchOption>, WTF::Function<void (WTF::HashSet<WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String> >&&)>&&) (this=0x7f9f0d1e4000, dataTypes=..., fetchOptions=..., completionHandler=...) at ../../Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:588
#14 0x00007f9f2e5a6b9a in WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData(WTF::OptionSet<WebKit::WebsiteDataType>, bool, WTF::Function<void (WTF::HashSet<WTF::String, WTF::StringHash, WTF::HashTraits<WTF::String> >&&)>&&) (dataTypes=..., shouldNotifyPage=false, completionHandler=...) at ../../Source/WebKit/UIProcess/WebProcessProxy.cpp:353
#15 0x00007f9f2eb66cab in WebKit::WebResourceLoadStatisticsStore::<lambda()>::operator()(void) (__closure=0x7f9f0d1d0008) at ../../Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:492
#16 0x00007f9f2eb97010 in WTF::Function<void()>::CallableWrapper<WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData(WTF::CompletionHandler<void()>&&)::<lambda()> >::call(void) (this=0x7f9f0d1d0000) at DerivedSources/ForwardingHeaders/wtf/Function.h:101
#17 0x000055ff50e7557c in WTF::Function<void ()>::operator()() const (this=0x7ffee374eb60) at ../../Source/WTF/wtf/Function.h:56
#18 0x000055ff50e889f2 in WTF::RunLoop::performWork (this=0x7f9f0d1f7000) at ../../Source/WTF/wtf/RunLoop.cpp:106
#19 0x000055ff50edab40 in WTF::RunLoop::<lambda(gpointer)>::operator()(gpointer) const (__closure=0x0, userData=0x7f9f0d1f7000) at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:68
#20 0x000055ff50edab64 in WTF::RunLoop::<lambda(gpointer)>::_FUN(gpointer) () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:70
#21 0x000055ff50edaaf2 in WTF::<lambda(GSource*, GSourceFunc, gpointer)>::operator()(GSource *, GSourceFunc, gpointer) const (__closure=0x0, source=0x55ff51ade160, callback=0x55ff50edab47 <WTF::RunLoop::<lambda(gpointer)>::_FUN(gpointer)>, userData=0x7f9f0d1f7000) at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:45
#22 0x000055ff50edab22 in WTF::<lambda(GSource*, GSourceFunc, gpointer)>::_FUN(GSource *, GSourceFunc, gpointer) () at ../../Source/WTF/wtf/glib/RunLoopGLib.cpp:46
#23 0x00007f9f23d6a8f8 in g_main_dispatch () at /home/thiblahute/devel/Webkit/webkit-mediastream/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:3148
#24 g_main_context_dispatch () at /home/thiblahute/devel/Webkit/webkit-mediastream/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:3813
#25 0x00007f9f23d6ace8 in g_main_context_iterate () at /home/thiblahute/devel/Webkit/webkit-mediastream/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:3886
#26 0x00007f9f23d6ad7c in g_main_context_iteration () at /home/thiblahute/devel/Webkit/webkit-mediastream/WebKitBuild/DependenciesGTK/Source/glib-2.54.2/glib/gmain.c:3947
#27 0x00007f9f253c7a75 in gtk_main_iteration () at /home/thiblahute/devel/Webkit/webkit-mediastream/WebKitBuild/DependenciesGTK/Source/gtk+-3.22.11/gtk/gtkmain.c:1413
#28 0x000055ff50e5310d in WTR::PlatformWebView::PlatformWebView (this=0x55ff51adf2c0, configuration=0x7f9f0d1ce000, options=...) at ../../Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:54
#29 0x000055ff50e20bdb in std::make_unique<WTR::PlatformWebView, OpaqueWKPageConfiguration const*&, WTR::TestOptions const&> (__args#0=@0x7ffee374ee30: 0x7f9f0d1ce000, __args#1=...) at /usr/include/c++/8.1.0/bits/unique_ptr.h:831
#30 0x000055ff50e1840c in WTR::TestController::platformCreateWebView (this=0x7ffee374fd40, configuration=0x7f9f0d1ce000, options=...) at ../../Tools/WebKitTestRunner/TestController.cpp:2408
#31 0x000055ff50e0ff26 in WTR::TestController::createWebViewWithOptions (this=0x7ffee374fd40, options=...) at ../../Tools/WebKitTestRunner/TestController.cpp:520
#32 0x000055ff50e10464 in WTR::TestController::ensureViewSupportsOptionsForTest (this=0x7ffee374fd40, test=...) at ../../Tools/WebKitTestRunner/TestController.cpp:668
#33 0x000055ff50e1271b in WTR::TestController::configureViewForTest (this=0x7ffee374fd40, test=...) at ../../Tools/WebKitTestRunner/TestController.cpp:1156
#34 0x000055ff50e2c0b9 in WTR::TestInvocation::invoke (this=0x55ff51adf4a0) at ../../Tools/WebKitTestRunner/TestInvocation.cpp:152
#35 0x000055ff50e1309d in WTR::TestController::runTest (this=0x7ffee374fd40, inputLine=0x7ffee374f4a0 "/home/thiblahute/devel/Webkit/webkit-mediastream/LayoutTests/fast/mediastream/MediaStreamConstructor.html'--timeout'30000") at ../../Tools/WebKitTestRunner/TestController.cpp:1265
#36 0x000055ff50e131ae in WTR::TestController::runTestingServerLoop (this=0x7ffee374fd40) at ../../Tools/WebKitTestRunner/TestController.cpp:1282
#37 0x000055ff50e131fc in WTR::TestController::run (this=0x7ffee374fd40) at ../../Tools/WebKitTestRunner/TestController.cpp:1290
#38 0x000055ff50e0e405 in WTR::TestController::TestController (this=0x7ffee374fd40, argc=2, argv=0x7ffee3750018) at ../../Tools/WebKitTestRunner/TestController.cpp:129
#39 0x000055ff50e545e0 in main (argc=2, argv=0x7ffee3750018) at ../../Tools/WebKitTestRunner/gtk/main.cpp:45


> Good catch, Zan. Indeed, something else must be wrong here for launchOptions.processType to be invalid. The switch would benefit from an ASSERT_NOT_REACHED() in the default case.


Let me dig a bit more :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180515/9873d6d7/attachment-0001.html>


More information about the webkit-unassigned mailing list