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

SetVehicleDoorsLocked (RPC) native sometimes crashes client. #2190

Closed
Csucsiii opened this issue Sep 6, 2023 · 6 comments
Closed

SetVehicleDoorsLocked (RPC) native sometimes crashes client. #2190

Csucsiii opened this issue Sep 6, 2023 · 6 comments

Comments

@Csucsiii
Copy link

Csucsiii commented Sep 6, 2023

We are using SetVehicleDoorsLocked native at server-side to lock all population vehicle when they are spawned and triggered the entityCreated event. Not all the clients are crashing at same time, everyone crashes different time.

We are checking that entity has already an owner before calling this native, we have built a workaround this native but it uses way too much event triggering to client, that is what we want to optimalize. (Triggering the entity owner to lock the vehicle's doors.)

What we use:
- Server Linux Artifact: 6645
- GameBuild: 2802 (we used older versions as well.)
- Tried released and canary version as well
- Lua 5.4

GTA5_b2802.exe!sub_14162E6FC (0x23)
GTA5_b2802.exe!_getScriptGuidForEntity (0x22)
@Csucsiii Csucsiii changed the title SetVehicleDoorsLocked sometimes crashes client. SetVehicleDoorsLocked (RPC) native sometimes crashes client. Sep 6, 2023
@AvarianKnight
Copy link
Contributor

Can you post a crash dump for this?

@Csucsiii
Copy link
Author

Csucsiii commented Sep 6, 2023

Yes, I can, I am not sure this native caused all of them, because I don't know which Editor can open dmp files.
These crashes came after we modified our script to use this native.

crashes.zip

@AvarianKnight
Copy link
Contributor

None of these seem to be related

@gottfriedleibniz
Copy link
Contributor

These crashes came after we modified our script to use this native.

Was this the only change? If so, the implications seem a bit gross. Would you happen to have any other dumps? Preferably ones that include the functions from your original message (i.e., sub_14162E6FC/_getScriptGuidForEntity).

... uses way too much event triggering to client, that is what we want to optimalize.

The CAR_GENERATOR bits (e.g., CCarGen flags, script vehicle generators, undocumented global variables) offer finer control over default lock state. Having VEHICLE_POPULATION offer something similar (e.g., associating a probability w/ vehicle type or whatever) seems like a reasonable feature request.

@niekschoemaker
Copy link
Contributor

niekschoemaker commented Oct 13, 2023

I personally don't have problems with this native (used it for a while, but not at the moment) and don't recall ever seeing a crash like this (have metrics to keep track of all crashes)

But I don't use this native on population vehicles, so non script entities, and only on script entities, so that is probably the reason for it.

I'm wondering if checking if GetEntityScript exists on the server side before calling the native could work to "resolve (avoid)" the crash, since it appears to be due to the script Guid, since the rpc natives request the script guid from an entity.

But as said above, a crash dump would probably easily prove this point, since the stack trace would include the code from fivem calling the getScriptGuidFromEntity in the rpc natives.

@gottfriedleibniz
Copy link
Contributor

This issue has not been updated in a while. Were any more dumps related to this collected?

@Csucsiii Csucsiii closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants