<?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>18538</bug_id>
          
          <creation_ts>2008-04-16 12:28:28 -0700</creation_ts>
          <short_desc>Uninitialized Value object when parsing &apos;%&apos; crashes an optimized ARM build</short_desc>
          <delta_ts>2017-03-25 19:09:08 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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>1</everconfirmed>
          <reporter name="Patrick">phanna</reporter>
          <assigned_to>mitz</assigned_to>
          <cc>gyuyoung</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77843</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick">phanna</who>
    <bug_when>2008-04-16 12:28:28 -0700</bug_when>
    <thetext>Changelist 26482 introduced the ability to skip attribute values that are single &apos;%&apos; characters. This created an uninitialized Value object added to the valueList. This object caused a crash on an arm release build. I have a patch that I have tested against the original bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77844</commentid>
    <comment_count>1</comment_count>
      <attachid>20599</attachid>
    <who name="Patrick">phanna</who>
    <bug_when>2008-04-16 12:29:27 -0700</bug_when>
    <thetext>Created attachment 20599
Patch for CSSGrammar.y</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77887</commentid>
    <comment_count>2</comment_count>
      <attachid>20599</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-04-16 21:43:45 -0700</bug_when>
    <thetext>Comment on attachment 20599
Patch for CSSGrammar.y

Is it possible to make a test case for this?

Maybe:
width: %;

and then asking via getComputedStyle(element, null).width, or similar?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77909</commentid>
    <comment_count>3</comment_count>
    <who name="Patrick">phanna</who>
    <bug_when>2008-04-17 05:11:38 -0700</bug_when>
    <thetext>Sure. I&apos;m not very familiar with writing a layout test though. Where should I put it?

(In reply to comment #2)
&gt; (From update of attachment 20599 [edit])
&gt; Is it possible to make a test case for this?
&gt; 
&gt; Maybe:
&gt; width: %;
&gt; 
&gt; and then asking via getComputedStyle(element, null).width, or similar?
&gt; 

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77914</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick">phanna</who>
    <bug_when>2008-04-17 05:58:19 -0700</bug_when>
    <thetext>Looking through the codebase I found LayoutTests/fast/css/invalid-percentage-property.html which uses width: %;

Should I augment this test or is it sufficient?

(In reply to comment #2)
&gt; (From update of attachment 20599 [edit])
&gt; Is it possible to make a test case for this?
&gt; 
&gt; Maybe:
&gt; width: %;
&gt; 
&gt; and then asking via getComputedStyle(element, null).width, or similar?
&gt; 

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78619</commentid>
    <comment_count>5</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2008-04-22 22:39:21 -0700</bug_when>
    <thetext>Does the test case you mention crash without your fix, or otherwise change in result with your fix? Ideally we want a test case that crashes without (but maybe the bug is latent).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78676</commentid>
    <comment_count>6</comment_count>
    <who name="Patrick">phanna</who>
    <bug_when>2008-04-23 10:39:14 -0700</bug_when>
    <thetext>Unfortunately this only crashed for me on an optimized arm build. It crashed because it tried to create a String from an uninitialized ParseString with a huge length. Safari does not crash in debug or release mode. The only way I found out why our port crashed is by using Valgrind on a linux debug build and then tracing through the code.

The test case doesn&apos;t render any different with or without my fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79228</commentid>
    <comment_count>7</comment_count>
      <attachid>20599</attachid>
    <who name="">mitz</who>
    <bug_when>2008-04-29 10:21:05 -0700</bug_when>
    <thetext>Comment on attachment 20599
Patch for CSSGrammar.y

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79230</commentid>
    <comment_count>8</comment_count>
    <who name="Patrick">phanna</who>
    <bug_when>2008-04-29 10:45:58 -0700</bug_when>
    <thetext>Can someone with commit access land this patch for me?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79761</commentid>
    <comment_count>9</comment_count>
    <who name="Rob Buis">rwlbuis</who>
    <bug_when>2008-05-06 11:08:51 -0700</bug_when>
    <thetext>I get a changed end result for LayoutTests/fast/css/invalid-percentage-property.html. It does not look like an improvement, for starters it does
not match FF3 and Opera. Maybe Mitz can have a look.
Cheers,

Rob.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80104</commentid>
    <comment_count>10</comment_count>
      <attachid>21063</attachid>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-05-10 23:44:03 -0700</bug_when>
    <thetext>Created attachment 21063
Changed test result</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80105</commentid>
    <comment_count>11</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-05-10 23:45:05 -0700</bug_when>
    <thetext>Dan, can you take a look at the changed result please?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80210</commentid>
    <comment_count>12</comment_count>
      <attachid>20599</attachid>
    <who name="">mitz</who>
    <bug_when>2008-05-12 11:59:33 -0700</bug_when>
    <thetext>Comment on attachment 20599
Patch for CSSGrammar.y

Sorry, changing to r-. WebKit should match other engines on that test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87139</commentid>
    <comment_count>13</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-07-28 03:48:03 -0700</bug_when>
    <thetext>The proposed patch was completely incorrect. It forces WebKit to treat &quot;width: %&quot; like &quot;width 0%&quot; which it violates CSS 2.1 specification.. Current WebKit behavior is correct. I think we should close this bug report. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87144</commentid>
    <comment_count>14</comment_count>
    <who name="Patrick">phanna</who>
    <bug_when>2008-07-28 05:02:26 -0700</bug_when>
    <thetext>Maybe treating &apos;%&apos; as &apos;0%&apos; is incorrect, but leaving an uninitialized variable can cause WebKit to crash. Instead of closing the bug, maybe there is another solution that does not violate the CSS 2.1 spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1291288</commentid>
    <comment_count>15</comment_count>
    <who name="">mitz</who>
    <bug_when>2017-03-25 19:09:08 -0700</bug_when>
    <thetext>WebKit no longer uses the CSS parser that had this issue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>20599</attachid>
            <date>2008-04-16 12:29:27 -0700</date>
            <delta_ts>2010-06-10 18:49:21 -0700</delta_ts>
            <desc>Patch for CSSGrammar.y</desc>
            <filename>cssgrammar.patch</filename>
            <type>text/plain</type>
            <size>988</size>
            <attacher name="Patrick">phanna</attacher>
            
              <data encoding="base64">PyAgICAgIGNzc2dyYW1tYXIucGF0Y2gKSW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9nCShyZXZpc2lvbiAzMTk1NCkKKysrIFdlYkNvcmUvQ2hh
bmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTIgQEAKKzIwMDgtMDQtMTYgIFBhdHJp
Y2sgSGFubmEgIDxwaGFubmFAZW1haWwudW5jLmVkdT4KKworICAgICAgICBGaXggYW4gdW5pbml0
aWFsaXplZCBWYWx1ZSB3aGVuIHBhcnNpbmcgYSBzaW5nbGUgJyUnIHZhbHVlLiBUaGlzIHdhcwor
ICAgICAgICBkaXNjb3ZlcmVkIG9uIGFuIGFybSBidWlsZCB3aXRoIGhpZ2ggb3B0aW1pemF0aW9u
cy4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICAqIGNz
cy9DU1NHcmFtbWFyLnk6CisKIDIwMDgtMDQtMTUgIEFkYW0gUm9iZW4gIDxhcm9iZW5AYXBwbGUu
Y29tPgogCiAgICAgICAgIEFkZCBTdHJpbmcuZm9ybWF0CkluZGV4OiBXZWJDb3JlL2Nzcy9DU1NH
cmFtbWFyLnkKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PQotLS0gV2ViQ29yZS9jc3MvQ1NTR3JhbW1hci55CShyZXZpc2lv
biAzMTk0NykKKysrIFdlYkNvcmUvY3NzL0NTU0dyYW1tYXIueQkod29ya2luZyBjb3B5KQpAQCAt
MTA2NSw3ICsxMDY1LDcgQEAgdGVybToKICAgfCBmdW5jdGlvbiB7CiAgICAgICAkJCA9ICQxOwog
ICB9Ci0gIHwgJyUnIG1heWJlX3NwYWNlIHt9IC8qIEhhbmRsZSB3aWR0aDogJTsgKi8KKyAgfCAn
JScgbWF5YmVfc3BhY2UgeyAkJC5pZCA9IDA7ICQkLmZWYWx1ZSA9IDA7ICQkLnVuaXQgPSBDU1NQ
cmltaXRpdmVWYWx1ZTo6Q1NTX1BFUkNFTlRBR0U7IH0gLyogSGFuZGxlIHdpZHRoOiAlOyAqLwog
ICA7CiAKIHVuYXJ5X3Rlcm06Cg==
</data>
<flag name="review"
          id="8982"
          type_id="1"
          status="-"
          setter="mitz"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>21063</attachid>
            <date>2008-05-10 23:44:03 -0700</date>
            <delta_ts>2008-05-10 23:44:03 -0700</delta_ts>
            <desc>Changed test result</desc>
            <filename>diff.txt</filename>
            <type>text/plain</type>
            <size>1016</size>
            <attacher name="Mark Rowe (bdash)">mrowe</attacher>
            
              <data encoding="base64">LS0tIC90bXAvbGF5b3V0LXRlc3QtcmVzdWx0cy9mYXN0L2Nzcy9pbnZhbGlkLXBlcmNlbnRhZ2Ut
cHJvcGVydHktZXhwZWN0ZWQudHh0CTIwMDgtMDUtMTAgMjM6NDQ6MjUuMDAwMDAwMDAwIC0wNzAw
CisrKyAvdG1wL2xheW91dC10ZXN0LXJlc3VsdHMvZmFzdC9jc3MvaW52YWxpZC1wZXJjZW50YWdl
LXByb3BlcnR5LWFjdHVhbC50eHQJMjAwOC0wNS0xMCAyMzo0NDoyNS4wMDAwMDAwMDAgLTA3MDAK
QEAgLTE3LDYgKzE3LDExIEBACiAgICAgICAgICAgUmVuZGVySW5saW5lIHtQUk9QRVJUWX0gYXQg
KDAsMCkgc2l6ZSAxOTR4MTgKICAgICAgICAgICAgIFJlbmRlclRleHQgeyN0ZXh0fSBhdCAoNTE0
LDApIHNpemUgMTk0eDE4CiAgICAgICAgICAgICAgIHRleHQgcnVuIGF0ICg1MTQsMCkgd2lkdGgg
MTk0OiAiOiV9IHN0eWxlIGFyZSBpZ25vcmVkIGJ5IFNhZmFyaSIKLSAgICAgIFJlbmRlckJsb2Nr
IHtIM30gYXQgKDAsMzYpIHNpemUgNzg0eDIyIFtjb2xvcj0jMDA4MDAwXQotICAgICAgICBSZW5k
ZXJUZXh0IHsjdGV4dH0gYXQgKDAsMCkgc2l6ZSAyNTR4MjIKLSAgICAgICAgICB0ZXh0IHJ1biBh
dCAoMCwwKSB3aWR0aCAyNTQ6ICJUaGlzIHRleHQgc2hvdWxkIHNob3cgaW4gZ3JlZW4uIgorICAg
ICAgUmVuZGVyQmxvY2sge0gzfSBhdCAoMCwzNikgc2l6ZSAweDEzMiBbY29sb3I9IzAwODAwMF0K
KyAgICAgICAgUmVuZGVyVGV4dCB7I3RleHR9IGF0ICgwLDApIHNpemUgNTV4MTMyCisgICAgICAg
ICAgdGV4dCBydW4gYXQgKDAsMCkgd2lkdGggMzY6ICJUaGlzIgorICAgICAgICAgIHRleHQgcnVu
IGF0ICgwLDIyKSB3aWR0aCAzMDogInRleHQiCisgICAgICAgICAgdGV4dCBydW4gYXQgKDAsNDQp
IHdpZHRoIDU1OiAic2hvdWxkIgorICAgICAgICAgIHRleHQgcnVuIGF0ICgwLDY2KSB3aWR0aCA0
MjogInNob3ciCisgICAgICAgICAgdGV4dCBydW4gYXQgKDAsODgpIHdpZHRoIDE2OiAiaW4iCisg
ICAgICAgICAgdGV4dCBydW4gYXQgKDAsMTEwKSB3aWR0aCA1MDogImdyZWVuLiI=
</data>

          </attachment>
      

    </bug>

</bugzilla>