Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed dependency list overflow assert to fatal #4962

Merged
merged 2 commits into from Mar 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/z/codegen/OMRRegisterDependency.hpp
Expand Up @@ -410,7 +410,7 @@ class RegisterDependencyConditions: public OMR::RegisterDependencyConditions
// Printf added so it triggers some output even in prod build.
// If this failure is triggered in a prod build, you might
// not get a SEGV nor any meaningful error msg.
TR_ASSERT(0,"ERROR: addPostCondition list overflow\n");
TR_ASSERT_FATAL(0,"ERROR: addPostCondition list overflow\n");
_cg->comp()->failCompilation<TR::CompilationException>("addPostCondition list overflow, abort compilation\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extra failCompilation is no longer needed since TR_ASSERT_FATAL terminates the process.
This whole if statement can be simplified to

TR_ASSERT_FATAL(_addCursorForPost < _numPostConditions, "addPostCondition list overflow");

(The extra "ERROR" at the start of the message adds no value since an assert failure is obviously an error).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent point Leo. Further to that, let's think about what would happen if we hit this assert in the wild. Would there be any other information that we could print that would be helpful in this case? I'd imagine the first thing one may want to know when debugging such a problem is what is the value of _numPostConditions? It would be helpful to print that as part of the assert, along with any other information you may think would be useful.

Copy link
Contributor Author

@VermaSh VermaSh Mar 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides _numPostConditions and _addCursorForPost, is there anything else that could be useful while debugging? I was just printing those two while debugging a bug in inlineVectorizedStringIndexOf Could register name be helpful?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the virtual register pointer and name would be very useful, in addition to _numPostConditions.

}
_postConditions->setDependencyInfo(_addCursorForPost++, vr, rr, flag);
Expand Down