If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Nuwa: MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_DispatchToMainThread(runnable)));

RESOLVED WONTFIX

Status

Firefox OS
General
RESOLVED WONTFIX
2 years ago
5 months ago

People

(Reporter: gwagner, Assigned: cyu)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments, 2 obsolete attachments)

(Reporter)

Description

2 years ago
Created attachment 8647464 [details]
gdb bt

Seen on current trunk on aries with debug gecko and monkey testing.
(Reporter)

Updated

2 years ago
Flags: needinfo?(cyu)
Can you get a backtrace for the main thread too?
Flags: needinfo?(anygregor)
(Reporter)

Comment 2

2 years ago
Created attachment 8647468 [details]
main thread
Flags: needinfo?(anygregor)
(Reporter)

Comment 3

2 years ago
Hm thats interesting. 2 PA processes:
root@aries:/ # b2g-ps
APPLICATION    SEC USER     PID   PPID  VSIZE  RSS     WCHAN    PC         NAME
b2g              0 root      5131  1     340116 131532 ffffffff b6ea72d4 t /system/b2g/b2g
(Nuwa)           0 root      5138  5131  116028 26012 ffffffff b6ea6a60 S /system/b2g/b2g
Homescreen       2 u0_a5468  5468  5138  148500 51608 ffffffff b6ea6894 S /system/b2g/b2g
OperatorVariant  2 u0_a5498  5498  5138  131180 39240 ffffffff b6ea6894 S /system/b2g/b2g
Built-in Keyboa  2 u0_a5645  5645  5138  139600 44812 ffffffff b6ea6894 S /system/b2g/b2g
Usage            2 u0_a6313  6313  5138  133480 42136 ffffffff b6ea6894 S /system/b2g/b2g
Find My Device   2 u0_a7362  7362  5138  130904 40420 ffffffff b6ea6894 S /system/b2g/b2g
Browser          2 u0_a7709  7709  5138  136116 43668 ffffffff b6ea6894 S /system/b2g/b2g
(Preallocated a  0 u0_a8226  8226  5138  119248 15760 ffffffff b6ea6a60 S /system/b2g/b2g
(Preallocated a  0 u0_a8248  8248  5138  119248 15588 ffffffff b6ea6a60 S /system/b2g/b2g
root@aries:/ #
(Reporter)

Comment 4

2 years ago
Probably not related but I see a bunch of those messages in logcat:
W/Nuwa    ( 5703): Threads remaining at exit:
W/Nuwa    ( 5703):   Chrome_ChildThr (origNativeThreadID=5225 recreatedNativeThreadID=5704)
W/Nuwa    ( 5703):   ImageBridgeChil (origNativeThreadID=5276 recreatedNativeThreadID=5720)
W/Nuwa    ( 5703):   BufferMgrChild (origNativeThreadID=5277 recreatedNativeThreadID=5721)
W/Nuwa    ( 5703): total: 3 outstanding threads. Please fix them so they're destroyed before this point!
W/Nuwa    ( 5703): note: sThreadCount=3, sThreadFreezeCount=18
(Reporter)

Comment 5

2 years ago
One more find in logcat from when we hit the assertion:
F/MOZ_Assert( 5131): Assertion failure: get() (dereferencing a UniquePtr containing nullptr), at ../../dist/include/mozilla/UniquePtr.h:286
(Reporter)

Updated

2 years ago
Blocks: 1155547
(Assignee)

Updated

2 years ago
Assignee: nobody → cyu
Flags: needinfo?(cyu)
(Assignee)

Comment 6

2 years ago
Created attachment 8647998 [details] [diff] [review]
Handle the failures of dispatching a runnable in the NuwaParent protocol actor.
Attachment #8647998 - Flags: review?(khuey)
(Assignee)

Comment 7

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=878162d7b429
(Assignee)

Comment 8

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=59ee36d72ecd
(Assignee)

Comment 9

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a7427572c1f6
(Assignee)

Comment 10

2 years ago
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6a361b0d4268
(Assignee)

Comment 11

2 years ago
(In reply to Cervantes Yu [:cyu] [:cervantes] from comment #10)
> https://treeherder.mozilla.org/#/jobs?repo=try&revision=6a361b0d4268

It turns out that

using namespace base;

in NuwaParent.cpp pollutes CrashReporterParent.cpp and the make windows compiler complain ambiguous usage of vsnprintf() with base::vsnprintf(). Hopefully this should build on Windows.
(Assignee)

Comment 12

2 years ago
Created attachment 8649222 [details] [diff] [review]
Handle the failures of dispatching a runnable in the NuwaParent protocol actor.
Attachment #8647998 - Attachment is obsolete: true
Attachment #8647998 - Flags: review?(khuey)
Attachment #8649222 - Flags: review?(khuey)
(Assignee)

Comment 13

2 years ago
Created attachment 8649822 [details] [diff] [review]
Handle the failures of dispatching a runnable in the NuwaParent protocol actor.

Update: fix the build failure on windows.
Attachment #8649222 - Attachment is obsolete: true
Attachment #8649222 - Flags: review?(khuey)
Attachment #8649822 - Flags: review?(khuey)
Are you sure that we're actually failing to dispatch to the main thread?  That should only fail very very late in shutdown.
Flags: needinfo?(cyu)
(Assignee)

Comment 15

2 years ago
From attachment 8647468 [details], the main thread is still running. I don't think it should ever fail dispatching to the main thread. On a closer look I found a race when 2 consecutive NuwaParent::RecvAddNewProcess() messages comes in, but it still doesn't explain the crash in MOZ_ALWAYS_TRUE().
Flags: needinfo?(cyu)
(Assignee)

Comment 16

2 years ago
Created attachment 8655399 [details] [diff] [review]
A debug instrumentation to trigger a race condition

This simulates that when 2 fork requests (one async, one sync) are on the fly. There is a race to trigger a crash in using mNewProcessFds.

I am not sure if this is the same crash, but this needs to be fixed.
So ... should I actually review this patch?
Flags: needinfo?(cyu)
(Assignee)

Comment 18

2 years ago
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #17)
> So ... should I actually review this patch?

No. I'll focus on fixing the race first and request review if there is proof that the crash is in dispatching the runnable.
Flags: needinfo?(cyu)
(Assignee)

Updated

2 years ago
Attachment #8649822 - Flags: review?(khuey)

Comment 19

5 months ago
Nuwa is gone after bug 1284674.
Status: NEW → RESOLVED
Last Resolved: 5 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.