<?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>12382</bug_id>
          
          <creation_ts>2007-01-23 09:19:22 -0800</creation_ts>
          <short_desc>Crash on AMD64 in dtoa.cpp</short_desc>
          <delta_ts>2007-01-26 06:16:51 -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>JavaScriptCore</component>
          <version>420+</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Jan Krämer">Camel</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>lars.knoll</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>33043</commentid>
    <comment_count>0</comment_count>
    <who name="Jan Krämer">Camel</who>
    <bug_when>2007-01-23 09:19:22 -0800</bug_when>
    <thetext>When trying out WebKit/Qt ( on my AMD64 machine I got various crashes in
kjs_dtoa at dtoa.cpp:3015
*s++ = &apos;0&apos; + (int)L;

The problem seems to that the containing loop does not terminate correctly, as at the time of the crash the loop was in its 36021 iteration.

The kjs version in the KDE repository had a change applied:
http://websvn.kde.org/trunk/KDE/kdelibs/kjs/dtoa.cpp?rev=569434&amp;r1=564344&amp;r2=569434

Following the change in the WebKit &quot;dtoa.cpp&quot; version seems to fix the crash.

See also the comment in dtoa.cpp:
//#define Long int on machines with 32-bit ints and 64-bit longs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33044</commentid>
    <comment_count>1</comment_count>
      <attachid>12627</attachid>
    <who name="Jan Krämer">Camel</who>
    <bug_when>2007-01-23 09:26:53 -0800</bug_when>
    <thetext>Created attachment 12627
a small naive patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32601</commentid>
    <comment_count>2</comment_count>
    <who name="Lars Knoll">lars.knoll</who>
    <bug_when>2007-01-25 05:34:08 -0800</bug_when>
    <thetext>Makes absolutely sense. We&apos;re using the same code in Qt and have applied the same fix there. 

I&apos;d r+ it if I had the right to do so ;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32618</commentid>
    <comment_count>3</comment_count>
      <attachid>12666</attachid>
    <who name="Jan Krämer">Camel</who>
    <bug_when>2007-01-25 10:03:14 -0800</bug_when>
    <thetext>Created attachment 12666
a simple naive patch

Added change log entry and request review :-)

I could not test for regressions, since it just did not run on my computer before this change.

If there is a supported platform that has int &lt; 32bit, stdint.h would need to be included, and the patch changed to:
#define Long int32_t</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32628</commentid>
    <comment_count>4</comment_count>
      <attachid>12668</attachid>
    <who name="Jan Krämer">Camel</who>
    <bug_when>2007-01-25 10:34:11 -0800</bug_when>
    <thetext>Created attachment 12668
same patch...better changelog

Added the reason for the change to the changelog.
(I had it in there before a i did a revert on the changelog...and then forgot to add it again)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32666</commentid>
    <comment_count>5</comment_count>
      <attachid>12668</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2007-01-25 22:10:00 -0800</bug_when>
    <thetext>Comment on attachment 12668
same patch...better changelog

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32586</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-26 06:16:51 -0800</bug_when>
    <thetext>Committed by lars in r19136.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>12627</attachid>
            <date>2007-01-23 09:26:53 -0800</date>
            <delta_ts>2007-01-25 10:03:14 -0800</delta_ts>
            <desc>a small naive patch</desc>
            <filename>dtoa.patch</filename>
            <type>text/plain</type>
            <size>270</size>
            <attacher name="Jan Krämer">Camel</attacher>
            
              <data encoding="base64">SW5kZXg6IGR0b2EuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGR0b2EuY3BwCShyZXZpc2lvbiAxOTA0NSkK
KysrIGR0b2EuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0xODgsNyArMTg4LDcgQEAKIAogCiAjaWZu
ZGVmIExvbmcKLSNkZWZpbmUgTG9uZyBsb25nCisjZGVmaW5lIExvbmcgaW50CiAjZW5kaWYKICNp
Zm5kZWYgVUxvbmcKIHR5cGVkZWYgdW5zaWduZWQgTG9uZyBVTG9uZzsK
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>12666</attachid>
            <date>2007-01-25 10:03:14 -0800</date>
            <delta_ts>2007-01-25 10:34:11 -0800</delta_ts>
            <desc>a simple naive patch</desc>
            <filename>dtoa.patch</filename>
            <type>text/plain</type>
            <size>798</size>
            <attacher name="Jan Krämer">Camel</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE5MTIzKQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsOSBAQAorMjAwNy0wMS0yNSAgSmFuIEtyYWVt
ZXIgIDxjYW1lbEBnbXguZGU+CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISku
CisKKyAgICAgICAgKiBranMvZHRvYS5jcHA6ICNkZWZpbmUgTG9uZyBpbnQgYXMgc3VnZ2VzdGVk
IGluIGNvbW1lbnQKKwogMjAwNy0wMS0yNCAgR2VvZmZyZXkgR2FyZW4gIDxnZ2FyZW5AYXBwbGUu
Y29tPgogCiAgICAgICAgIEZpeGVkIHVwICNpbmNsdWRlIG9yZGVyIGZvciBzdHlsZS4gTm8gcmV2
aWV3IG5lY2Vzc2FyeS4KSW5kZXg6IEphdmFTY3JpcHRDb3JlL2tqcy9kdG9hLmNwcAo9PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09Ci0tLSBKYXZhU2NyaXB0Q29yZS9ranMvZHRvYS5jcHAJKHJldmlzaW9uIDE5MTIzKQorKysg
SmF2YVNjcmlwdENvcmUva2pzL2R0b2EuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0xODgsNyArMTg4
LDcgQEAKIAogCiAjaWZuZGVmIExvbmcKLSNkZWZpbmUgTG9uZyBsb25nCisjZGVmaW5lIExvbmcg
aW50CiAjZW5kaWYKICNpZm5kZWYgVUxvbmcKIHR5cGVkZWYgdW5zaWduZWQgTG9uZyBVTG9uZzsK
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>12668</attachid>
            <date>2007-01-25 10:34:11 -0800</date>
            <delta_ts>2007-01-25 22:10:00 -0800</delta_ts>
            <desc>same patch...better changelog</desc>
            <filename>dtoa.patch</filename>
            <type>text/plain</type>
            <size>909</size>
            <attacher name="Jan Krämer">Camel</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT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kZWYgdW5zaWduZWQgTG9uZyBVTG9uZzsK
</data>
<flag name="review"
          id="4819"
          type_id="1"
          status="+"
          setter="mjs"
    />
          </attachment>
      

    </bug>

</bugzilla>