Repository navigation
Labels
35-x-y36-x-y37-x-ybug 🪲component/dialogcrash 💥platform/linuxstatus/confirmedA maintainer reproduced the bug or agreed with the feature
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Electron Version
35.3.0
What operating system(s) are you using?
Other Linux
Operating System Version
openSUSE Tumbleweed
What arch are you using?
x64
Last Known Working Electron version
35.2.2
Expected Behavior
Electron upon start displays the about dialog
Actual Behavior
The main process, after printing the help message, immediately crashes with the following stack trace
#0 0x000055eb7e56d444 in dbus_utils::NameHasOwner (bus=0x0, name="org.freedesktop.portal.Desktop", callback=...) at ../../components/dbus/utils/name_has_owner.cc:42
#1 0x000055eb7e56d7bb in dbus_utils::CheckForServiceAndStart (bus=..., name="org.freedesktop.portal.Desktop", callback=...) at ../../base/memory/scoped_refptr.h:284
#2 0x000055eb7c98674c in file_dialog::(anonymous namespace)::CheckPortalAvailabilityOnBusThread () at ../../electron/shell/browser/ui/file_dialog_linux_portal.cc:66
#3 0x000055eb840b625d in base::OnceCallback<void ()>::Run() && (this=0x7fe2e0bf8ec8) at ../../third_party/blink/renderer/core/frame/local_dom_window.cc:193329985
#4 base::TaskAnnotator::RunTaskImpl(base::PendingTask&) [clone .isra.0] (pending_task=..., this=<optimized out>) at ../../base/task/common/task_annotator.cc:209
#5 0x000055eb7fa29511 in base::TaskAnnotator::RunTask<base::internal::TaskTracker::RunTaskImpl(base::internal::Task&, const base::TaskTraits&, base::internal::TaskSource*, const base::internal::SequenceToken&)::<lambda(perfetto::EventContext&)> > (
this=0x17700009c648, event_name=..., pending_task=...) at ../../base/task/common/task_annotator.h:106
#6 base::internal::TaskTracker::RunTaskImpl (this=this@entry=0x17700009c640, task=..., traits=..., task_source=task_source@entry=0x177000100fc0, token=...) at ../../base/task/thread_pool/task_tracker.cc:691
#7 0x000055eb7fa29af5 in base::internal::TaskTracker::RunSkipOnShutdown (this=this@entry=0x17700009c640, task=..., traits=..., task_source=task_source@entry=0x177000100fc0, token=...) at ../../base/task/thread_pool/task_tracker.cc:676
#8 0x000055eb7fa31fce in base::internal::TaskTracker::RunTaskWithShutdownBehavior (this=0x17700009c640, task=..., traits=..., task_source=0x177000100fc0, token=...) at ../../base/task/thread_pool/task_tracker.cc:706
#9 base::internal::TaskTracker::RunTask (this=<optimized out>, task=..., task_source=0x177000100fc0, traits=...) at ../../base/task/thread_pool/task_tracker.cc:504
#10 0x000055eb7fa33403 in base::internal::TaskTracker::RunAndPopNextTask (this=0x17700009c640, task_source=...) at ../../base/task/thread_pool/task_tracker.cc:394
#11 base::internal::WorkerThread::RunWorker (this=0x1770000dea80) at ../../base/task/thread_pool/worker_thread.cc:473
#12 0x000055eb7fa341a5 in base::internal::WorkerThread::RunSharedWorker (this=<optimized out>) at ../../base/task/thread_pool/worker_thread.cc:369
#13 0x000055eb7fa342f8 in base::internal::WorkerThread::ThreadMain (this=0x1770000dea80) at ../../base/task/thread_pool/worker_thread.cc:342
#14 0x000055eb7f8b3b67 in base::(anonymous namespace)::ThreadFunc (params=<optimized out>) at ../../base/threading/platform_thread_posix.cc:103
#15 0x00007fe2eae99546 in start_thread (arg=<optimized out>) at pthread_create.c:448
#16 0x00007fe2eaf1d94c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
Testcase Gist URL
No response
Additional Information
I am building Electron from source. I do not remember touching any of the crashing code, and my patches from 35.2.2 applied cleanly (aside from a missing STL include causing one build error).
The offending code was added in commit cd871fd.
Reacted by abittner
Metadata
Metadata
Assignees
Labels
35-x-y36-x-y37-x-ybug 🪲component/dialogcrash 💥platform/linuxstatus/confirmedA maintainer reproduced the bug or agreed with the feature
Type
Projects
- StatusShow more project fields👍 Does Not Block Stable
- StatusShow more project fields🛠️ Fixed for Next Release
Activity
brjsp commentedon May 8, 2025
This is the offending code:
the
busis passed toCheckForServiceAndStartafter already being moved from inside the functor's constructor. Thebus's contained pointer is0after the scoped_refptr's move constructor executes.[-]35.3.0 crash in dbus_util::NameHasOwner (regression from 35.2.2)[/-][+]35.3.0 crash due to UaF in `file_dialog::(anonymous namespace)::CheckPortalAvailabilityOnBusThread ()` (regression from 35.2.2)[/+]deepak1556 commentedon May 8, 2025
Sorry for the regression, will have a fix up shortly.
deepak1556 commentedon May 8, 2025
@brjsp can you validate the change from #47008 in your build. Thanks!
nikwen commentedon May 8, 2025
@brjsp For our internal testing, would you be able to make a testcase gist with Electron Fiddle that allows us to reproduce the crash and verify the fix? Thank you so much in advance!
EDIT: @deepak1556 told me the code path will always execute once on startup for Linux. No further repro needed in that case. The simple "hello world" Fiddle example will trigger the code path.
brjsp commentedon May 8, 2025
the official binaries don't crash. Whether this code gets misoptimized is hard to predict since it may depend both on the compiler used and on stuff like which function gets inlined first.