Giter Site home page Giter Site logo

AltAsync.OnScriptRpc throws weird IO exception when either client emits with parameters or server try to answer about coreclr-module HOT 8 CLOSED

duydang2311 avatar duydang2311 commented on June 21, 2024
AltAsync.OnScriptRpc throws weird IO exception when either client emits with parameters or server try to answer

from coreclr-module.

Comments (8)

FabianTerhorst avatar FabianTerhorst commented on June 21, 2024 1

already suggested a change. Better wait before its implemented.

from coreclr-module.

Doxoh avatar Doxoh commented on June 21, 2024

@duydang2311 can u check it please with dev version 15.0.202-dev

from coreclr-module.

duydang2311 avatar duydang2311 commented on June 21, 2024

There are some issues with the new version, seems like I won't be able to quickly check this.

I just updated the module and nuget. Now the same warning appears after resource is started and the server exits after segmentation fault. I don't load any resources at all.

[19:55:25] alt:V Server 15.0-dev912 (dev)
[19:55:25] Starting Dev Server on [::]:7788
[19:55:25] Required server permissions:
[19:55:25] Optional server permissions:
[19:55:25] Starting HTTP server on [::]:7788
[17760:17760:20231130,195525.919295:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[17760:17760:20231130,195525.919380:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
[19:55:25] Main thread started (ThreadId: 17750)
[19:55:25] EntityStreamer thread started (ThreadId: 17785)
[19:55:25] SyncSend thread started (ThreadId: 17787)
[19:55:25] SyncSend thread started (ThreadId: 17788)
[1]    17750 segmentation fault (core dumped)  ./altv-server

Version:

  • Server: 15.0-dev912
  • Nuget: 15.0.202-dev

from coreclr-module.

kyro95 avatar kyro95 commented on June 21, 2024

@duydang2311 can u check it please with dev version 15.0.202-dev

public class FactionWritable : IWritable
   {
       public string Id { get; set; }
       public string Leader { get; set; }
       public string Name { get; set; }
       public string Acronym { get; set; }
       public ushort Type { get; set; }
       public string Color { get; set; }
       public string Description { get; set; }
   
       public void OnWrite(IMValueWriter writer)
       {
           try
           {
               writer.BeginObject();
               writer.Name("Id");
               writer.Value(Id);
               writer.Name("Name");
               writer.Value(Name);
               writer.Name("Acronym");
               writer.Value(Acronym);
               writer.Name("Type");
               writer.Value(Type);
               writer.Name("Color");
               writer.Value(Color);
               writer.Name("Description");
               writer.Value(Description);
               writer.Name("Leader");
               writer.Value(Leader);
               writer.EndObject();
           } catch (Exception e)
           {
               Console.WriteLine(e);
           }
       }
   }

  private async Task OnScriptRpc(IScriptRPCEvent @event, IPlayer target, string name, object[] args, ushort answerId)
   {
       /*var factionCollection = await _databaseService.Database
           .GetCollection<Faction>("factions")
           .FindAsync(faction => faction.Id == ObjectId.Parse("657adcabfe0bdd5e055d9f68"));
           
       var faction = await factionCollection.FirstOrDefaultAsync();
           
       if (faction is null)
           return;
       */
       FactionWritable factionWritable = new()
       {
           Id = "faction.Id.ToString()",
           Name = "faction.Name",
           Acronym = "faction.Acronym",
           Type = 1,
           Color = "faction.Color",
           Description = "faction.Description",
           Leader = "faction.Leader.ToString()"
       };
       
       @event.Answer(factionWritable);
       
       Alt.LogInfo("Send faction writable");
   }
[16:35:09] Execution of AltV.Net.Async.Events.ScriptRpcAsyncDelegate threw an error: System.Runtime.InteropServices.SEHException (0x80004005): External component has thrown an exce
ption.
   at AltV.Net.Async.AsyncScriptRpcEvent.Answer(Object answer)
   at Armonia.Server.Event.FactionEvent.OnScriptRpc(IScriptRPCEvent event, IPlayer target, String name, Object[] args, UInt16 answerId) in C:\Users\ruben\Desktop\armonia-roleplay\a
rmonia-gamemode\Armonia.Server\src\Event\FactionEvent.cs:line 69
   at AltV.Net.Async.AsyncEventHandler`1.ExecuteEventAsync(TEvent subscription, Func`2 callback)

tested on alt:V Server 15.0-dev969 (dev)

also, when awaiting my query (without mock) it doesn't crash but doesn't emit the answer as well

from coreclr-module.

Doxoh avatar Doxoh commented on June 21, 2024

pls try it with nuget 15.0.205-dev

from coreclr-module.

kyro95 avatar kyro95 commented on June 21, 2024

fixed with dev 15.0.207

from coreclr-module.

Doxoh avatar Doxoh commented on June 21, 2024

also fixed with all 16.0.* versions

from coreclr-module.

duydang2311 avatar duydang2311 commented on June 21, 2024

Well, I just tried this out with 16.0.7-dev and same issue still unfortunately.
The behaviour this time is a bit different, it crashes without needing to call Answer, as you see the empty event handler below.

AltAsync.OnScriptRpc += (e, player, name, args, answerId) =>
{
    return Task.CompletedTask;
};
[17119:17119:20231226,144834.100949:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[17119:17119:20231226,144834.101032:ERROR file_io_posix.cc:144] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)

Specifications:

  • Server: 16.0-dev16.
  • Nuget: 16.0.7-dev.
  • OS: Arch Linux.
  • .NET 8.

from coreclr-module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.