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

C# Export Server Crash 8978+ #2653

Closed
isingrel opened this issue Jul 19, 2024 · 7 comments
Closed

C# Export Server Crash 8978+ #2653

isingrel opened this issue Jul 19, 2024 · 7 comments

Comments

@isingrel
Copy link
Contributor

isingrel commented Jul 19, 2024

What happened?

Invoking an export from C# results in a server crash.

Exports["c_sharp"].csharp("from c#");

Expected result

export should be executed

Reproduction steps

Invoke an export from with in a C# server script dll
Exports worked in 8965
Exports do not work in 8978, 8981

using System;
using System.Threading.Tasks;

using CitizenFX.Core;
using static CitizenFX.Core.Native.API;

namespace c_sharp
{
  public class C_Sharp : BaseScript
  {
    public static C_Sharp Self { get; private set; }

    public C_Sharp()
    {
      Self = this;
    }

    private void CSharp(string text)
    {
      Console.WriteLine($"c# {text}");
    }

    [EventHandler("onResourceStart")]
    private void OnResourceStart(string resourceName)
    {
      if (GetCurrentResourceName() == resourceName)
      {
        Exports.Add("csharp", (Action<string>)CSharp);
        Console.WriteLine("invoke c# export from c#");
        Exports["c_sharp"].csharp("from c#");
      }
    }
  }
}

Importancy

Crash

Area(s)

FXServer

Specific version(s)

Server 8978

Additional information

=================================================================
        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:
=================================================================
          at <unknown> <0xffffffff>
          at CitizenFX.Core.GameInterface:InvokeFunctionReference <0x000bc>
          at CitizenFX.Core.RemoteFunctionReference:_InvokeNative <0x000ba>
          at CitizenFX.Core.RemoteFunctionReference:InvokeNative <0x0004a>
          at <>c__DisplayClass36_0:<CreateRemoteFunctionReference>b__0 <0x00092>
          at <Module>:runtime_invoke_object__this___object <0x0013f>
          at <unknown> <0xffffffff>
          at System.Reflection.RuntimeMethodInfo:InternalInvoke <0x000a2>
          at System.Reflection.RuntimeMethodInfo:Invoke <0x00162>
          at System.Reflection.MethodBase:Invoke <0x0006b>
          at System.Delegate:DynamicInvokeImpl <0x00402>
          at System.MulticastDelegate:DynamicInvokeImpl <0x0006a>
          at System.Delegate:DynamicInvoke <0x0004b>
          at CitizenFX.Core.ExportDictionary:Invoke <0x0014a>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x0086a>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x000d2>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x002e2>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x001a0>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x00092>
          at CitizenFX.Core.MonoScriptRuntime:TriggerEvent <0x000a2>
          at CitizenFX.Core.IScriptEventRuntime:TriggerEvent <0x0008b>
          at CitizenFX.Core.IScriptEventRuntime:TriggerEvent <0x00132>
          at <unknown> <0xffffffff>
          at WrapScriptHost:InvokeNative <0x001f2>
          at WrapScriptHost:InvokeNative <0x00209>
          at CitizenFX.Core.ScriptContext:InvokeInternal <0x00084>
          at CitizenFX.Core.ScriptContext:InvokeInternal <0x000ea>
          at CitizenFX.Core.ScriptContext:Invoke <0x0004a>
          at CitizenFX.Core.Native.Function:InvokeInternal <0x000fa>
          at CitizenFX.Core.Native.Function:Call <0x00052>
          at CitizenFX.Core.BaseScript:TriggerEventInternal <0x00302>
          at CitizenFX.Core.BaseScript:TriggerEvent <0x00062>
          at CitizenFX.Core.ExportSet:TryInvokeMember <0x001f2>
          at System.Object:CallSite.Target <0x001f2>
          at System.Dynamic.UpdateDelegates:UpdateAndExecuteVoid2 <0x0081c>
          at com.twitchrp.log.C_Sharp:OnResourceStart <0x002da>
          at <Module>:runtime_invoke_void__this___object <0x00137>
          at <unknown> <0xffffffff>
          at System.Reflection.RuntimeMethodInfo:InternalInvoke <0x000a2>
          at System.Reflection.RuntimeMethodInfo:Invoke <0x00162>
          at System.Reflection.MethodBase:Invoke <0x0006b>
          at System.Delegate:DynamicInvokeImpl <0x00402>
          at System.MulticastDelegate:DynamicInvokeImpl <0x0006a>
          at System.Delegate:DynamicInvoke <0x0004b>
          at <Invoke>d__5:MoveNext <0x0026a>
          at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x000ea>
          at CitizenFX.Core.EventHandlerEntry:Invoke <0x001a2>
          at <Invoke>d__5:MoveNext <0x0018a>
          at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x00102>
          at CitizenFX.Core.EventHandlerDictionary:Invoke <0x001da>
          at <>c__DisplayClass38_2:<TriggerEvent>b__0 <0x0017a>
          at System.Threading.Tasks.Task`1:InnerInvoke <0x0009d>
          at System.Threading.Tasks.Task:Execute <0x0004b>
          at System.Threading.Tasks.Task:ExecutionContextCallback <0x0007a>
          at System.Threading.ExecutionContext:RunInternal <0x0023e>
          at System.Threading.ExecutionContext:Run <0x0005a>
          at System.Threading.Tasks.Task:ExecuteWithThreadLocal <0x0014a>
          at System.Threading.Tasks.Task:ExecuteEntry <0x0010a>
          at System.Threading.Tasks.TaskScheduler:TryExecuteTask <0x00072>
          at CitizenFX.Core.CitizenTaskScheduler:InvokeTryExecuteTask <0x0004a>
          at CitizenFX.Core.CitizenTaskScheduler:Tick <0x0053a>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x00892>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x000d2>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x002e2>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x001a0>
          at CitizenFX.Core.InternalManager:TriggerEvent <0x00092>
          at CitizenFX.Core.MonoScriptRuntime:TriggerEvent <0x000a2>
          at CitizenFX.Core.IScriptEventRuntime:TriggerEvent <0x0008b>
          at CitizenFX.Core.IScriptEventRuntime:TriggerEvent <0x00132>
=================================================================


================================================================
FXServer crashed.
A dump can be found at 8978\crashes\8f70a2a7-29dd-482a-8f42-71ecaf4774ef.dmp.
In addition to this, a full dump file has been generated at 8978\crashes\8f70a2a7-29dd-482a-8f42-71ecaf4774ef-full.dmp.

Crash report ID: 7891bbe8-5bc4-4810-8df8-d3ab10e1ff29
=================================================================
@isingrel isingrel added bug triage Needs a preliminary assessment to determine the urgency and required action labels Jul 19, 2024
@github-actions github-actions bot added the crash label Jul 19, 2024
@BGHDDevelopment
Copy link

I was able to reproduce this on 8978 and 8981 as well.

@FabianTerhorst
Copy link
Contributor

The fix will most likely be deployed on monday.

@Legacy-TacticalGamingInteractive

The fix will most likely be deployed on monday.

Awesome. It appears this is affecting FivePD as well

@7bananas77
Copy link

Have this been fixed? it still happen to me?

@blackfirefly000
Copy link

The fix will most likely be deployed on monday.

Do you know if this has been fixed? I just wanted to follow up given that it's been a while since this thread was active and the issue is still open

@DaniGP17
Copy link

Do you know if this has been fixed? I just wanted to follow up given that it's been a while since this thread was active and the issue is still open

Yes, this was already solved by the msgpack reverted

@FabianTerhorst
Copy link
Contributor

Closing this issue now, since its fixed since some time.

@github-actions github-actions bot removed the triage Needs a preliminary assessment to determine the urgency and required action label Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants