Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Unified Diff: vm/exceptions.cc

Issue 10915295: Instead of aborting with an assert, exit with an error when we get an OOM (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/exceptions.cc
===================================================================
--- vm/exceptions.cc (revision 12412)
+++ vm/exceptions.cc (working copy)
@@ -32,7 +32,11 @@
const GrowableObjectArray& pc_offset_list) {
StackFrameIterator frames(StackFrameIterator::kDontValidateFrames);
StackFrame* frame = frames.NextFrame();
- ASSERT(frame != NULL);
+ if (frame == NULL) {
+ // We have no dart invocation frames and hence cannot find a handler
+ // to return to.
+ return false;
+ }
Function& func = Function::Handle();
Code& code = Code::Handle();
Smi& offset = Smi::Handle();
@@ -157,6 +161,16 @@
func_list,
code_list,
pc_offset_list);
+ if (handler_pc == 0) {
+ // There are no dart invocation frames on the stack we do not
cshapiro 2012/09/15 03:45:31 Might be missing a word. How about "so we" rather
siva 2012/10/09 19:01:52 Done.
+ // have a caller to return to, this is a case where we would have
cshapiro 2012/09/15 03:45:31 This seems like 2 sentences. How about a period i
siva 2012/10/09 19:01:52 Done.
siva 2012/10/09 19:01:52 Done.
+ // to call the Isolate error handler and let it deal with the shutdown.
+ // We report an error and shutdown the process as a temporary solution
+ // until the isolate error handler stuff is implemented.
+ ASSERT(!handler_exists);
+ OS::Print("Exception '%s' thrown:\n", exception.ToCString());
cshapiro 2012/09/15 03:45:31 Why not OS::PrintErr? Maybe note that we are exit
siva 2012/10/09 19:01:52 Done.
+ OS::Exit(255);
cshapiro 2012/09/15 03:45:31 Just a thought: this is not the first place where
siva 2012/10/09 19:01:52 Agree, that would work for exits from the VM but t
+ }
// TODO(5411263): At some point we can optimize by figuring out if a
// stack trace is needed based on whether the catch code specifies a
// stack trace object or there is a rethrow in the catch clause.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698