Undefined symbol: (anonymous namespace)::NowIncludingSuspendMs() ../../mozglue/misc/Uptime.o
Categories
(Core :: mozglue, defect, P5)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox-esr78 | --- | unaffected |
| firefox84 | --- | unaffected |
| firefox85 | --- | unaffected |
| firefox86 | --- | wontfix |
| firefox87 | --- | wontfix |
| firefox88 | --- | wontfix |
| firefox89 | --- | fixed |
People
(Reporter: petr.sumbera, Assigned: petr.sumbera)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
Steps to reproduce:
Firefox build on Solaris failed with following:
16:05.13 Undefined first referenced
16:05.13 symbol in file
16:05.13 (anonymous namespace)::NowIncludingSuspendMs() ../../mozglue/misc/Uptime.o (symbol scope specifies local binding)
16:05.13 (anonymous namespace)::NowExcludingSuspendMs() ../../mozglue/misc/Uptime.o (symbol scope specifies local binding)
16:05.13 ld: fatal: symbol referencing errors
16:05.13 collect2: error: ld returned 1 exit status
16:05.14 gmake[4]: *** [/builds/psumbera/mozilla-central-build/config/rules.mk:420: ../../dist/bin/firefox] Error 1
16:05.14 gmake[3]: *** [/builds/psumbera/mozilla-central-build/config/recurse.mk:72: browser/app/target] Error 2
The first bad revision is:
changeset: 562789:5d540daa09b9
user: Paul Adenot <paul@paul.cx>
date: Tue Jan 12 04:34:59 2021 -0800
description:
Bug 1205985 - Implement something to get the process uptime with and without the time the device was suspended. r=haik,dmajor,jld
Differential Revision: https://phabricator.services.mozilla.com/D99138
My mozconfig file is:
ac_add_options --with-system-icu
ac_add_options --with-system-libevent
ac_add_options --with-system-zlib
ac_add_options --enable-js-shell
ac_add_options --prefix=/opt/firefox
ac_add_options --enable-jemalloc
ac_add_options --enable-replace-malloc
ac_add_options --enable-pulseaudio
ac_add_options --enable-debug
ac_add_options --disable-install-strip
# use gcc (not clang)
ac_add_options --enable-release
ac_add_options --enable-debug-symbols
ac_add_options --disable-install-strip
ac_add_options --disable-optimize
ac_add_options --disable-geckodriver
# https://bugzilla.mozilla.org/show_bug.cgi?id=1547217
ac_add_options --disable-verify-mar
# no nasm on intel yet
ac_add_options --disable-av1
Updated•4 years ago
|
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
|
||
Set release status flags based on info from the regressing bug 1205985
Updated•4 years ago
|
| Assignee | ||
Comment 3•4 years ago
|
||
Following makes it compile on Solaris again:
--- a/mozglue/misc/Uptime.cpp Tue Jan 05 10:57:21 2021 +0100
+++ b/mozglue/misc/Uptime.cpp Thu Jan 14 17:16:15 2021 +0100
@@ -79,7 +79,7 @@
}
#endif // XP_WIN
-#if defined(XP_LINUX) // including Android
+#if defined(XP_LINUX) || defined(XP_SOLARIS) // including Android
# include <time.h>
// Number of nanoseconds in a millisecond.
But maybe XP_UNIX should be used instead?
I guess there is similar issue on BSD. Jan can you please confirm it?
(In reply to Petr Sumbera from comment #3)
I guess there is similar issue on BSD. Jan can you please confirm it?
Yep, see below. I've adjusted your fix to unbreak on BSDs:
- FreeBSD's linuxulator emulates CLOCK_BOOTTIME via CLOCK_UPTIME
- DragonFly inherited CLOCK_UPTIME from FreeBSD
- OpenBSD implemented both CLOCK_BOOTTIME and CLOCK_UPTIME
$ c++ --version
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-rc2-0-g43ff75f2c3f)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
$ echo "ac_add_options --enable-warnings-as-errors" >>.mozconfig
$ ./mach build
[...]
mozglue/misc/Uptime.cpp:24:17: error: function '(anonymous namespace)::NowIncludingSuspendMs' has internal linkage but is not defined [-Werror,-Wundefined-internal]
Maybe<uint64_t> NowIncludingSuspendMs();
^
mozglue/misc/Uptime.cpp:124:30: note: used here
mStartIncludingSuspendMs = NowIncludingSuspendMs();
^
mozglue/misc/Uptime.cpp:25:17: error: function '(anonymous namespace)::NowExcludingSuspendMs' has internal linkage but is not defined [-Werror,-Wundefined-internal]
Maybe<uint64_t> NowExcludingSuspendMs();
^
mozglue/misc/Uptime.cpp:125:30: note: used here
mStartExcludingSuspendMs = NowExcludingSuspendMs();
^
2 errors generated.
Comment 5•4 years ago
|
||
define CLOCK_BOOTTIME CLOCK_UPTIME is what I did at first too, but that seems to be wrong. (bug 1686713 - https://phabricator.services.mozilla.com/D101748 - now changed)
Linux: MONOTONIC excludes so BOOTTIME was added to include (https://lwn.net/Articles/420142/)
OpenBSD: UPTIME was added to exclude (https://github.com/openbsd/src/commit/e206ca2e9 actually handled differently), BOOTTIME does the same as MONOTONIC (https://github.com/openbsd/src/commit/b50bd52298d2), so MONOTONIC includes
FreeBSD: UPTIME does the same as MONOTONIC (https://github.com/freebsd/freebsd-src/commit/5eefd88949), so IIUC MONOTONIC excludes ( confirmed by ipv6 timeouts not expiring @ https://lists.freebsd.org/pipermail/freebsd-arch/2013-August/014707.html ?), no actual way to include it seems >_<
Comment 6•4 years ago
|
||
Paul, any ideas here? The first comment indicates this was caused by D99138.
Comment 7•4 years ago
|
||
I can review, but it's unclear to me what to do on BSD and Solaris for BOOTTIME, or even if it exists. In any case, this is for telemetry purposes, if you don't care about this, then just make it return Nothing(), and it will compile (maybe in a separate block). I can land a patch quickly for this, if downstream wants.
| Assignee | ||
Comment 8•4 years ago
|
||
As for Solaris there doesn't seem to be any alternative for BOOTTIME. So for us is Nothing() good enough.
Updated•4 years ago
|
Comment 9•4 years ago
|
||
Fwiw, just stumbled upon this issue on OpenBSD too, fails the same when building 86.0b1, at the linking firefox binary step:
ld: error: undefined symbol: (anonymous namespace)::NowIncludingSuspendMs()
>>> referenced by Uptime.cpp:124 (/usr/obj/ports/firefox-86.0beta1/firefox-86.0/mozglue/misc/Uptime.cpp:124)
>>> ../../mozglue/misc/Uptime.o:(mozilla::InitializeUptime())
>>> referenced by Uptime.cpp:132 (/usr/obj/ports/firefox-86.0beta1/firefox-86.0/mozglue/misc/Uptime.cpp:132)
>>> ../../mozglue/misc/Uptime.o:(mozilla::ProcessUptimeMs())
ld: error: undefined symbol: (anonymous namespace)::NowExcludingSuspendMs()
>>> referenced by Uptime.cpp:125 (/usr/obj/ports/firefox-86.0beta1/firefox-86.0/mozglue/misc/Uptime.cpp:125)
>>> ../../mozglue/misc/Uptime.o:(mozilla::InitializeUptime())
>>> referenced by Uptime.cpp:143 (/usr/obj/ports/firefox-86.0beta1/firefox-86.0/mozglue/misc/Uptime.cpp:143)
>>> ../../mozglue/misc/Uptime.o:(mozilla::ProcessUptimeExcludingSuspendMs())
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
testing https://bug1686405.bmoattachments.org/attachment.cgi?id=9197204 as a potential fix, thanks jan !
Updated•4 years ago
|
Comment 10•4 years ago
|
||
The product::component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
| Assignee | ||
Comment 11•4 years ago
|
||
I'm leaving possible BSD improvements for now. Work can be done later via Bug 1686713.
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
Comment on attachment 9210999 [details]
Bug 1686405 - Fix tier-3 build. r?glandium
this patch tested on openbsd instead of https://bug1686405.bmoattachments.org/attachment.cgi?id=9197204, 88.0b1 builds fine
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Backed out changeset 943e1e811d75 (bug 1686405) for causing build bustages in Uptime.cpp.
https://hg.mozilla.org/integration/autoland/rev/521a9c83498b31ee7e7519be086e4433c9fd26f1
Push with failures:
https://treeherder.mozilla.org/jobs?repo=autoland&revision=a3e948935c4014091760fd058c0ce1eaec5315d3&selectedTaskRun=WO3gf-NBSg-g6bir14B7yQ.0
Failure log:
https://treeherder.mozilla.org/logviewer?job_id=335156864&repo=autoland&lineNumber=5723
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Comment 17•4 years ago
|
||
| bugherder | ||
Updated•4 years ago
|
Description
•