Closed Bug 1952657 Opened 1 year ago Closed 2 months ago

abseil-cpp tries to include non-existent "execinfo.h" header on musl+loongarch64/armv7

Categories

(Firefox Build System :: General, defect)

Firefox 136
defect

Tracking

(firefox152 fixed)

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: ptrcnull, Assigned: ptrcnull)

Details

Attachments

(1 file, 1 obsolete file)

the mechanism for wrapping system includes is just iterating over a massive array of headers, not checking whether they exist or not, but abseil-cpp uses a __has_include(<execinfo.h>) to check whether they can import it safely; that breaks when the header is unconditionally wrapped by the build system:

22:07.93 In file included from Unified_cpp_stacktrace_gn0.cpp:2:
22:07.94 In file included from /builds/alpine/aports/community/firefox/src/firefox-136.0/third_party/abseil-cpp/absl/debugging/stacktrace.cc:46:
22:07.94 In file included from /builds/alpine/aports/community/firefox/src/firefox-136.0/third_party/abseil-cpp/absl/debugging/internal/stacktrace_generic-inl.inc:23:
22:07.94 /builds/alpine/aports/community/firefox/src/firefox-136.0/obj/dist/system_wrappers/execinfo.h:3:15: fatal error: 'execinfo.h' file not found
22:07.94     3 | #include_next <execinfo.h>
22:07.94       |               ^~~~~~~~~~~~
22:07.94 1 error generated.
22:07.96 gmake[4]: *** [/builds/alpine/aports/community/firefox/src/firefox-136.0/config/rules.mk:676: Unified_cpp_stacktrace_gn0.o] Error 1
Severity: -- → S4
Flags: needinfo?(bugzilla)

that would not work here - stacktrace_config.h chooses which implementation to use based on the existence of the header, and it chooses one that uses symbols from said header; if the header ends up being empty, that will just result in missing symbols and undefined functions.

Flags: needinfo?(bugzilla)
Assignee: nobody → bugzilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #9470739 - Attachment is obsolete: true

From the D248421 review:

Honestly, I'd take this as an occasion to reflect on whether we actually want abseil to have its own stack unwinder. Or even, if we make any practical use of that code at all.

I poked at this as part of restructuring abseil-cpp into a standalone Library("abseil") target in Firefox (Bug 2038068). Glandium's comment is on point. Firefox does not use absl's stack unwinder, it has its own stack unwinding infrastructure. absl/debugging/stacktrace.cc and the related debugging targets (symbolize, examine_stack, failure_signal_handler, etc.) are pulled in transitively by the GN //:absl target but none of their symbols are referenced by any Firefox code.

Seems safe to drop.

Assignee: bugzilla → ryanvm

Taking a closer look and attempting a Try push with the absl/debugging directory completely excluded from the build, there were linker failures because absl/log calls absl::GetStackTrace and absl::Symbolize.
https://treeherder.mozilla.org/logviewer?job_id=565344641&repo=try&task=ds7X9qCeSmi1-zCBH34VHQ.0&lineNumber=120563

So it seems that trying to omit their stack unwinder from our builds isn't really a feasible option after all and the attached patch is the correct functional approach to take. While we could maybe theoretically patch abseil-cpp to never use the execinfo.h header, that seems more invasive and troublesome than it's worth?

Assignee: ryanvm → bugzilla
Flags: needinfo?(mh+mozilla)

How about stubbing out absl::GetStackTrace and absl::Symbolize? I don't think we have much use for that log output (but I could be wrong).
That said, that doesn't need to block fixing this.

Flags: needinfo?(mh+mozilla)
Pushed by rvandermeulen@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b24a8076022f https://hg.mozilla.org/integration/autoland/rev/9192890a06d6 Only wrap header execinfo.h when it actually exists. r=glandium,firefox-build-system-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: