-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Don't use "mostly debug runtime" with release configurations #4112
Conversation
Hi @SeanTAllen, The changelog - changed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do. Release notes are added by creating a uniquely named file in the The basic format of the release notes (using markdown) should be:
Thanks. |
46161dc
to
479a63f
Compare
@@ -1019,6 +1019,7 @@ static LLVMTypeRef ffi_return_type(compile_t* c, reach_type_t* t, | |||
|
|||
if(t->underlying == TK_TUPLETYPE) | |||
{ | |||
(void)intrinsic; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure how we want to deal with these things that aren't in an #ifdef that exist only for asserts.
this is my "get it to compile solution". any ideas for a better approach?
ast_t* body = ast_childidx(parent, 6); | ||
(void)body; | ||
pony_assert(ast == body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels like it should be wrapped in an ifdef so we dont do this extra lookup BUT... eh, does it matter as it is in the compiler and the ifdef would end up being weird.
25e740a
to
8204529
Compare
huh so something in code that wasn't previously being executed is segfaulting. that's fun. i could use help debugging if anyone has time. |
This is the backtrace building the runner:
there's no get_token_id in frame_push so Im a little confused. |
@SeanTAllen There's a call to Edit: the same applies inside |
@ergl "It is guarded by pony_assert(ast != NULL), which is perhaps being removed by this change?" <-- i dont understand what you mean by "perhaps being removed by this change". All this is doing is turning on PONY_NDEBUG and fixing compilation errors that result from that. So something related PONY_NDEBUG or fixing the compilation errors triggers and error and in debug, there's no assert. There's no assert triggered, nor any segfault with |
So runner can be built if... I make it so that assert is always on (but PONY_NDEBUG is as well) + turn off well_formed_message asserts (2 of them) + make token and ast have a frozen variable so that all the asserts work. |
Update: So runner can be built if...
|
AND here we go... a side-effect in an assert. o lord: this is around line 705 in refer.c pony_assert(typeref == ast_pop(ast)); |
It appears Joe was the baddie 5 years ago. Looks like we've been running with always assert on in the compiler for a long long time. |
Nice catch. |
This removes the inclusion of PONY_ALWAYS_ASSERT when building and adds the small changes needed to compile with that change. We haven't been running with PONY_NDEBUG on for a long time as PONY_ALWAYS_ASSERT "turns off" PONY_NDEBUG. This means that for the most part, config=release has result in debug versions of the runtime.
40a803f
to
37431a2
Compare
src/libponyc/pass/refer.c
Outdated
@@ -702,7 +702,9 @@ static bool qualify_typeref(pass_opt_t* opt, ast_t* ast) | |||
ast_setdata(ast, (void*)def); | |||
ast_setid(ast, TK_TYPEREF); | |||
|
|||
pony_assert(typeref == ast_pop(ast)); | |||
ast_t* popped = ast_pop(ast); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm open to better names than "popped". i haven't spent any time understanding the context of what was popped as it was just tossed.
The first comment on this PR is what should be used as the commit message when squashing. |
Co-authored-by: Joe Eli McIlvain <[email protected]>
This removes the inclusion of PONY_ALWAYS_ASSERT when building and
adds the small changes needed to compile with that change.
We haven't been running with PONY_NDEBUG on for a long time as
PONY_ALWAYS_ASSERT "turns off" PONY_NDEBUG. This means that for the
most part, config=release has result in debug versions of the runtime.
This commit also rearranges our PR CI order so that
config=debug
comesbefore
config=release
. If we do introduce a compiler error, it is betterto trigger an assertion than a crash. We stop running CI after the first error
so we could be left with a segfault that would be explained by an assertion.
The reordering so that debug is run before release assures that we will see
the most informative error messages.
The commit also fixes an assert in refer.c that had a side-effect. Compiling ponyc with
assertions off would lead to a compiler that segfaulted because a required ast_pop
wasn't being done.
The commit includes many small changes to handle variables that are only used for
assertions and lead to compilation errors.