<?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>99674</bug_id>
          
          <creation_ts>2012-10-17 19:59:25 -0700</creation_ts>
          <short_desc>Web Inspector: REGRESSION: [JSC] SourceProvider reuses IDs</short_desc>
          <delta_ts>2013-02-26 16:45:44 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector (Deprecated)</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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="Timothy Hatcher">timothy</reporter>
          <assigned_to name="Oliver Hunt">oliver</assigned_to>
          <cc>apavlov</cc>
    
    <cc>fpizlo</cc>
    
    <cc>ggaren</cc>
    
    <cc>keishi</cc>
    
    <cc>loislo</cc>
    
    <cc>oliver</cc>
    
    <cc>pfeldman</cc>
    
    <cc>pmuellr</cc>
    
    <cc>roger_fong</cc>
    
    <cc>vsevik</cc>
    
    <cc>web-inspector-bugs</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yurys</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>744917</commentid>
    <comment_count>0</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2012-10-17 19:59:25 -0700</bug_when>
    <thetext>JSC::SourceProvider provides an ID to identify scripts. This ID is simply this cast to an intptr_t. If SourceProvider is freed another one can be allocated in the same location and cause the same ID to be reported to the Debugger.

I am able to get the same SourceProvider ID on apple.com by reloading a few times. The IDs a reused during the same page load, so it can really confuse the Inspector given that we use these IDs to identify scripts (especially scripts without URLs.)

Either someone needs to retain the SourceProvider (maybe ScriptDebugListener::Script?) so the ID can&apos;t be reused or SourceProvider needs a new thread safe unique ID assigned when SourceProvider is created.

&lt;rdar://problem/12517297&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>744919</commentid>
    <comment_count>1</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2012-10-17 20:14:31 -0700</bug_when>
    <thetext>Retaining SourceProvider will eat more memory since ScriptDebugListener::Script already duplicates the data provided by SourceProvider. Unless we make ScriptDebugListener::Script be a shell for SourceProvider.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>744956</commentid>
    <comment_count>2</comment_count>
    <who name="Geoffrey Garen">ggaren</who>
    <bug_when>2012-10-17 21:54:38 -0700</bug_when>
    <thetext>We could also have JSC provide a UUID instead of a pointer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>744970</commentid>
    <comment_count>3</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2012-10-17 22:05:15 -0700</bug_when>
    <thetext>Yeah, that was option two I mentioned in the description: &quot;or SourceProvider needs a new thread safe unique ID assigned when SourceProvider is created.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>749765</commentid>
    <comment_count>4</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2012-10-24 10:11:38 -0700</bug_when>
    <thetext>I am positive this is a regression. I&apos;m seeing the error all the time now when I didn&apos;t at all in Safari 6.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>819098</commentid>
    <comment_count>5</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-01-29 10:57:48 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; I am positive this is a regression. I&apos;m seeing the error all the time now when I didn&apos;t at all in Safari 6.

What do you mean by thread safe? Same source on different threads needs to provide different ID?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>819106</commentid>
    <comment_count>6</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2013-01-29 11:06:11 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; I am positive this is a regression. I&apos;m seeing the error all the time now when I didn&apos;t at all in Safari 6.
&gt; 
&gt; What do you mean by thread safe? Same source on different threads needs to provide different ID?

Same source on different threads should get the same ID. I just meant something more than a global counter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>819109</commentid>
    <comment_count>7</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-01-29 11:08:25 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (In reply to comment #5)
&gt; &gt; (In reply to comment #4)
&gt; &gt; &gt; I am positive this is a regression. I&apos;m seeing the error all the time now when I didn&apos;t at all in Safari 6.
&gt; &gt; 
&gt; &gt; What do you mean by thread safe? Same source on different threads needs to provide different ID?
&gt; 
&gt; Same source on different threads should get the same ID. I just meant something more than a global counter.

Why would a global counter be insufficient?   2^31 (or 2^63) ids should be more than enough.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>819133</commentid>
    <comment_count>8</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2013-01-29 11:32:47 -0800</bug_when>
    <thetext>If there isn&apos;t an issue with two threads grabbing the same ID, then nothing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>842498</commentid>
    <comment_count>9</comment_count>
      <attachid>190388</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-02-26 16:30:31 -0800</bug_when>
    <thetext>Created attachment 190388
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>842506</commentid>
    <comment_count>10</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2013-02-26 16:40:00 -0800</bug_when>
    <thetext>Committed r144122: &lt;http://trac.webkit.org/changeset/144122&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>842511</commentid>
    <comment_count>11</comment_count>
    <who name="Roger Fong">roger_fong</who>
    <bug_when>2013-02-26 16:45:44 -0800</bug_when>
    <thetext>Broke windows build:
http://build.webkit.org/builders/Apple%20Win%20Release%20%28Build%29/builds/44992/steps/compile-webkit/logs/stdio</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>190388</attachid>
            <date>2013-02-26 16:30:31 -0800</date>
            <delta_ts>2013-02-26 16:33:36 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-99674-20130226162645.patch</filename>
            <type>text/plain</type>
            <size>3028</size>
            <attacher name="Oliver Hunt">oliver</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTQ0MTE4CmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCBm
ZDI1ZTg1Mzk3MjA1OTlkYzA3NThlYmZiOWVkYmFmMzg2NTNhYjYxLi43NmE3NmVjOTgwMzRmZDJh
NzMyODRlYmJkYzFhZWFlMzcwOGY4MDA1IDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwyMiBAQAorMjAxMy0wMi0yNiAgT2xpdmVyIEh1bnQgIDxvbGl2ZXJAYXBwbGUuY29tPgor
CisgICAgICAgIFdlYiBJbnNwZWN0b3I6IFJFR1JFU1NJT046IFtKU0NdIFNvdXJjZVByb3ZpZGVy
IHJldXNlcyBJRHMKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2h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Bib29sIG1fdmFsaWRhdGVkIDogMTsK
KyAgICAgICAgdWludHB0cl90IG1faWQgOiBzaXplb2YodWludHB0cl90KSAqIDggLSAxOwogICAg
IH07CiAKICAgICBjbGFzcyBTdHJpbmdTb3VyY2VQcm92aWRlciA6IHB1YmxpYyBTb3VyY2VQcm92
aWRlciB7Cg==
</data>
<flag name="review"
          id="211038"
          type_id="1"
          status="+"
          setter="barraclough"
    />
          </attachment>
      

    </bug>

</bugzilla>