-
Notifications
You must be signed in to change notification settings - Fork 577
Commit a1325b902d ("try" support) can read uninitialized memory #18540
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
Comments
@hvds, this is the same as what we've placed in the jimk |
Yes, this was intended as a synopsis of the p5p thread for ease of tracking. |
The fix looks reasonable to me. |
Thanks, I've committed this as 5fa8d5d. I was hoping for a more specific response to my concerns above:
.. but perhaps they could better be addressed by adding some comments to pp_return() clarifying why things are done in that precise order. |
I don't think there's a problem with the order the code works in, there's two parts of pp_return, first found the sub context to return from, then pop contexts to that point and do the return, and the added try handling code is part of the first. I do think that the additional code that's doing what dopopto_cursub() should be doing is a bit suspicious. I looked over what else calls dopopto_cursub(), and ended up with:
I haven't worked out a fix yet. |
@leonerd ^^ |
I note that after this commit, George's smoker that originally complained with read access violations is now getting further, but still has some test failures on threaded builds - see here. I tried to make a similar build locally, with:
.. but it complains of all sorts of memory leaks, as below. These complaints predate the "try" work (and don't make much sense to me), could someone else see if they can reproduce the test failures in io/errnosig.t and op/magic.t?
|
Is this with PERL_DESTRUCT_LEVEL=2 ? |
Ah no, thanks, I'd completely forgotten about that one; with that in place perl builds and passes those tests for me without a problem. And looking back a bit further, I see that the smoker was already failing those tests before the "try" work was introduced, so they aren't relevant to this ticket - I've created #18547 to track that instead. So as far as the original issue is concerned this ticket could be closed now. @tonycoz it may be worth putting your additional problem case in its own ticket. |
Closing per OP @hvds's recommendation. |
@jkeenan Sorry if I was unclear: what I wrote was intended to imply "this ticket could be closed now if it were not for the additional issue raised by Tony. It should not be closed until that is either resolved or moved to a new ticket. It isn't clear to me how closely it relates to the rest of this ticket, so I'd rather leave it to the judgement of @tonycoz and/or @leonerd whether to continue it here or move it. |
Moved my unrelated crash to #18553 |
As initially reported by George Greer to p5p, building with
sanitize=address
shows that this commit causes reads of uninitialized memory, for example when a sort block exits with an explicit return:This occurs at least when the
cxix
found at the start ofpp_return()
is negative, and during a normal build causeslib/unicore/mktables
to fail.The diff below is sufficient to get
make minitest
to pass, but it isn't clear if it fully solves the problem: for example, other code inpp_return()
also checks forcxix < cxstack_ix
. It seems likely to me that the wholeCxTRY
test should probably be moved later in the function.@leonerd suggests we apply this diff; @tonycoz or @iabyn could you check it over?
Hugo
The text was updated successfully, but these errors were encountered: