Currently the developers are putting their own money into JC2-MP to keep the servers online.

Please take a few seconds of your time and disable your AdBlock plugin for our website.

Ad revenue is not going to developers, it is used purely for covering our hosting costs.

 

You are also free to donate, which removes all ads from our website!

Patch 0.3 was just released! Full changelog here: https://t.co/4A50m6IKen

4 years ago

Advertisement
November 30, 2020, 11:43:10 pm

Author Topic: Rare clientside "no RTTI data" or "bad_weak_ptr" errors  (Read 93 times)

DaAlpha

  • Donator
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Rare clientside "no RTTI data" or "bad_weak_ptr" errors
« on: November 08, 2020, 08:31:30 pm »
On rare occasions, some clients run into access violation errors. I have yet to experience this myself, nor have I managed to figure out a pattern. I know this is very thin grounds to start investigating but I think it's still worth reporting. Maybe someone else has experienced this issue before and can provide more info.

One possible explanation I could imagine is that people are tampering with their game using Cheat Engine for example. But the question remains why it is almost always related to vehicle occupants.

Example 1

Calling Vehicle.GetOccupants on a Vehicle object obtained from a Physics:Raycast (inside a PostTick event)

Code: [Select]
Exception: Access violation - no RTTI data!
  Callstack:
    API function: in upvalue GetOccupants
    client/cHitsync.lua:435: in method CalculateBullet
    client/cHitsync.lua:310: in method InVehicleLoop
    client/cHitsync.lua:158: in function <client/cHitsync.lua:127>

Example 2

Calling IsValid on an object retrieved from Vehicle.GetDriver inside a Render or PostRender event

Code: [Select]
Exception: Access violation - no RTTI data!
  Callstack:
    API function: in global IsValid
    client/cNametags.lua:42: in upvalue func
    ../../lua/autorun/client/cRender.lua:45: in function <../../lua/autorun/client/cRender.lua:42>

Example 3

Inside EntitySpawn:

Code: Lua
  1.   elseif args.entity.__type == "Player" then
  2.     local vehicle = args.entity:GetVehicle()
  3.     if IsValid(vehicle) then
  4.       local driver = vehicle:GetDriver()
  5.       if args.entity == driver then
  6.  

Code: [Select]
Exception: Access violation - no RTTI data!
  Callstack:
    API function: in metamethod __eq
    client/cSeatLocker.lua:68: in function <client/cSeatLocker.lua:61>

Example 4

Calling Vehicle.GetDriver on a vehicle copied (using Copy(), honestly not sure why) from an entity obtained from a Physics:Raycast inside a Render event

Code: [Select]
Exception: Access violation - no RTTI data!
  Callstack:
    API function: in method GetDriver
    client/cCrosshair.lua:198: in upvalue func
    ../../lua/autorun/client/cRender.lua:45: in function <../../lua/autorun/client/cRender.lua:42>
  state: 4
  delta: 0.0057504908181727

Example 5

Calling Vehicle.GetDriver on a vehicle obtained via Player.GetVehicle on a player object obtained from Client:GetStreamedPlayers() inside a Render event

Code: [Select]
Exception: bad_weak_ptr
  Callstack:
    API function: in upvalue GetDriver
    client/cNametags.lua:227: in upvalue func
    ../../lua/autorun/client/cRender.lua:49: in function <../../lua/autorun/client/cRender.lua:46>
  Arguments:
    state: 4
    delta: 0.042030334472656

Example 6

Same context as example 3, one line earlier

Code: [Select]
2020-06-25 21:34:34 UTC+2 | Clientside error occurred in module seatlocker:
Player: STEAM_0:1:64387760 <Mauman> from Czech Republic
Exception: bad_weak_ptr
  Callstack:
    API function: in method GetDriver
    client/cSeatLocker.lua:67: in function <client/cSeatLocker.lua:61>
  Arguments:
    entity: yagsef12345