thorium-cfx / mono_v2_get_started

Mono v2 runtime for FiveM/RedM
35 stars 1 forks source link

[Server] SIGSEGV after restarting resource with export to same resource #32

Open dustinslane opened 8 months ago

dustinslane commented 8 months ago

Crash results

=================================================================
    Native Crash Reporting
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

=================================================================
    Managed Stacktrace:
=================================================================
domain required for stack walk
=================================================================

Dump File:

ac37ea78-d87c-456f-b5ed-7fae77c8bba2.dmp

Reproduction steps

1. Start the resource
2. Restart the resource two, three or four times (also see video)
3. ???
4. Crash

Specific version

FXServer 7257

Extra

Context: I want to interact with an external LUA framework through a shim for C# by using exports to a LUA script within the same resource.

Resource Name: MySolution

fxmanifest.lua

server_scripts {
    'server.lua',
    'Server/bin/Debug/net452/Server.net.dll',
}

Server/bin/Debug/net452/Server.net.dll

// Server
public class Class1 : BaseScript
{
    public Class1()
    {
        Exports.Local["MySolution", "someexport"]("a", "b", 1, 2);
    }
}

server.lua

exports('someexport', function(...) 
    print(json.encode(table.pack(...)))
end)

https://github.com/thorium-cfx/mono_v2_get_started/assets/7924312/b9258f37-2603-417f-8472-a08294cd06ff

DaniGP17 commented 8 months ago

I'm having the same issue, this only happens with exports inside the same resource, if I do the same but the server.lua in other script work well.