lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


What we need to check is which behavior is "correct", the new one or the old one.

Regarding thread error states, I was a bit unclear on where we ended up with this... are you guys going to keep the new behavior or are you still deciding?  If we are going with the new behavior then I will start upgrade to 5.4.4 now and make the necessary changes to my code base.  If not, then I will wait until a decision is made and/or a new release candidate is sent out.
David

On Tue, Nov 23, 2021 at 1:42 PM David Sicilia <dpsicilia@gmail.com> wrote:
Ok yes I see the changes to luaE_resetthread and that explains it, in particular the removal of this line:

-  L->status = cast_byte(status);

My tests pass again when I reinstate that line.  If you need any more info from me let me know, but it sounds like we understand it now.

I guess this is a good change to make, since it seems strange that a thread would retain the error state after reset.  That said, I wonder if users are relying on it to detect errors in threads, so I think perhaps at least it should be mentioned in the release notes as a change in behavior resulting from a bug fix.

David


On Tue, Nov 23, 2021 at 12:40 PM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> Hi, I am seeing a regression (or change of behavior) related to thread
> error states.
>
> I have a test suite for the Lua API that I maintain as part of my project,
> and I downloaded Lua 5.4.4 (rc1) and ran it through the test suite and I am
> seeing consistent regressions with respect to thread error states not being
> set in threads after an error.  Has anything changed in that department?
>
> Essentially, all of my tests that expect "a thread will be in an error
> status after throwing an uncaught error" are failing, meaning that the
> lua_status of such threads is not being set to the error status after an
> uncaught error.  If you like, I can investigate further and try to find a
> minimal reproducer, if you don't think this is expected.

For sure there was a change there. What we need to check is which
behavior is "correct", the new one or the old one.

In particular, now, when we call lua_resetthread, its status is set
to Ok again, while previously it remained unchanged.

-- Roberto