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

Serious regression from PR 46 #54

Closed
alerque opened this issue Mar 23, 2022 · 2 comments · Fixed by #56
Closed

Serious regression from PR 46 #54

alerque opened this issue Mar 23, 2022 · 2 comments · Fixed by #56
Labels
bug Something isn't working

Comments

@alerque
Copy link
Member

alerque commented Mar 23, 2022

Paging @arichard4, we have a small problem. Everything seemed pretty good but I'm doing some pre-release testing and throw the HEAD version at a larger project (a couple hundred Lua files) and end up with something like this:

$ luacheck .
Critical error: Luacheck 0.25.0 bug (please report at https://github.com/lunarmodules/luacheck/issues):
/usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:73: attempt to index a nil value (upvalue 'chstate')
stack traceback:
        /usr/share/lua/5.4/luacheck/utils.lua:187: in metamethod 'index'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:73: in upvalue 'handle_nodes'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:69: in upvalue 'handle_nodes'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:69: in upvalue 'handle_nodes'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:69: in upvalue 'handle_nodes'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:69: in upvalue 'handle_nodes'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:43: in upvalue 'handle_nodes'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:57: in upvalue 'handle_nodes'
        /usr/share/lua/5.4/luacheck/stages/unwrap_parens.lua:96: in field 'run'
        /usr/share/lua/5.4/luacheck/stages/init.lua:71: in function </usr/share/lua/5.4/luacheck/stages/init.lua:69>
        (...tail calls...)
        [C]: in function 'xpcall'
        /usr/share/lua/5.4/luacheck/utils.lua:201: in field 'try'
        /usr/share/lua/5.4/luacheck/check.lua:49: in function </usr/share/lua/5.4/luacheck/check.lua:47>
        (...tail calls...)
        /usr/share/lua/5.4/luacheck/multithreading.lua:56: in function </usr/share/lua/5.4/luacheck/multithreading.lua:45>
        (...tail calls...)
        [C]: in function 'xpcall'
        /usr/share/lua/5.4/luacheck/utils.lua:201: in field 'try'
        /usr/share/lua/5.4/luacheck/multithreading.lua:61: in function </usr/share/lua/5.4/luacheck/multithreading.lua:60>
stack traceback:
        /usr/share/lua/5.4/luacheck/utils.lua:187: in function </usr/share/lua/5.4/luacheck/utils.lua:183>
        [C]: in function 'error'
        /usr/share/lua/5.4/luacheck/check.lua:62: in function </usr/share/lua/5.4/luacheck/check.lua:47>
        (...tail calls...)
        /usr/share/lua/5.4/luacheck/multithreading.lua:56: in function </usr/share/lua/5.4/luacheck/multithreading.lua:45>
        (...tail calls...)
        [C]: in function 'xpcall'
        /usr/share/lua/5.4/luacheck/utils.lua:201: in field 'try'
        /usr/share/lua/5.4/luacheck/multithreading.lua:61: in function </usr/share/lua/5.4/luacheck/multithreading.lua:60>
stack traceback:
        /usr/share/lua/5.4/luacheck/utils.lua:187: in function </usr/share/lua/5.4/luacheck/utils.lua:183>
        [C]: in function 'error'
        /usr/share/lua/5.4/luacheck/multithreading.lua:98: in function 'luacheck.multithreading.pmap'
        /usr/share/lua/5.4/luacheck/runner.lua:224: in method '_add_new_reports'
        /usr/share/lua/5.4/luacheck/runner.lua:262: in method '_get_reports'
        /usr/share/lua/5.4/luacheck/runner.lua:333: in method 'check'
        /usr/share/lua/5.4/luacheck/main.lua:308: in function </usr/share/lua/5.4/luacheck/main.lua:260>
        (...tail calls...)
        [C]: in function 'xpcall'
        /usr/share/lua/5.4/luacheck/utils.lua:201: in function 'luacheck.utils.try'
        /usr/share/lua/5.4/luacheck/main.lua:343: in main chunk
        [C]: in global 'require'
        /usr/lib/luarocks/rocks-5.4/luacheck/dev-1/bin/luacheck:2: in main chunk
        [C]: in ?

This is using 0.25.0.r42.gca770a4, I don't have the same problem on the same project on 0.25.0 built using the same version of Lua.

I haven't done much to track this down yet, but it is going to need fixing before I can tag 0.26.0 and if you have any ideas I'm all ears.

@alerque alerque added the bug Something isn't working label Mar 23, 2022
@alerque
Copy link
Member Author

alerque commented Mar 23, 2022

Further info: every file in the project will pass just fine if run one by one, the issue is with processing multiple files. Either luacheck . or passing a list of 5 or so files will cause this. Some sets of 5 pass some don't. I suspect this is a race condition with lanes, but I don't know that — I just thought I'd through out what I have so far.

@alerque
Copy link
Member Author

alerque commented Mar 23, 2022

Yes, luacheck -j1 . works on everything I can throw at it, -j2 starts dying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant