Last Comment Bug 700203 - Pymake needs to survive native commands doing sys.exit(0)
: Pymake needs to survive native commands doing sys.exit(0)
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla10
Assigned To: Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-06 18:40 PST by Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
Modified: 2011-11-07 07:41 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (1.94 KB, patch)
2011-11-06 18:42 PST, Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
ted: review-
Details | Diff | Splinter Review
Patch (1.69 KB, patch)
2011-11-07 04:50 PST, Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
ted: review+
Details | Diff | Splinter Review

Description Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-11-06 18:40:05 PST

    
Comment 1 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-11-06 18:41:40 PST
http://hg.mozilla.org/users/bsmedberg_mozilla.com/pymake/rev/10388675f775
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-11-06 18:42:21 PST
Created attachment 572374 [details] [diff] [review]
Patch
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-11-06 19:05:02 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/432d201b7606
Comment 4 Marco Bonardo [::mak] 2011-11-07 03:45:49 PST
https://hg.mozilla.org/mozilla-central/rev/432d201b7606
Comment 5 Ted Mielczarek [:ted.mielczarek] 2011-11-07 04:45:16 PST
Comment on attachment 572374 [details] [diff] [review]
Patch

Review of attachment 572374 [details] [diff] [review]:
-----------------------------------------------------------------

::: pymake/process.py
@@ +215,5 @@
>              print >>sys.stderr, e
>              return e.exitcode
>          except:
> +            e = sys.exc_info()[1]
> +            if isinstance(e, SystemExit) and e.code == '0':

This doesn't make sense to me. From the Python docs:
http://docs.python.org/library/exceptions.html#exceptions.SystemExit

Is someone actually calling sys.exit('0')? That really should cause the Python interpreter to exit with an error! We should fix the caller in that case, and just check for e.code == 0 or e.code is None here.

::: tests/pycmd.py
@@ +8,5 @@
>    with open(args[0], 'w') as f:
>      f.write(os.environ[args[1]])
> +
> +def asplode(args):
> +  sys.exit(args[0])

This probably wants to be int(args[0]), no?
Comment 6 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-11-07 04:50:43 PST
Created attachment 572434 [details] [diff] [review]
Patch

Aha!
Comment 7 Ted Mielczarek [:ted.mielczarek] 2011-11-07 07:41:23 PST
Comment on attachment 572434 [details] [diff] [review]
Patch

Review of attachment 572434 [details] [diff] [review]:
-----------------------------------------------------------------

::: pymake/process.py
@@ +215,5 @@
>              print >>sys.stderr, e
>              return e.exitcode
>          except:
> +            e = sys.exc_info()[1]
> +            if isinstance(e, SystemExit) and e.code == 0:

I think according to that link I pasted before, this wants to be "e.code == 0 or e.code is None".

Note You need to log in before you can comment on or make changes to this bug.