Closed Bug 1523235 Opened 6 years ago Closed 2 years ago

js/src/gc/Memory.cpp:390:6: error: ambiguating new declaration of 'bool js::gc::MarkPagesInUse(void*, std::size_t)'

Categories

(Core :: JavaScript Engine, defect, P5)

60 Branch
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: mnowak, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (X11; SunOS i86pc; rv:60.0) Gecko/20100101 Firefox/60.0

Steps to reproduce:

I was compiling Firefox 60.5.0 ESR candidate build 2 on OpenIndiana 2018.10 (illumos kernel) with GCC 6.4.0.

Actual results:

Compilation failed with:

In file included from /export/home/newman/ws/oi-userland/components/web/firefox/build/amd64/js/src/Unified_cpp_js_src7.cpp:11:0:
/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Memory.cpp: In function 'bool js::gc::MarkPagesInUse(void*, std::size_t)':
/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Memory.cpp:390:6: error: ambiguating new declaration of 'bool js::gc::MarkPagesInUse(void*, std::size_t)'
bool MarkPagesInUse(void* p, size_t size) {
^~~~~~~~~~~~~~
In file included from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Heap.h:27:0,
from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Cell.h:11,
from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Barrier.h:12,
from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Tracer.h:12,
from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/vm/TaggedProto.h:10,
from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Marking.h:16,
from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Marking-inl.h:10,
from /export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Marking.cpp:7,
from /export/home/newman/ws/oi-userland/components/web/firefox/build/amd64/js/src/Unified_cpp_js_src7.cpp:2:
/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Memory.h:32:6: note: old declaration 'void js::gc::MarkPagesInUse(void*, std::size_t)'
void MarkPagesInUse(void* p, size_t size);
^~~~~~~~~~~~~~
In file included from /export/home/newman/ws/oi-userland/components/web/firefox/build/amd64/js/src/Unified_cpp_js_src7.cpp:11:0:
/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Memory.cpp:391:27: error: return-statement with no value, in function returning 'bool' [-fpermissive]
if (!DecommitEnabled()) return;
^~~~~~
/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Memory.cpp: At global scope:
/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Memory.cpp:59:13: warning: 'void js::gc::GetNewChunk(void**, void**, std::size_t, std::size_t)' declared 'static' but never defined [-Wunused-function]
static void GetNewChunk(void** aAddress, void** aRetainedAddr, size_t size,
^~~~~~~~~~~
/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/js/src/gc/Memory.cpp:61:14: warning: 'void* js::gc::MapAlignedPagesSlow(std::size_t, std::size_t)' declared 'static' but never defined [-Wunused-function]
static void* MapAlignedPagesSlow(size_t size, size_t alignment);
^~~~~~~~~~~~~~~~~~~
make[4]: *** [/export/home/newman/ws/oi-userland/components/web/firefox/firefox-60.5.0/config/rules.mk:1056: Unified_cpp_js_src7.o] Error 1
make[4]: *** Waiting for unfinished jobs....

Expected results:

I expected it to compile correctly.

I believe following change makes the error go away (though I haven't finished the compilation yet):

--- firefox-60.5.0/js/src/gc/Memory.cpp 2019-01-28 07:24:48.710164685 +0000
+++ firefox-60.5.0/js/src/gc/Memory.cpp.new 2019-01-28 08:32:14.018511301 +0000
@@ -387,7 +387,7 @@ bool MarkPagesUnused(void* p, size_t siz
return true;
}

-bool MarkPagesInUse(void* p, size_t size) {
+void MarkPagesInUse(void* p, size_t size) {
if (!DecommitEnabled()) return;

MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);

Status: UNCONFIRMED → NEW
Component: Untriaged → JavaScript Engine
Ever confirmed: true
Product: Firefox → Core

On OpenIndiana we usually don't build this Solaris-specific code, we patch it out https://github.com/OpenIndiana/oi-userland/pull/4656/files#diff-e5953ac159a248f09c0b23bcebe3e268 as it crashes Firefox:

{global} newman@lenovo:~ $ mdb core
mdb: core file data for mapping at 3321d61fa000 not saved: Bad address
Loading modules: [ libc.so.1 libnvpair.so.1 libavl.so.1 libuutil.so.1 ld.so.1 ]

::status
debugging core file of firefox (64-bit) from lenovo
file: /usr/lib/amd64/firefox/firefox
initial argv: firefox
threading model: native threads
status: process terminated by SIGSEGV (Segmentation Fault), pid=24853 uid=101 code=-1
$C
fffffd7fffdfe2c0 libc.so.1_lwp_kill+0xa() fffffd7fffdfe2f0 libc.so.1raise+0x20(b)
000000000000000b libxul.so`_ZN13nsProfileLock18FatalSignalHandlerEiP7siginfoPv+0xff()

Are you willing to upstream some of those patches? If you can get them into phabricator (with r?jorendorff in the first line of the commit message), I'll land 'em. Unless you think anyone else wants these SOLARIS ifdefs.

Flags: needinfo?(mnowak)
Priority: -- → P5

Reporter didn't answer NI, therefore resolving as INCOMPLETE.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.