<?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>37195</bug_id>
          
          <creation_ts>2010-04-07 01:53:07 -0700</creation_ts>
          <short_desc>JSC&apos;s currentThreadStackBase is not reentrant on some platforms</short_desc>
          <delta_ts>2010-04-29 00:15:45 -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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Qt</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>35784</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Hausmann">hausmann</reporter>
          <assigned_to name="Simon Hausmann">hausmann</assigned_to>
          <cc>abarth</cc>
    
    <cc>ap</cc>
    
    <cc>eric</cc>
    
    <cc>kent.hansen</cc>
    
    <cc>koshuin</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>norbert.leser</cc>
    
    <cc>ogoffart</cc>
    
    <cc>s.mathur</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>209536</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-07 01:53:07 -0700</bug_when>
    <thetext>On some platforms the implementation of currentThreadStackBase() in runtime/Collector.cpp uses global variables, either to store the stack base itself and/or the last thread handle. The latter case is used as an optimization to avoid expensive operating system calls to determine the stack base. However if the function is called simultaenously from multiple threads, access to the global variables needs to be protected.

There are two consequences of the current code:

    1) Either it crashes because of concurrent access to the global variables, causing memory corruption.

    2) Or the thread stack base of a thread different than the current thread is returned, causing the garbage collector to miss out objects to free.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209537</commentid>
    <comment_count>1</comment_count>
      <attachid>52715</attachid>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-07 01:55:14 -0700</bug_when>
    <thetext>Created attachment 52715
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209541</commentid>
    <comment_count>2</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-07 02:12:32 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Created an attachment (id=52715) [details]
&gt; Patch

Yep, this fixes the crash on Linux.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209549</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2010-04-07 03:02:41 -0700</bug_when>
    <thetext>Attachment 52715 did not build on mac:
Build output: http://webkit-commit-queue.appspot.com/results/1552337</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209588</commentid>
    <comment_count>4</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-07 05:44:09 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Attachment 52715 [details] did not build on mac:
&gt; Build output: http://webkit-commit-queue.appspot.com/results/1552337

Patch needs a guard for the currentThreadStackBaseMutex() definition, so it&apos;s not defined on platforms that don&apos;t use it (the Mac buildbot treats warnings as errors, and really, we don&apos;t want this warning).
As we discussed already, we just need to be careful with the #if OS(UNIX) part... :) Something like

#if (OS(UNIX) &amp;&amp; !(OS(DARWIN) || OS(QNX) || OS(SOLARIS) || OS(OPENBSD) || OS(HAIKU) || OS(SYMBIAN))

For QNX, I&apos;d also consider moving the MutexLocker into currentThreadStackBaseQNX() (even though the function is not called from anywhere else currently).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209591</commentid>
    <comment_count>5</comment_count>
    <who name="Olivier Goffart">ogoffart</who>
    <bug_when>2010-04-07 05:55:10 -0700</bug_when>
    <thetext>The patch is not correct on symbian. As the stackBase will be assigned the value of the first thread, and will not be changed again if this function is called from a different thread.

(I am wondering if it is worth to cache those value at all.  And if it is, maybe a thread local storage would work better?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209599</commentid>
    <comment_count>6</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-07 06:10:40 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; #if (OS(UNIX) &amp;&amp; !(OS(DARWIN) || OS(QNX) || OS(SOLARIS) || OS(OPENBSD) ||
&gt; OS(HAIKU) || OS(SYMBIAN))

Hehe, we don&apos;t want the OS(QNX) and OS(SYMBIAN) above of course...
This builds on Mac:

#if (OS(UNIX) &amp;&amp; !(OS(DARWIN) || OS(HAIKU) || OS(OPENBSD) || OS(SOLARIS))) || OS(WINCE)

static Mutex&amp; currentThreadStackBaseMutex()
{
    AtomicallyInitializedStatic(Mutex&amp;, mutex = *new Mutex);
    return mutex;
}

#endif</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209600</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-07 06:11:34 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; The patch is not correct on symbian. As the stackBase will be assigned the
&gt; value of the first thread, and will not be changed again if this function is
&gt; called from a different thread.
&gt; 
&gt; (I am wondering if it is worth to cache those value at all.  And if it is,
&gt; maybe a thread local storage would work better?)

Right, the patch only addresses the concurrency issue 1). With that patch there&apos;s a chance of getting less crashes, but we&apos;ll continue to collect less objects than we could.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209602</commentid>
    <comment_count>8</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-07 06:16:49 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; The patch is not correct on symbian. As the stackBase will be assigned the
&gt; value of the first thread, and will not be changed again if this function is
&gt; called from a different thread.

That&apos;s a problem with the original patch for Symbian, not this patch.
 
&gt; (I am wondering if it is worth to cache those value at all.  And if it is,
&gt; maybe a thread local storage would work better?)

Yeah, Simon and I were also wondering whether the caching is needed on Symbian. Is it just a case of the Symbian implementation following the pattern of the Unix one (caching the value), or is the system call really that slow on Symbian too? If it is slow, then at least there needs to be a check to see if the thread handle is the same to validate the cached value, like in the Unix branch.
Janne, do you have any insights?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209608</commentid>
    <comment_count>9</comment_count>
      <attachid>52733</attachid>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-07 06:29:03 -0700</bug_when>
    <thetext>Created attachment 52733
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209609</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-04-07 06:30:05 -0700</bug_when>
    <thetext>Attachment 52733 did not pass style-queue:

Failed to run &quot;WebKitTools/Scripts/check-webkit-style&quot; exit_code: 1
JavaScriptCore/runtime/Collector.cpp:535:  More than one command on the same line in if  [whitespace/parens] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>209669</commentid>
    <comment_count>11</comment_count>
    <who name="Olivier Goffart">ogoffart</who>
    <bug_when>2010-04-07 09:19:45 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Right, the patch only addresses the concurrency issue 1). With that patch
&gt; there&apos;s a chance of getting less crashes, but we&apos;ll continue to collect less
&gt; objects than we could.

We would still crash in case 2). Since we will look the memory between the base of the stack of one thread, and the top of the stack of the current thread. That cannot work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215299</commentid>
    <comment_count>12</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-21 07:18:33 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; Created an attachment (id=52733) [details]
&gt; Patch

Builds on Mac now, at least.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215316</commentid>
    <comment_count>13</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-21 07:46:28 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #7)
&gt; &gt; Right, the patch only addresses the concurrency issue 1). With that patch
&gt; &gt; there&apos;s a chance of getting less crashes, but we&apos;ll continue to collect less
&gt; &gt; objects than we could.
&gt; 
&gt; We would still crash in case 2). Since we will look the memory between the base
&gt; of the stack of one thread, and the top of the stack of the current thread.
&gt; That cannot work.

Nobody from S60 have responded (Norbert, are you there? :) ), and I can&apos;t even find an API reference for RThread and friends, so I don&apos;t know what the appropriate fix is.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215340</commentid>
    <comment_count>14</comment_count>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-21 08:44:27 -0700</bug_when>
    <thetext>Alright, I got some great information from two Symbian guys on IRC.
They believed that the construction of RThread + calling stackInfo() every time is not that expensive. To make the current implementation reentrant, we would have to mutex-lock _and_ call RThread::Id(); whereas not locking and calling stackInfo() would solve the stale cache + reentrancy issue, simplifies the code, and might actually be faster.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>215342</commentid>
    <comment_count>15</comment_count>
      <attachid>53961</attachid>
    <who name="Kent Hansen">kent.hansen</who>
    <bug_when>2010-04-21 08:49:21 -0700</bug_when>
    <thetext>Created attachment 53961
Patch for Symbian (untested)

Does anyone on Symbian have a chance to test it?
If it works, I&apos;ll add the ChangeLog so we can get this committed, then Simon can rebase his patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>217601</commentid>
    <comment_count>16</comment_count>
      <attachid>54401</attachid>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-27 02:07:39 -0700</bug_when>
    <thetext>Created attachment 54401
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>217602</commentid>
    <comment_count>17</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-27 02:09:13 -0700</bug_when>
    <thetext>(In reply to comment #16)
&gt; Created an attachment (id=54401) [details]
&gt; Patch

Combined Kent and my patch, so that the return value on Symbian is always thread specific and reentrant.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>217604</commentid>
    <comment_count>18</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-04-27 02:11:02 -0700</bug_when>
    <thetext>Attachment 54401 did not pass style-queue:

Failed to run &quot;[&apos;WebKitTools/Scripts/check-webkit-style&apos;, &apos;--no-squash&apos;]&quot; exit_code: 1
JavaScriptCore/runtime/Collector.cpp:535:  More than one command on the same line in if  [whitespace/parens] [4]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>217689</commentid>
    <comment_count>19</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2010-04-27 07:26:19 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; Alright, I got some great information from two Symbian guys on IRC.
&gt; They believed that the construction of RThread + calling stackInfo() every time
&gt; is not that expensive. To make the current implementation reentrant, we would
&gt; have to mutex-lock _and_ call RThread::Id(); whereas not locking and calling
&gt; stackInfo() would solve the stale cache + reentrancy issue, simplifies the
&gt; code, and might actually be faster.

While the proposed patch is OK for Symbian (simple is good), we should at least add a comment there saying that RThread::StackInfo() involves a call to kernel mode code: 
http://developer.symbian.org/xref/oss/xref/MCL/sf/os/kernelhwsrv/kernel/eka/euser/us_exec.cpp

So, there is a possibility of slowdown because currentThreadStackBase() is called frequently, IIRC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>217838</commentid>
    <comment_count>20</comment_count>
      <attachid>54401</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-04-27 12:16:33 -0700</bug_when>
    <thetext>Comment on attachment 54401
Patch

Looks OK. Seems to me it would be fine to repeat the single line three times:

    AtomicallyInitializedStatic(Mutex&amp;, mutex = *new Mutex);

Rather than having a function for it, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>217908</commentid>
    <comment_count>21</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-27 13:50:34 -0700</bug_when>
    <thetext>(In reply to comment #20)
&gt; (From update of attachment 54401 [details])
&gt; Looks OK. Seems to me it would be fine to repeat the single line three times:
&gt; 
&gt;     AtomicallyInitializedStatic(Mutex&amp;, mutex = *new Mutex);
&gt; 
&gt; Rather than having a function for it, though.

Good idea! I&apos;ll change that before landing. Thanks for the review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>218300</commentid>
    <comment_count>22</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-28 03:05:57 -0700</bug_when>
    <thetext>Committed r58393: &lt;http://trac.webkit.org/changeset/58393&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>218307</commentid>
    <comment_count>23</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2010-04-28 03:42:46 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/58393 might have broken Tiger Intel Release
The following changes are on the blame list:
http://trac.webkit.org/changeset/58393
http://trac.webkit.org/changeset/58394
http://trac.webkit.org/changeset/58395</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>218868</commentid>
    <comment_count>24</comment_count>
    <who name="Simon Hausmann">hausmann</who>
    <bug_when>2010-04-29 00:15:33 -0700</bug_when>
    <thetext>Revision r58393 cherry-picked into qtwebkit-2.0 with commit 76fc13db1b9a2116d6bee35c0e2c8fbfd940cd34</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>52715</attachid>
            <date>2010-04-07 01:55:14 -0700</date>
            <delta_ts>2010-04-07 06:28:55 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-37195-20100407105512.patch</filename>
            <type>text/plain</type>
            <size>2540</size>
            <attacher name="Simon Hausmann">hausmann</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCA1ZjU2NDdlLi5hMTYxOGU2IDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTcg
QEAKKzIwMTAtMDQtMDcgIFNpbW9uIEhhdXNtYW5uICA8c2ltb24uaGF1c21hbm5Abm9raWEuY29t
PgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEpTQydz
IGN1cnJlbnRUaHJlYWRTdGFja0Jhc2UgaXMgbm90IHJlZW50cmFudCBvbiBzb21lIHBsYXRmb3Jt
cworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MzcxOTUK
KworICAgICAgICBUaGlzIGZ1bmN0aW9uIG5lZWRzIHRvIGJlIHJlZW50cmFudCB0byBhdm9pZCBt
ZW1vcnkgY29ycnVwdGlvbiBvbiBwbGF0Zm9ybXMgd2hlcmUKKyAgICAgICAgdGhlIGltcGxlbWVu
dGF0aW9uIHVzZXMgZ2xvYmFsIHZhcmlhYmxlcy4KKworICAgICAgICAqIHJ1bnRpbWUvQ29sbGVj
dG9yLmNwcDogTWFrZSB0aGUgZnVuY3Rpb24gcmVlbnRyYW50IG9uIHRoZSBwbGF0Zm9ybXMgd2hl
cmUgbmVjZXNzYXJ5IGJ5IGFkZGluZyBhIG11dGV4IGxvY2suCisgICAgICAgIChKU0M6OmN1cnJl
bnRUaHJlYWR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ICs2MTMsNyBAQCBzdGF0aWMgaW5saW5lIHZvaWQqIGN1cnJlbnRUaHJlYWRTdGFja0Jh
c2UoKQogICAgIH0KICAgICByZXR1cm4gc3RhdGljX2Nhc3Q8Y2hhcio+KHN0YWNrQmFzZSkgKyBz
dGFja1NpemU7CiAjZWxpZiBPUyhXSU5DRSkKKyAgICBNdXRleExvY2tlciBsb2NrZXIoY3VycmVu
dFRocmVhZFN0YWNrQmFzZU11dGV4KCkpOwogICAgIGlmIChnX3N0YWNrQmFzZSkKICAgICAgICAg
cmV0dXJuIGdfc3RhY2tCYXNlOwogICAgIGVsc2Ugewo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>52733</attachid>
            <date>2010-04-07 06:29:03 -0700</date>
            <delta_ts>2010-04-27 02:08:19 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-37195-20100407152901.patch</filename>
            <type>text/plain</type>
            <size>2637</size>
            <attacher name="Simon Hausmann">hausmann</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCA1ZjU2NDdlLi5hMTYxOGU2IDEwMDY0NAotLS0gYS9KYXZhU2NyaXB0Q29y
ZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTcg
QEAKKzIwMTAtMDQtMDcgIFNpbW9uIEhhdXNtYW5uICA8c2ltb24uaGF1c21hbm5Abm9raWEuY29t
PgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIEpTQydz
IGN1cnJlbnRUaHJlYWRTdGFja0Jhc2UgaXMgbm90IHJlZW50cmFudCBvbiBzb21lIHBsYXRmb3Jt
cworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J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PSAwOwogICAgIGlm
IChzdGFja0Jhc2UgPT0gMCkgewogICAgICAgICBUVGhyZWFkU3RhY2tJbmZvIGluZm87CkBAIC01
ODIsNiArNTkyLDcgQEAgc3RhdGljIGlubGluZSB2b2lkKiBjdXJyZW50VGhyZWFkU3RhY2tCYXNl
KCkKICAgICBnZXRfdGhyZWFkX2luZm8oZmluZF90aHJlYWQoTlVMTCksICZ0aHJlYWRJbmZvKTsK
ICAgICByZXR1cm4gdGhyZWFkSW5mby5zdGFja19lbmQ7CiAjZWxpZiBPUyhVTklYKQorICAgIE11
dGV4TG9ja2VyIGxvY2tlcihjdXJyZW50VGhyZWFkU3RhY2tCYXNlTXV0ZXgoKSk7CiAgICAgc3Rh
dGljIHZvaWQqIHN0YWNrQmFzZSA9IDA7CiAgICAgc3RhdGljIHNpemVfdCBzdGFja1NpemUgPSAw
OwogICAgIHN0YXRpYyBwdGhyZWFkX3Qgc3RhY2tUaHJlYWQ7CkBAIC02MDQsNiArNjE1LDcgQEAg
c3RhdGljIGlubGluZSB2b2lkKiBjdXJyZW50VGhyZWFkU3RhY2tCYXNlKCkKICAgICB9CiAgICAg
cmV0dXJuIHN0YXRpY19jYXN0PGNoYXIqPihzdGFja0Jhc2UpICsgc3RhY2tTaXplOwogI2VsaWYg
T1MoV0lOQ0UpCisgICAgTXV0ZXhMb2NrZXIgbG9ja2VyKGN1cnJlbnRUaHJlYWRTdGFja0Jhc2VN
dXRleCgpKTsKICAgICBpZiAoZ19zdGFja0Jhc2UpCiAgICAgICAgIHJldHVybiBnX3N0YWNrQmFz
ZTsKICAgICBlbHNlIHsK
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>53961</attachid>
            <date>2010-04-21 08:49:21 -0700</date>
            <delta_ts>2010-04-27 02:08:36 -0700</delta_ts>
            <desc>Patch for Symbian (untested)</desc>
            <filename>SymbianCurrentThreadStackBase.diff</filename>
            <type>text/plain</type>
            <size>874</size>
            <attacher name="Kent Hansen">kent.hansen</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL3NyYy8zcmRwYXJ0eS93ZWJraXQvSmF2YVNjcmlwdENvcmUvcnVudGltZS9D
b2xsZWN0b3IuY3BwIGIvc3JjLzNyZHBhcnR5L3dlYmtpdC9KYXZhU2NyaXB0Q29yZS9ydW50aW1l
L0NvbGxlY3Rvci5jcHAKaW5kZXggMjg1OTI5MC4uYjM1NjNkYSAxMDA2NDQKLS0tIGEvc3JjLzNy
ZHBhcnR5L3dlYmtpdC9KYXZhU2NyaXB0Q29yZS9ydW50aW1lL0NvbGxlY3Rvci5jcHAKKysrIGIv
c3JjLzNyZHBhcnR5L3dlYmtpdC9KYXZhU2NyaXB0Q29yZS9ydW50aW1lL0NvbGxlY3Rvci5jcHAK
QEAgLTU2OSwxNCArNTY5LDEwIEBAIHN0YXRpYyBpbmxpbmUgdm9pZCogY3VycmVudFRocmVhZFN0
YWNrQmFzZSgpCiAgICAgcHRocmVhZF9zdGFja3NlZ19ucCh0aHJlYWQsICZzdGFjayk7CiAgICAg
cmV0dXJuIHN0YWNrLnNzX3NwOwogI2VsaWYgT1MoU1lNQklBTikKLSAgICBzdGF0aWMgdm9pZCog
c3RhY2tCYXNlID0gMDsKLSAgICBpZiAoc3RhY2tCYXNlID09IDApIHsKLSAgICAgICAgVFRocmVh
ZFN0YWNrSW5mbyBpbmZvOwotICAgICAgICBSVGhyZWFkIHRocmVhZDsKLSAgICAgICAgdGhyZWFk
LlN0YWNrSW5mbyhpbmZvKTsKLSAgICAgICAgc3RhY2tCYXNlID0gKHZvaWQqKWluZm8uaUJhc2U7
Ci0gICAgfQotICAgIHJldHVybiAodm9pZCopc3RhY2tCYXNlOworICAgIFRUaHJlYWRTdGFja0lu
Zm8gaW5mbzsKKyAgICBSVGhyZWFkIHRocmVhZDsKKyAgICB0aHJlYWQuU3RhY2tJbmZvKGluZm8p
OworICAgIHJldHVybiAodm9pZCopaW5mby5pQmFzZTsKICNlbGlmIE9TKEhBSUtVKQogICAgIHRo
cmVhZF9pbmZvIHRocmVhZEluZm87CiAgICAgZ2V0X3RocmVhZF9pbmZvKGZpbmRfdGhyZWFkKE5V
TEwpLCAmdGhyZWFkSW5mbyk7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>54401</attachid>
            <date>2010-04-27 02:07:39 -0700</date>
            <delta_ts>2010-04-27 12:16:33 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-37195-20100427110737.patch</filename>
            <type>text/plain</type>
            <size>2992</size>
            <attacher name="Simon Hausmann">hausmann</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZyBiL0phdmFTY3JpcHRDb3JlL0No
YW5nZUxvZwppbmRleCAyYTM4OGVkOWU3YWNmZjRmZmQwOTkyZTlkNDZkMWVjZjZjNzQzZWJhLi44
ZTY3OWIwMTM0YTE4ZTI0OGU4ZjViNWE2ZWVmMmI4Zjk1MmEyNDg2IDEwMDY0NAotLS0gYS9KYXZh
U2NyaXB0Q29yZS9DaGFuZ2VMb2cKKysrIGIvSmF2YVNjcmlwdENvcmUvQ2hhbmdlTG9nCkBAIC0x
LDMgKzEsMjAgQEAKKzIwMTAtMDQtMjcgIFNpbW9uIEhhdXNtYW5uICA8c2ltb24uaGF1c21hbm5A
bm9raWEuY29tPiwgS2VudCBIYW5zZW4gPGtlbnQuaGFuc2VuQG5va2lhLmNvbT4KKworICAgICAg
ICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBKU0MncyBjdXJyZW50VGhy
ZWFkU3RhY2tCYXNlIGlzIG5vdCByZWVudHJhbnQgb24gc29tZSBwbGF0Zm9ybXMKKyAgICAgICAg
aHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTM3MTk1CisKKyAgICAgICAg
VGhpcyBmdW5jdGlvbiBuZWVkc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ICByZXR1
cm4gZ19zdGFja0Jhc2U7CiAgICAgZWxzZSB7Cg==
</data>
<flag name="review"
          id="38362"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>