Bug 82310 - Handle DRT crash caused by Android OOM.
Summary: Handle DRT crash caused by Android OOM.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hao Zheng
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-27 01:59 PDT by Hao Zheng
Modified: 2012-03-27 20:05 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.52 KB, patch)
2012-03-27 02:05 PDT, Hao Zheng
no flags Details | Formatted Diff | Diff
Patch (6.54 KB, patch)
2012-03-27 02:38 PDT, Hao Zheng
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hao Zheng 2012-03-27 01:59:17 PDT
Handle DRT crash caused by Android OOM.
Comment 1 Hao Zheng 2012-03-27 02:05:29 PDT
Created attachment 134003 [details]
Patch
Comment 2 Adam Barth 2012-03-27 02:16:45 PDT
Comment on attachment 134003 [details]
Patch

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

> Tools/Scripts/webkitpy/layout_tests/port/chromium.py:580
> +        if crash and line is not None:
> +            error.append(line)

I'm not sure I quite understand what these lines do.  Can you explain a bit more?

> Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py:484
> +            if drt_return == 137:

Can we name this constant?
Comment 3 Adam Barth 2012-03-27 02:17:02 PDT
This looks fine, I'm just unsure about the change to chromium.py.
Comment 4 Hao Zheng 2012-03-27 02:23:20 PDT
(In reply to comment #2)
> (From update of attachment 134003 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=134003&action=review
> 
> > Tools/Scripts/webkitpy/layout_tests/port/chromium.py:580
> > +        if crash and line is not None:
> > +            error.append(line)
> 
> I'm not sure I quite understand what these lines do.  Can you explain a bit more?
> 

Sure. This is to append the last output line when crash happens.

> > Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py:484
> > +            if drt_return == 137:
> 
> Can we name this constant?

Will replace with signal.SIGKILL.
Comment 5 Adam Barth 2012-03-27 02:24:34 PDT
Comment on attachment 134003 [details]
Patch

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

Ok.

>>> Tools/Scripts/webkitpy/layout_tests/port/chromium.py:580
>>> +            error.append(line)
>> 
>> I'm not sure I quite understand what these lines do.  Can you explain a bit more?
> 
> Sure. This is to append the last output line when crash happens.

I see.  Previously we were truncating.
Comment 6 Hao Zheng 2012-03-27 02:38:51 PDT
Created attachment 134009 [details]
Patch
Comment 7 Tony Chang 2012-03-27 10:09:24 PDT
Comment on attachment 134009 [details]
Patch

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

Should there be test cases for this?

> Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py:551
> +        return None if (return_match is None) else int(return_match.group(1))

Nit: This could be "return return_match and int(return_match.group(1))".
Comment 8 WebKit Review Bot 2012-03-27 19:50:15 PDT
Comment on attachment 134009 [details]
Patch

Rejecting attachment 134009 [details] from commit-queue.

zhenghao@chromium.org does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py.

- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your committer rights.
Comment 9 Hao Zheng 2012-03-27 19:55:33 PDT
(In reply to comment #7)
> (From update of attachment 134009 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=134009&action=review
> 
> Should there be test cases for this?
> 

As it involves adb command and a recursion of 10 levels, I could not find a good way to test it. Any suggestion on this? I could add tests in https://bugs.webkit.org/show_bug.cgi?id=80852 .

> > Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py:551
> > +        return None if (return_match is None) else int(return_match.group(1))
> 
> Nit: This could be "return return_match and int(return_match.group(1))".

Ternary operator looks more readable to me. Is there any style guideline on this?

Tony, as I don't have commit right, could you set commit-queue for me? Thanks!
Comment 10 Tony Chang 2012-03-27 19:57:57 PDT
(In reply to comment #9)
> (In reply to comment #7)
> > (From update of attachment 134009 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=134009&action=review
> > 
> > Should there be test cases for this?
> > 
> 
> As it involves adb command and a recursion of 10 levels, I could not find a good way to test it. Any suggestion on this? I could add tests in https://bugs.webkit.org/show_bug.cgi?id=80852 .

Can you mock out adb?

> > > Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py:551
> > > +        return None if (return_match is None) else int(return_match.group(1))
> > 
> > Nit: This could be "return return_match and int(return_match.group(1))".
> 
> Ternary operator looks more readable to me. Is there any style guideline on this?

No style guide, hence a nit.
Comment 11 Hao Zheng 2012-03-27 20:01:39 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > (In reply to comment #7)
> > > (From update of attachment 134009 [details] [details] [details])
> > > View in context: https://bugs.webkit.org/attachment.cgi?id=134009&action=review
> > > 
> > > Should there be test cases for this?
> > > 
> > 
> > As it involves adb command and a recursion of 10 levels, I could not find a good way to test it. Any suggestion on this? I could add tests in https://bugs.webkit.org/show_bug.cgi?id=80852 .
> 
> Can you mock out adb?
> 

Good idea. Need some refactoring. Will do in bug 80852.

> > > > Tools/Scripts/webkitpy/layout_tests/port/chromium_android.py:551
> > > > +        return None if (return_match is None) else int(return_match.group(1))
> > > 
> > > Nit: This could be "return return_match and int(return_match.group(1))".
> > 
> > Ternary operator looks more readable to me. Is there any style guideline on this?
> 
> No style guide, hence a nit.
Comment 12 WebKit Review Bot 2012-03-27 20:05:48 PDT
Comment on attachment 134009 [details]
Patch

Clearing flags on attachment: 134009

Committed r112359: <http://trac.webkit.org/changeset/112359>
Comment 13 WebKit Review Bot 2012-03-27 20:05:53 PDT
All reviewed patches have been landed.  Closing bug.