Closed Bug 1756505 Opened 4 years ago Closed 4 years ago

Remove the ThreadIdNameMapping annotation in favor of the minidump thread names stream

Categories

(Toolkit :: Crash Reporting, enhancement)

Unspecified
Linux
enhancement

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: gsvelto, Assigned: gsvelto)

References

Details

Attachments

(2 files)

The only platforms which still rely on the ThreadIdNameMapping annotation are Linux and Android. On Linux we already have a writer for the minidump thread names stream for child processes as part of the oxidized minidump writer but for the main thread we still rely on Breakpad. We should thus do three things here:

  • Add a Breakpad writer for the thread id name mapping minidump stream on Linux (like we did in bug 1658831 for macOS)
  • Make sure it works on main process crashes on Linux
  • Make sure it works on both main and child process crashes on Android
  • Remove the ThreadIdNameMapping annotation and all its associated machinery

Bonus: this will speed up thread creation on Linux and cut per-process memory consumption by a few KiBs.

Blocks: 1756069
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED

FYI I tested this both on Linux/x86-64 and Android/ARM and it seems to be working fine everywhere. It'll be a nice improvement for Fenix which has been often missing thread names.

I've updated the patch adding a note about this change removing a potential deadlock at crash time which is the whole reason why this is blocking bug 1756069.

Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d0e31f4a0ee1 Implement a writer for the thread names' minidump stream on Linux/Android r=Gankra https://hg.mozilla.org/integration/autoland/rev/3622bb57fb67 Remove the ThreadIdNameMapping annotation and all the associated machinery r=Gankra
Flags: needinfo?(gsvelto)

Steve, I'm hitting an ICE in the GC hazards detector, can you help me sort it out?

Flags: needinfo?(sphink)

I'll take a look. Still trying to reproduce locally.

Depends on: 1759244

I don't see this in the code it's processing, but sixgill is crashing because it thinks it's seeing something like

struct S {
  int header;
  char remainder[0];
};

void f() {
  S s;
  for (auto c : s.remainder) { ... }
}

gcc constructs a RANGE_EXPR node with size_t begin = 0 and ssize_t end = -1 for this. sixgill expected both begin and end to be unsigned.

Flags: needinfo?(sphink)

I think it's coming from this type:

typedef struct {
  uint32_t number_of_thread_names;
  MDRawThreadName thread_names[0];
} MDRawThreadNamesList;

More specifically, it looks like it does this when it generates the initialization code for MDRawThreadNamesList while instantiating TypedMDRVA<MDRawThreadNamesList> and compiling its constructor. Or something like that.

Anyway, the code's fine, the hazard analysis just couldn't handle it.

Thanks for looking into this!

Pushed by gsvelto@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d303b8d7d95f Implement a writer for the thread names' minidump stream on Linux/Android r=Gankra https://hg.mozilla.org/integration/autoland/rev/353c6089fe2a Remove the ThreadIdNameMapping annotation and all the associated machinery r=Gankra
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch

== Change summary for alert #33567 (as of Thu, 17 Mar 2022 16:57:32 GMT) ==

Improvements:

Ratio Test Platform Options Absolute values (old vs new)
2% Base Content Resident Unique Memory macosx1015-64-shippable-qr 8,238,421.33 -> 8,069,802.67
2% Base Content Resident Unique Memory macosx1015-64-shippable-qr 8,238,933.33 -> 8,072,192.00

For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=33567

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: