Bug 158672

Summary: Asserts-enabled builds fails because JSC::JSCell::inherits is not defined
Product: WebKit Reporter: Jeremy Huddleston Sequoia <jeremyhu>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal    
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Jeremy Huddleston Sequoia 2016-06-11 23:11:44 PDT
Recent master (r201265, b077d8fac8360fe5406bf13a44bbeff9acb0f9ea) fails to build with the following link error:

Undefined symbols for architecture x86_64:
  "JSC::JSCell::inherits(JSC::ClassInfo const*) const", referenced from:
      JSC::CodeBlock::ownerScriptExecutable() const in FTLCapabilities.cpp.o
ld: symbol(s) not found for architecture x86_64

We see the usage here:

bytecode/CodeBlock.h:
ScriptExecutable* ownerScriptExecutable() const { return jsCast<ScriptExecutable*>(m_ownerExecutable.get()); }

with jsCast implemented here, showing the JSC::JSCell::inherits call 

runtime/JSCell.h:
template<typename To, typename From>
inline To jsCast(From* from)
{
    ASSERT_WITH_SECURITY_IMPLICATION(!from || from->JSCell::inherits(std::remove_pointer<To>::type::info()));
    return static_cast<To>(from);
}

If asserts are disabled and SECURITY_ASSERTIONS are disabled, ASSERT_WITH_SECURITY_IMPLICATION is a no-op, and this could go unnoticed, but if the assertions are enabled, the build fails because JSCell.cpp does not implement JSC::JSCell::inherits(JSC::ClassInfo const*) const.
Comment 1 Jeremy Huddleston Sequoia 2016-06-11 23:12:27 PDT
I'm updating to a newer revision, but looking at code changes, I suspect this to still be an issue.
Comment 2 Jeremy Huddleston Sequoia 2016-06-11 23:21:12 PDT
You can reproduce this by configuring using cmake with the following options:
    -DCMAKE_C_FLAGS_RELEASE="-UNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-UNDEBUG"

Or likely by using the Debug conifg.
Comment 3 Jeremy Huddleston Sequoia 2016-06-12 00:37:45 PDT
Looks like it's a missing include of JSCellInlines.h
Comment 4 Alexey Proskuryakov 2016-06-12 21:43:20 PDT
FWIW, mainline debug build succeeds - we have CI that verifies it all the time.

Lacking an include sounds feasible - my guess is that your port doesn't enable some feature, and thus doesn't get the include for free.
Comment 5 Jeremy Huddleston Sequoia 2016-06-12 22:02:20 PDT
This is webkit-gtk, building straight from master.
Comment 6 Jeremy Huddleston Sequoia 2016-06-12 22:12:32 PDT
And shouldn't there be a non-inline version of this function provided in JSCell.cpp anyways for cases where JSCellInlines.h is not included?