[Webkit-unassigned] [Bug 268402] New: JSC fails to build using --jsc-only on Linux

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 30 11:57:47 PST 2024


https://bugs.webkit.org/show_bug.cgi?id=268402

            Bug ID: 268402
           Summary: JSC fails to build using --jsc-only on Linux
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: asumu at igalia.com

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).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240130/be11732d/attachment.htm>


More information about the webkit-unassigned mailing list