<?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>65408</bug_id>
          
          <creation_ts>2011-07-29 22:50:05 -0700</creation_ts>
          <short_desc>[EFL] Add &quot;return&quot; statement corresponding to abnormal condition on _ewk_frame_smart_add.</short_desc>
          <delta_ts>2011-08-19 08:25:21 -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>WebKit EFL</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</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="KwangHyuk">hyuki.kim</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>antognolli+webkit</cc>
    
    <cc>aroben</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>leandro</cc>
    
    <cc>lucas.de.marchi</cc>
    
    <cc>rakuco</cc>
    
    <cc>ryuan.choi</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>444258</commentid>
    <comment_count>0</comment_count>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-07-29 22:50:05 -0700</bug_when>
    <thetext>In order to avoid abnormal reference of variable &quot;sd&quot;, it must be returned if it can&apos;t be allocated because variable &quot;sd&quot; can be referenced regardless of success of allocation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444261</commentid>
    <comment_count>1</comment_count>
      <attachid>102427</attachid>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-07-29 22:52:55 -0700</bug_when>
    <thetext>Created attachment 102427
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444350</commentid>
    <comment_count>2</comment_count>
      <attachid>102427</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2011-07-30 18:26:32 -0700</bug_when>
    <thetext>Comment on attachment 102427
Patch

LGTM</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>444669</commentid>
    <comment_count>3</comment_count>
    <who name="Raphael Kubo da Costa (:rakuco)">rakuco</who>
    <bug_when>2011-08-01 05:51:10 -0700</bug_when>
    <thetext>Please adjust the smart_add in ewk_view too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>447968</commentid>
    <comment_count>4</comment_count>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-08-08 05:50:31 -0700</bug_when>
    <thetext>&gt; Please adjust the smart_add in ewk_view too.

I could find the patch for ewk_view in our local repository that other engineer created.

As a result, It will be created as another patch, and of course, I will ask him to create new bug for ewk_view.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448412</commentid>
    <comment_count>5</comment_count>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-08-08 19:24:09 -0700</bug_when>
    <thetext>&gt; Please adjust the smart_add in ewk_view too.

ewk_view&apos;s patch was created as new bug. :-)
Refer the https://bugs.webkit.org/show_bug.cgi?id=65853</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448533</commentid>
    <comment_count>6</comment_count>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-08-09 05:45:56 -0700</bug_when>
    <thetext>Hi Kubo and Leandro, Shall I get your review opinion for this patch ? :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>448567</commentid>
    <comment_count>7</comment_count>
    <who name="Leandro Pereira">leandro</who>
    <bug_when>2011-08-09 07:06:40 -0700</bug_when>
    <thetext>I&apos;m closing this bug as duplicate, since the patch in 65853 already fixes this.

*** This bug has been marked as a duplicate of bug 65853 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>449554</commentid>
    <comment_count>8</comment_count>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-08-10 18:43:42 -0700</bug_when>
    <thetext>&gt; I&apos;m closing this bug as duplicate, since the patch in 65853 already fixes this.

Hi, Leandro,

But, there was no ewk_frame related change on 65853.
So, This is not duplicated.

I have pulled change set from 65853.

        * ewk/ewk_view.cpp:
         (_ewk_view_smart_add):
         (_ewk_view_smart_resize):
         (_ewk_view_smart_move):
         (_ewk_view_smart_show):
         (_ewk_view_smart_hide):
         * ewk/ewk_view_single.c:
         (_ewk_view_single_smart_add):
         (_ewk_view_single_smart_resize):
         * ewk/ewk_view_tiled.c:
         (_ewk_view_tiled_smart_add):</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451589</commentid>
    <comment_count>9</comment_count>
    <who name="Leandro Pereira">leandro</who>
    <bug_when>2011-08-16 07:05:18 -0700</bug_when>
    <thetext>Reopening bug, as I mistook ewk_frame with ewk_view.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>451671</commentid>
    <comment_count>10</comment_count>
      <attachid>102427</attachid>
    <who name="Leandro Pereira">leandro</who>
    <bug_when>2011-08-16 09:35:03 -0700</bug_when>
    <thetext>Comment on attachment 102427
Patch

Informal r+.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>452043</commentid>
    <comment_count>11</comment_count>
      <attachid>102427</attachid>
    <who name="Gyuyoung Kim">gyuyoung.kim</who>
    <bug_when>2011-08-16 18:07:20 -0700</bug_when>
    <thetext>Comment on attachment 102427
Patch

LGTM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453761</commentid>
    <comment_count>12</comment_count>
      <attachid>102427</attachid>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2011-08-19 05:28:59 -0700</bug_when>
    <thetext>Comment on attachment 102427
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=102427&amp;action=review

&gt; Source/WebKit/efl/ChangeLog:8
&gt; +        In order to avoid abnormal reference of variable &quot;sd&quot;,
&gt; +        it must be returned if it can&apos;t be allocated because variable &quot;sd&quot; can be referenced
&gt; +        regardless of success of allocation.

I think this could be stated a little more clearly. Something like:

Bail out when we fail to allocate an Ewk_Frame_Smart_Data object rather than continuing on as if the allocation had succeeded.

&gt; Source/WebKit/efl/ewk/ewk_frame.cpp:184
&gt;          sd = (Ewk_Frame_Smart_Data*)calloc(1, sizeof(Ewk_Frame_Smart_Data));
&gt; -        if (!sd)
&gt; +        if (!sd) {
&gt;              CRITICAL(&quot;could not allocate Ewk_Frame_Smart_Data&quot;);
&gt; -        else
&gt; -            evas_object_smart_data_set(o, sd);
&gt; +            return;
&gt; +        }

Is this really a condition we expect to occur? Will we really continue to function correctly even if we return early from this function? We don&apos;t check for allocation failures in most of WebKit/WebCore, so I assume that if we&apos;re really in an out-of-memory situation we&apos;ll just crash a little later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453777</commentid>
    <comment_count>13</comment_count>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-08-19 06:10:30 -0700</bug_when>
    <thetext>&gt; I think this could be stated a little more clearly. Something like: Bail out when we fail to allocate an Ewk_Frame_Smart_Data object rather than continuing on as if the allocation had succeeded.

Great sentence and I will update it according to your idea. :-)

&gt; Is this really a condition we expect to occur? Will we really continue to function correctly even if we return early from this function? We don&apos;t check for allocation failures in most of WebKit/WebCore, so I assume that if we&apos;re really in an out-of-memory situation we&apos;ll just crash a little later.

I agree with you that crash may be the better way to detect the error condition faster.
But, I believe that we will be able to notice the critical error message as soon as it will occur and this patch will give more time which browser can be alive little longer. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453791</commentid>
    <comment_count>14</comment_count>
      <attachid>104504</attachid>
    <who name="KwangHyuk">hyuki.kim</who>
    <bug_when>2011-08-19 06:31:33 -0700</bug_when>
    <thetext>Created attachment 104504
Patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453840</commentid>
    <comment_count>15</comment_count>
      <attachid>104504</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-19 08:25:16 -0700</bug_when>
    <thetext>Comment on attachment 104504
Patch.

Clearing flags on attachment: 104504

Committed r93410: &lt;http://trac.webkit.org/changeset/93410&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>453841</commentid>
    <comment_count>16</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-08-19 08:25:21 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>102427</attachid>
            <date>2011-07-29 22:52:55 -0700</date>
            <delta_ts>2011-08-19 06:31:33 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>0730_return_statement.patch</filename>
            <type>text/plain</type>
            <size>1474</size>
            <attacher name="KwangHyuk">hyuki.kim</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvZWZsL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQv
ZWZsL0NoYW5nZUxvZwppbmRleCA1MTliNzllLi42Nzc4Y2U2IDEwMDc1NQotLS0gYS9Tb3VyY2Uv
V2ViS2l0L2VmbC9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdC9lZmwvQ2hhbmdlTG9nCkBA
IC0xLDMgKzEsMTcgQEAKKzIwMTEtMDctMjkgIEt3YW5nSHl1ayBLaW0gIDxoeXVraS5raW1Ac2Ft
c3VuZy5jb20+CisKKyAgICAgICAgW0VGTF0gQWRkICJyZXR1cm4iIHN0YXRlbWVudCBjb3JyZXNw
b25kaW5nIHRvIGFibm9ybWFsIGNvb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QgKm8pCiAKICAgICBpZiAoIXNkKSB7CiAgICAgICAgIHNkID0g
KEV3a19GcmFtZV9TbWFydF9EYXRhKiljYWxsb2MoMSwgc2l6ZW9mKEV3a19GcmFtZV9TbWFydF9E
YXRhKSk7Ci0gICAgICAgIGlmICghc2QpCisgICAgICAgIGlmICghc2QpIHsKICAgICAgICAgICAg
IENSSVRJQ0FMKCJjb3VsZCBub3QgYWxsb2NhdGUgRXdrX0ZyYW1lX1NtYXJ0X0RhdGEiKTsKLSAg
ICAgICAgZWxzZQotICAgICAgICAgICAgZXZhc19vYmplY3Rfc21hcnRfZGF0YV9zZXQobywgc2Qp
OworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGV2YXNfb2JqZWN0X3Nt
YXJ0X2RhdGFfc2V0KG8sIHNkKTsKICAgICB9CiAKICAgICBzZC0+c2VsZiA9IG87Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>104504</attachid>
            <date>2011-08-19 06:31:33 -0700</date>
            <delta_ts>2011-08-19 08:25:16 -0700</delta_ts>
            <desc>Patch.</desc>
            <filename>0730_return_statement_2.patch</filename>
            <type>text/plain</type>
            <size>1401</size>
            <attacher name="KwangHyuk">hyuki.kim</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvZWZsL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQv
ZWZsL0NoYW5nZUxvZwppbmRleCAwMjZjYTI1Li5iMWZjZDE0IDEwMDc1NQotLS0gYS9Tb3VyY2Uv
V2ViS2l0L2VmbC9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYktpdC9lZmwvQ2hhbmdlTG9nCkBA
IC0xLDMgKzEsMTUgQEAKKzIwMTEtMDgtMTkgIEt3YW5nSHl1ayBLaW0gIDxoeXVraS5raW1Ac2Ft
c3VuZy5jb20+CisKKyAgICAgICAgW0VGTF0gQWRkICJyZXR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