NLua icon indicating copy to clipboard operation
NLua copied to clipboard

Lua import function not working property on Linux/MacOS

Open caioavidal opened this issue 1 year ago • 4 comments

Hello,

I noticed an issue while working with NLua where the import functionality behaves differently on Linux/MacOS compared to Windows. I have encountered a scenario where running the following code works fine and the Lua script is executed without any problems:

lua.LoadCLRPackage();
lua.DoString("import 'Game.Common'");
lua.DoString("import 'Game.Common.A'");
lua.DoString("import 'Game.Common.B'");
lua.DoString("import 'Game.Common.C'");

However, when attempting to execute the following code, it doesn't work and causes the entire application to crash:

lua.LoadCLRPackage();
lua.DoString(@"import 'Game.Common'
              import 'Game.Common.A'
              import 'Game.Common.B'
              import 'Game.Common.C'");

It's important to note that both cases work fine on Windows. I'm running on Ubuntu 22.04

Thank you for your attention to this matter.

caioavidal avatar Jul 04 '23 13:07 caioavidal

What happen? it crashes? do you have the stacktrace? you running on Mono? .NET ?

viniciusjarina avatar Jul 07 '23 22:07 viniciusjarina

What happen? it crashes? do you have the stacktrace? you running on Mono? .NET ?

The application crashes. There is no stacktrace the app simply crashes. I'm running .NET 7 on Ubuntu 22.04

caioavidal avatar Jul 07 '23 22:07 caioavidal

Can you write a small test case? I don't know what is Game Game.Common etc

viniciusjarina avatar Jul 08 '23 19:07 viniciusjarina

Howdy @viniciusjarina, so I have a small test app that repros the same issue

https://github.com/Underscore76/NLuaMacDebug/tree/main

it feels super weird why some combinations work and some don't (called out in the readme). Happy to help try and debug, but the crash that occurs isn't giving me anything (it just exits directly, not a thrown error that I can catch or anything on stderr...)

Underscore76 avatar Jan 23 '24 02:01 Underscore76