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

[lua] Sys.environment segfault #8216

Closed
1 task
Aurel300 opened this issue Apr 25, 2019 · 2 comments
Closed
1 task

[lua] Sys.environment segfault #8216

Aurel300 opened this issue Apr 25, 2019 · 2 comments
Assignees
Labels
bug platform-lua Everything related to Lua

Comments

@Aurel300
Copy link
Member

Aurel300 commented Apr 25, 2019

class Main {
  public static function main():Void {
    trace("getEnv", Sys.getEnv("HAXE_TEST"));
    trace("environment", Sys.environment()["HAXE_TEST"]);
    Sys.putEnv("HAXE_TEST", "maňana");
    trace("getEnv", Sys.getEnv("HAXE_TEST"));
    trace("environment", Sys.environment()["HAXE_TEST"]);
  }
}
$ haxe --main Main --lua tests.lua
$ lua tests.lua
src/Main.hx:3: getEnv, null
src/Main.hx:4: environment, null
src/Main.hx:6: getEnv, maňana
src/Main.hx:7: environment, maňana
[1]    18111 segmentation fault  lua tests.lua

It seems the segfault only happens due to the environment call.

Once fixed:

  • re-enable the tests marked with this issue number in tests/sys/src/TestUnicode.hx
@Aurel300 Aurel300 added platform-lua Everything related to Lua bug labels Apr 25, 2019
@RealyUniqueName
Copy link
Member

RealyUniqueName commented May 21, 2019

Which lua version?
Here is what I get with 5.3 (still should not happen):

src/Main.hx:3: getEnv, null
src/Main.hx:4: environment, null
src/Main.hx:6: getEnv, maňana
src/Main.hx:7: environment, maňana
Uncaught Error: attempt to call a nil value
stack traceback:
        [C]: in ?
Uncaught Error: attempt to call a number value
stack traceback:
        [C]: in ?
lua: /tmp/luarocks_luarocks-source-luv-1.22.0-1-ct4yTr/luv-1.22.0-1/deps/libuv/src/unix/core.c:280: uv__finish_close: Assertion `0' failed.

@RealyUniqueName RealyUniqueName added this to the Bugs milestone May 21, 2019
@Aurel300
Copy link
Member Author

This was on 5.3.5 for me.

@jdonaldson jdonaldson self-assigned this May 21, 2019
jdonaldson added a commit that referenced this issue Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-lua Everything related to Lua
Projects
None yet
Development

No branches or pull requests

3 participants