<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>245628</bug_id>
          
          <creation_ts>2022-09-24 12:31:27 -0700</creation_ts>
          <short_desc>[JSC] Mark Intl.DurationFormat structure</short_desc>
          <delta_ts>2022-09-24 23:07:12 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mikhail R. Gadelha">mikhail</reporter>
          <assigned_to name="Yusuke Suzuki">ysuzuki</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1900919</commentid>
    <comment_count>0</comment_count>
      <attachid>462586</attachid>
    <who name="Mikhail R. Gadelha">mikhail</who>
    <bug_when>2022-09-24 12:31:27 -0700</bug_when>
    <thetext>Created attachment 462586
Testcase

Tested on linux intel 64 and ARMv7.

The regression seems to have been introduced by commit 0a1408274330aa1999490790cee7d2b9b3b8ac2b.

Running the attached test case fails with the following message:

$ ./WebKitBuild/Debug/bin/jsc bar.js
ASSERTION FAILED: decontaminate()
/home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/StructureID.h(130) : JSC::Structure *JSC::StructureID::decode() const
Aborted (core dumped)

The backtrace:

#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737246848832) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737246848832) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737246848832, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff19f5476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff19db7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff427127b in WTFCrashWithInfo () at WTF/Headers/wtf/Assertions.h:754
#6  0x00007ffff42e529e in JSC::StructureID::decode (this=0x7ffe00007dd0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/StructureID.h:130
#7  0x00007ffff42e4b75 in JSC::JSCell::structure (this=0x7ffe00007dd0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/JSCellInlines.h:137
#8  0x00007ffff42e8dd9 in JSC::Heap::writeBarrier (this=0x7fffa6000080, from=0x7fffe8020668) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/heap/HeapInlines.h:121
#9  0x00007ffff42e8d44 in JSC::VM::writeBarrier (this=0x7fffa6000000, from=0x7fffe8020668) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/VM.h:894
#10 0x00007ffff42e8973 in JSC::AuxiliaryBarrier&lt;JSC::Butterfly*&gt;::AuxiliaryBarrier&lt;JSC::Butterfly*&amp;&gt; (this=0x7fffe8020670, vm=..., owner=0x7fffe8020668, value=@0x7fffffffc820: 0x0)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/AuxiliaryBarrierInlines.h:39
#11 0x00007ffff42e8775 in JSC::JSObject::JSObject (this=0x7fffe8020668, vm=..., structure=0x7ffe00007dd0, butterfly=0x0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/JSObject.h:1374
#12 0x00007ffff42dd7bd in JSC::JSNonFinalObject::JSNonFinalObject (this=0x7fffe8020668, vm=..., structure=0x7ffe00007dd0, butterfly=0x0)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/JSObject.h:1202
#13 0x00007ffff5a0a04d in JSC::IntlDurationFormat::IntlDurationFormat (this=0x7fffe8020668, vm=..., structure=0x7ffe00007dd0)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:74
#14 0x00007ffff5a09ef1 in JSC::IntlDurationFormat::create (vm=..., structure=0x7ffe00007dd0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:63
#15 0x00007ffff5a51da2 in JSC::constructIntlDurationFormat (globalObject=0x7fffa641a068, callFrame=0x7fffffffca40)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/IntlDurationFormatConstructor.cpp:90
#16 0x00007fffa71ac0c7 in ?? ()
#17 0x00007fffffffcae0 in ?? ()
#18 0x00007ffff4231e37 in js_trampoline_op_construct_varargs () from /home/mgadelha/tools/WebKit/WebKitBuild/Debug/lib/libJavaScriptCore.so.1
#19 0x0000000000000000 in ?? ()
(gdb) 
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737246848832) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737246848832) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737246848832, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff19f5476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff19db7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff427127b in WTFCrashWithInfo () at WTF/Headers/wtf/Assertions.h:754
#6  0x00007ffff42e529e in JSC::StructureID::decode (this=0x7ffe00007dd0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/StructureID.h:130
#7  0x00007ffff42e4b75 in JSC::JSCell::structure (this=0x7ffe00007dd0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/JSCellInlines.h:137
#8  0x00007ffff42e8dd9 in JSC::Heap::writeBarrier (this=0x7fffa6000080, from=0x7fffe8020668) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/heap/HeapInlines.h:121
#9  0x00007ffff42e8d44 in JSC::VM::writeBarrier (this=0x7fffa6000000, from=0x7fffe8020668) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/VM.h:894
#10 0x00007ffff42e8973 in JSC::AuxiliaryBarrier&lt;JSC::Butterfly*&gt;::AuxiliaryBarrier&lt;JSC::Butterfly*&amp;&gt; (this=0x7fffe8020670, vm=..., owner=0x7fffe8020668, value=@0x7fffffffc820: 0x0)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/AuxiliaryBarrierInlines.h:39
#11 0x00007ffff42e8775 in JSC::JSObject::JSObject (this=0x7fffe8020668, vm=..., structure=0x7ffe00007dd0, butterfly=0x0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/JSObject.h:1374
#12 0x00007ffff42dd7bd in JSC::JSNonFinalObject::JSNonFinalObject (this=0x7fffe8020668, vm=..., structure=0x7ffe00007dd0, butterfly=0x0)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/JSObject.h:1202
#13 0x00007ffff5a0a04d in JSC::IntlDurationFormat::IntlDurationFormat (this=0x7fffe8020668, vm=..., structure=0x7ffe00007dd0)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:74
#14 0x00007ffff5a09ef1 in JSC::IntlDurationFormat::create (vm=..., structure=0x7ffe00007dd0) at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:63
#15 0x00007ffff5a51da2 in JSC::constructIntlDurationFormat (globalObject=0x7fffa641a068, callFrame=0x7fffffffca40)
    at /home/mgadelha/tools/WebKit/Source/JavaScriptCore/runtime/IntlDurationFormatConstructor.cpp:90
#16 0x00007fffa71ac0c7 in ?? ()
#17 0x00007fffffffcae0 in ?? ()
#18 0x00007ffff4231e37 in js_trampoline_op_construct_varargs () from /home/mgadelha/tools/WebKit/WebKitBuild/Debug/lib/libJavaScriptCore.so.1
#19 0x0000000000000000 in ?? ()

Found by Igalia Fuzzing Campaign.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900920</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-09-24 12:31:41 -0700</bug_when>
    <thetext>&lt;rdar://problem/100365199&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900967</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-09-24 19:33:55 -0700</bug_when>
    <thetext>Will fix it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900968</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-09-24 19:36:58 -0700</bug_when>
    <thetext>Changing it to non security since it is ToT issue, not shipped into any branches.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900969</commentid>
    <comment_count>4</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-09-24 19:40:28 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/4673</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900979</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-09-24 23:07:10 -0700</bug_when>
    <thetext>Committed 254837@main (3440aeb31ed3): &lt;https://commits.webkit.org/254837@main&gt;

Reviewed commits have been landed. Closing PR #4673 and removing active labels.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>462586</attachid>
            <date>2022-09-24 12:31:27 -0700</date>
            <delta_ts>2022-09-24 12:31:27 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>bar.js</filename>
            <type>text/javascript</type>
            <size>489</size>
            <attacher name="Mikhail R. Gadelha">mikhail</attacher>
            
              <data encoding="base64">KGZ1bmN0aW9uKCkgCnsKICBnYygpfSkoKQpmdW5jdGlvbiBfX2ZfMjIoX192XzY0KSB7CiAgcmV0
dXJuIF9fdl82NC5oYXNPd25Qcm9wZXJ0eSgicHJvdG90eXBlIikgJiYKICAgICAgICAgX192XzY0
LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eSgicmVzb2x2ZWRPcHRpb25zIil9CmZ1bmN0aW9uIF9f
Zl8yNShfX3ZfNjcpIHsKICBfX3ZfNjggPSBbXQogIHRyeSB7CiAgICBpZiAoX192XzY3ID09SW50
bC5EaXNwbGF5TmFtZXMpCiAgICAgIHRyeSB7CiAgICAgICAgX192XzY4ID0gWyAsIHt0eXBlIDog
Imxhbmd1YWdlIn0gXX0gY2F0Y2gge30KICB9IGNhdGNoIHt9CiAgbmV3IF9fdl82NyguLi5fX3Zf
NjgpICB9CiAgICBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhJbnRsKQogICAgICAgICAgICAg
ICAgICAgICAubWFwKF9fdl83MSA9PiBJbnRsW19fdl83MV0pCiAgICAgICAgICAgICAgICAgICAg
IC5maWx0ZXIoX19mXzIyKS5maWx0ZXIoIF9fZl8yNSkK
</data>

          </attachment>
      

    </bug>

</bugzilla>