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
Cosmopolitan Lua test runner broken #601
Comments
|
All of the above was run on Ubuntu 18.04 and gcc-9.4: |
|
Here is the output of gdb: |
|
I just updated the lua-tests to skip non existing math functions: |
|
I'm testing with the latest commit 0547eab and I'm getting this: |
|
I could isolate the test that causes the segfault: |
@mingodad, I don't get this failure, as it works for me for redbean-based lua.
Also, these failures are all related to
|
|
Thank you for reply but all references to segfault are using the attached Lua-5.3.6 amalgamation. |
|
When I add this line from the cosmopolitan default Lua build: And try to build the Lua-5.3.6 amalgamation I get this: |
Also notice that the attached tests are executed and pass all of then for the standard Lua-(5.1.5, 5.2.4, 5.3.6, 5.4.4). |
|
And when I mention |
That may be the case, but only because the "standard" Lua 5.4.x likely includes
Correct; all I'm saying is that it's not expected to pass those |
|
Thank you again for reply ! |
|
In fact I did a build with cosmopolitan of Lua-(5.1.5, 5.2.4, 5.3.6 and 5.4.4) and all of then segfault. |
|
Hello Paul ! |
|
I just added the But I would like to know what is preventing my builds of Lua-(5.1.5, 5.2.4, 5.3.6 and 5.4.4) to pass the tests, it seems to be something with the several compiler flags that I'm not using but should, actually I'm using the values provided in the README https://github.com/jart/cosmopolitan#getting-started . |
I did, indeed ;).
Yes. I saw that; great job with that translation!
That I'm not sure about, but should be able to check on that in a bit. Can you run it with --ftrace (and may be with --strace), as I'm curious where exactly it segfaults. Building a debug build may help as well, as it enables ASAN, which provides additional diagnostic for memory management issues. |
|
See the backtrace of gdb bellow, it seems that the lua_State get lost when calling str_gsub: |
|
And here is the output of |
I just saw |
|
From my |
|
Interesting when I change When I change the second parameter of But again (just to remark) with the standard build all of then works fine. |
|
Also I noticed that the README at https://github.com/jart/cosmopolitan#getting-started uses |
|
Here is all source code to replicate the issue reported here: Each And here is the output of |
Does this mean that the code sometimes works with 10 and sometimes doesn't?
It does seem like the
I'm not sure what exactly it means yet. |
|
Thank you again for reply ! I've changed the test script to add a bit more info to the output intending to make it a bit less confusing: |
|
Anyone can try to reproduce it with the full code on this zip file https://github.com/jart/cosmopolitan/files/9534950/am-lua-all.zip previously posted here #601 (comment) . |
|
I also did a build with almost identical command line used to build |
|
Finally found the missing feature to make it work, looking through Would be nice if this is mentioned on the README or somewhere else that describe any build with |
|
@mingodad, thank you for getting to the bottom of this! I think this is what @ahgamut was alluding to in his earlier message (apologies for not making clear the implications of his suggestion):
I agree that it should be more prominently listed, but this is very much app-dependent. If you ask for more nested-gsub loops, you're going to run into the same issue again. This commit has more details on |
|
Thank you again for reply ! And yes I understand that it's application dependent but knowing that the default stack size is not the same of libc/OS would help grok |
|
Could you try building open source Lua using our toolchain? https://gist.github.com/jart/3571ae8571a07435e3246a3f06ebaf58 Lua passes tests in the cosmo repo. We got it to pass very early in the project. We probably made some local modifications to them along the way though. The way we run the ones checked-in is: However Lua's tests aren't very good. It relies mostly on running Lua as a subprocess and parsing the results out of the REPL. As such, when I added a newer better Bestline based REPL to lua.com, it interfered with the delicate way the Lua tests expect things to work. So I haven't been able to run the Lua tests in months. Contributions are welcome helping us fix things. |
Playing with cosmopolitan I decided to try build/compile some projects with it and test then on of then is
Lua, cosmopolitan already hasLuain https://github.com/jart/cosmopolitan/tree/master/third_party/lua and testing it with a battery of tests I've collected from several sources (mainly from Lua itself) I noticed it doesn't pass it but the original Lua-5.4.4 and Lua-5.3.6 does pass then.The attached Lua tests has been tested with Lua(5.1.5, 5.2.4, 5.3.6, 5.4.4) and all of then pass all tests.
lua-tests.zip
Here is the output of Lua from cosmopolitan:
There are several math functions that fail and after commenting then it fail other tests.
Using this Lua script https://lua-users.org/lists/lua-l/2009-02/msg00284.html as base I created another one to create an amalgamation of the various Lua versions (also attached).
And as test I created a Lua-5.3.6 amalgamation
am-lua-5.3.6.c.zip
and with the script shown below I built it with cosmopolitan-2.0.1 and when testing it with the tests attached it segfaults:
And building it without cosmopolitan pass all tests:
The text was updated successfully, but these errors were encountered: