WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
268402
JSC fails to build using --jsc-only on Linux
https://bugs.webkit.org/show_bug.cgi?id=268402
Summary
JSC fails to build using --jsc-only on Linux
Asumu Takikawa
Reported
2024-01-30 11:57:47 PST
Currently on Linux a --jsc-only build fails like this: ``` In file included from /home/asumu/WebKit/Source/JavaScriptCore/bytecode/CallLinkInfoBase.h:31, from /home/asumu/WebKit/Source/JavaScriptCore/bytecode/CallLinkInfoBase.cpp:27, from /home/asumu/WebKit/WebKitBuild/JSCOnly/Release/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-3.cpp:1: In member function ‘void WTF::BasicRawSentinelNode<T, PassedPtrTraits>::setNext(WTF::BasicRawSentinelNode<T, PassedPtrTraits>*) [with T = JSC::CallLinkInfoBase; PassedPtrTraits = WTF::RawPtrTraits<JSC::CallLinkI nfoBase>]’, inlined from ‘void WTF::SentinelLinkedList<T, RawNode>::takeFrom(WTF::SentinelLinkedList<T, RawNode>&) [with T = JSC::CallLinkInfoBase; RawNode = WTF::BasicRawSentinelNode<JSC::CallLinkInfoBase>]’ at /home/a sumu/WebKit/WebKitBuild/JSCOnly/Release/WTF/Headers/wtf/SentinelLinkedList.h:308:31, inlined from ‘void JSC::CodeBlock::unlinkOrUpgradeIncomingCalls(JSC::VM&, JSC::CodeBlock*)’ at /home/asumu/WebKit/Source/JavaScriptCore/bytecode/CodeBlock.cpp:2096:25: /home/asumu/WebKit/WebKitBuild/JSCOnly/Release/WTF/Headers/wtf/SentinelLinkedList.h:61:55: error: storing the address of local variable ‘toBeRemoved’ in ‘*MEM[(struct BasicRawSentinelNode * const &)this_4(D) + 9 6].WTF::BasicRawSentinelNode<JSC::CallLinkInfoBase>::m_next’ [-Werror=dangling-pointer=] 61 | void setNext(BasicRawSentinelNode* next) { m_next = next; } | ~~~~~~~^~~~~~ In file included from /home/asumu/WebKit/WebKitBuild/JSCOnly/Release/JavaScriptCore/DerivedSources/unified-sources/UnifiedSource-f0a787a9-3.cpp:7: /home/asumu/WebKit/Source/JavaScriptCore/bytecode/CodeBlock.cpp: In member function ‘void JSC::CodeBlock::unlinkOrUpgradeIncomingCalls(JSC::VM&, JSC::CodeBlock*)’: /home/asumu/WebKit/Source/JavaScriptCore/bytecode/CodeBlock.cpp:2095:82: note: ‘toBeRemoved’ declared here 2095 | SentinelLinkedList<CallLinkInfoBase, BasicRawSentinelNode<CallLinkInfoBase>> toBeRemoved; | ^~~~~~~~~~~ /home/asumu/WebKit/Source/JavaScriptCore/bytecode/CodeBlock.cpp:2095:82: note: ‘((WTF::BasicRawSentinelNode<JSC::CallLinkInfoBase, WTF::RawPtrTraits<JSC::CallLinkInfoBase> >* const*)this)[12]’ declared here In member function ‘void WTF::BasicRawSentinelNode<T, PassedPtrTraits>::setPrev(WTF::BasicRawSentinelNode<T, PassedPtrTraits>*) [with T = JSC::CallLinkInfoBase; PassedPtrTraits = WTF::RawPtrTraits<JSC::CallLinkI nfoBase>]’, ``` The build failure started with commit 65c8acc4699947d9a9b6326b9672a2fca5804a8c and it's because a use of `takeFrom` for `SentinelLinkedList` was added using a stack-allocated temp list. This causes a dangling pointer warning because temporarily the list that's in the class field will be linked to the temp list while the handover happens. I believe it's ok to ignore this warning because at the end of `takeFrom`, the list is re-linked into the temp list and the other list is reset to the sentinel and the dangling pointers are gone (but GCC cannot tell, I guess).
Attachments
Add attachment
proposed patch, testcase, etc.
Asumu Takikawa
Comment 1
2024-01-30 11:59:37 PST
Pull request:
https://github.com/WebKit/WebKit/pull/23531
EWS
Comment 2
2024-01-30 23:15:36 PST
Committed
273815@main
(54c72ceeb7d7): <
https://commits.webkit.org/273815@main
> Reviewed commits have been landed. Closing PR #23531 and removing active labels.
Radar WebKit Bug Importer
Comment 3
2024-01-30 23:16:15 PST
<
rdar://problem/121991236
>
Asumu Takikawa
Comment 4
2024-01-31 09:02:59 PST
Since the patch landed, I'll leave a comment here that one of my colleagues pointed out this is a bug in GCC that's fixed in GCC 13. Either way the workaround is needed to get this to build in toolchains people are using right now (but noting this for the future).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug