FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.74k stars 405 forks source link

Error while reading a message from the server (Index outside bounds of array) #3019

Closed thegrb93 closed 3 years ago

thegrb93 commented 4 years ago

Description This is a rare one that's been happening for the past many updates, but I haven't been sure how to report it since there's no way to reproduce it reliably. It happens in any gamemode in multiplayer but rarely, and it kicks every player off the server.

https://streamable.com/hisskp

image

Regalis11 commented 4 years ago

Added some more error logging to diagnose this: https://github.com/Regalis11/Barotrauma-development/commit/6207870c2af8c4405ed2c815d41a702da059a5ca

Now when this occurs, the game creates a log file called "crashreport_object.log" that contains some more data that might help us diagnose this.

thegrb93 commented 4 years ago

I'll upload that if it happens again.

Rokvach commented 4 years ago

No sightings on Unstable 1004 yet

Rokvach commented 4 years ago

I received this same error when rejoining a server yesterday, but it didn't generate a crashreport_object.log file. image.png

Rokvach commented 4 years ago

Here's another one, happened while JP tried to spectate a round

Index was outside the bounds of the array.
Message length: 7976 (997 bytes)
Read position: 7976
Header: ENTITY_EVENT_INITIAL
Error occurred on the very first header!
Previous object was 0 bits long (0 bytes)

   at Lidgren.Network.NetBitWriter.ReadByte(Byte[] fromBuffer, Int32 numberOfBits, Int32 readBitOffset) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\Lidgren.Network\NetBitWriter.cs:line 41
   at Lidgren.Network.NetBitWriter.ReadUInt16(Byte[] fromBuffer, Int32 numberOfBits, Int32 readBitOffset) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\Lidgren.Network\NetBitWriter.cs:line 229
   at Barotrauma.Networking.MsgReader.ReadUInt16(Byte[] buf, Int32& bitPos) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaShared\SharedSource\Networking\Primitives\Message\Message.cs:line 241
   at Barotrauma.Networking.ClientEntityEventManager.Read(ServerNetObject type, IReadMessage msg, Single sendingTime, List`1 entities) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Networking\NetEntityEvent\ClientEntityEventManager.cs:line 168
   at Barotrauma.Networking.GameClient.ReadIngameUpdate(IReadMessage inc) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Networking\GameClient.cs:line 2128

 - EntitySpawner
 - Stun Baton
 - EntitySpawner
 - EntitySpawner
 - EntitySpawner
 - EntitySpawner
 - Oxygen Tank
 - Diving Mask
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Barotrauma.Hull
 - Fuel Rod
 - SMG Magazine
 - EntitySpawner
 - EntitySpawner
 - Nuclear Reactor
 - Barotrauma.LevelObjectManager
 - Junction Box
 - Text Display
 - Docking Hatch
 - Light Component
 - Light Component
 - Light Component
 - Light Component
 - Light Component
 - Light Component
 - Light Component
 - Light Component
 - Light Component
 - Docking Hatch
 - Light Component
 - Light Component
 - Light Component
 - Emergency Light
 - Lamp
 - Lamp
 - Junction Box
 - Junction Box
 - Light Component
 - Junction Box
 - Status Monitor
 - Junction Box
 - Navigation Terminal
 - Navigation Terminal
 - Junction Box
 - Nuclear Reactor
 - Searchlight
 - Emergency Light
 - Emergency Light
 - Emergency Light
 - Emergency Light
 - Emergency Light
 - Coilgun
 - Text Display
 - Junction Box
 - Emergency Light
 - Emergency Light
 - Emergency Light
 - Emergency Light
 - Coilgun
 - Emergency Light
 - Lamp
 - Lamp
 - Lamp
 - Lamp
 - Lamp
 - Lamp
 - Emergency Light
 - Lamp
 - Text Display
 - Lamp
 - Emergency Light
 - Junction Box
 - Junction Box
 - Junction Box
 - Junction Box
 - Artifact Holder
 - Alien Light Component
 - Alien Light Component
 - Alien Power Cell
 - Black Wire
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Junction Box
 - Text Display
 - Lamp
 - Lamp
 - Vending Machine
 - Vending Machine
 - Junction Box
 - Lamp
 - Lamp
 - Junction Box
 - Lamp
 - Lamp
 - Outpost Terminal
 - Outpost Terminal
 - Text Display
 - Lightbox
 - Emergency Light
 - Light Component
 - Light Component
 - Coilgun (Wrecked)
 - Lamp (Wrecked)
 - Diving Suit
 - Diving Suit
 - Alien Power Cell
 - Alien Power Cell
 - Alien Light Component
 - Alien Light Component
 - Barotrauma.LevelObjectManager
 - Barotrauma.LevelObjectManager
 - Barotrauma.LevelObjectManager
 - Barotrauma.LevelObjectManager
 - Barotrauma.LevelObjectManager
 - Barotrauma.LevelObjectManager
 - Lamp (Wrecked)
 - Barotrauma.LevelObjectManager
 - Barotrauma.LevelObjectManager
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Alien Light Component
 - Barotrauma.LevelObjectManager
 - Artifact Holder
 - EntitySpawner
 - EntitySpawner
 - NULL
 - NULL
Last console messages:
[09/07/2020 1:42:59 PM] Task count: 0
[09/07/2020 1:42:56 PM] Generating an outpost for the end of the level... (Location: Huronia Station, level type: LocationConnection)
[09/07/2020 1:42:29 PM] Content package load order: Vanilla 0.9  |  Atolla  |  Bottleneck 2.1  |  Cityscape - Salthane  |  Defiant D_1.45  |  Malaco_1.068  |  Ocean Glider Mark III  |  Vengeful_Spirit_Mk_3  |  [BP] Smart Systems Pack
[09/07/2020 1:41:37 PM] (Msg) RelayNetWorkStatus:  avail=OK  config=OK  anyrelay=OK   (OK)
[09/07/2020 1:41:37 PM] (Msg) Ping location: atl=73+7,iad=148+14/86+7,ord=168+16/92+7,okc=155+15/100+7,sea=168+16/137+7,eat=182+18/137+7,lax=155+15/138+7,lim=161+16,par=194+19/163+7,fra=242+24/173+7,gru=282+28/204+7,sgp=330+33/321+7
[09/07/2020 1:41:37 PM] (Msg) Ping measurement completed
[09/07/2020 1:41:37 PM] (Warning) SteamNetworkingSockets lock held for 7.9ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 15.4ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 7.8ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 15.9ms.  (Performance warning).  ServiceThread,SendUDPacket(x4)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 8.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 14.9ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 12.0ms.  (Performance warning).  ServiceThread,SendUDPacket(x3)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 14.2ms.  (Performance warning).  ServiceThread,SendUDPacket(x4)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 27.8ms.  (Performance warning).  ServiceThread,RecvUDPPacket,SendUDPacket(x3)
[09/07/2020 1:41:36 PM] (Warning) SteamNetworkingSockets lock held for 86.4ms.  (Performance warning).  ServiceThread,SendUDPacket(x7)
[09/07/2020 1:41:35 PM] (Warning) SteamNetworkingSockets lock held for 114.0ms.  (Performance warning).  ServiceThread,SendUDPacket(x8)
[09/07/2020 1:41:35 PM] (Warning) SteamNetworkingSockets lock held for 166.8ms.  (Performance warning).  ServiceThread,RecvUDPPacket,SendUDPacket(x13)
[09/07/2020 1:41:35 PM] (Warning) SteamNetworkingSockets lock held for 120.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
Ruzihm commented 4 years ago

I just got this bug while playing online as a client. As far as I can recall the server was unmodded, although a custom submarine was used.

Same stack trace and error message - on v0.9.10.0 (ReleaseWindows, branch release, revision 2876b0a66).

I can't find the mentioned crashreport_object.log

thegrb93 commented 4 years ago

image

crashreport_object.log

Coryf88 commented 4 years ago

v0.10.4.0 crashreport_object.log

Regalis11 commented 4 years ago

Potentially fixed alongside #3680, moving to QA backlog.

Kaillera commented 4 years ago

Randomly got this when one of my crew took or replaced a welding tank out of his toolbox in 0.10.505

https://www.twitch.tv/videos/740120162?t=03h12m17s

Failed to read event for entity "Toolbox"! {Index was outside the bounds of the array.} at Lidgren.Network.NetBitWriter.ReadByte(Byte[] fromBuffer, Int32 numberOfBits, Int32 readBitOffset) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\Lidgren.Network\NetBitWriter.cs:line 41 at Lidgren.Network.NetBitWriter.ReadUInt16(Byte[] fromBuffer, Int32 numberOfBits, Int32 readBitOffset) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\Lidgren.Network\NetBitWriter.cs:line 229 at Barotrauma.Networking.MsgReader.ReadUInt16(Byte[] buf, Int32& bitPos) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaShared\SharedSource\Networking\Primitives\Message\Message.cs:line 239 at Barotrauma.Networking.ReadOnlyMessage.ReadUInt16() in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaShared\SharedSource\Networking\Primitives\Message\Message.cs:line 658 at Barotrauma.Inventory.ClientRead(ServerNetObject type, IReadMessage msg, Single sendingTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Items\Inventory.cs:line 1424 at Barotrauma.Item.ClientRead(ServerNetObject type, IReadMessage msg, Single sendingTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Items\Item.cs:line 1093 at Barotrauma.Networking.ClientEntityEventManager.ReadEvent(IReadMessage buffer, IServerSerializable entity, Single sendingTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Networking\NetEntityEvent\ClientEntityEventManager.cs:line 287 at Barotrauma.Networking.ClientEntityEventManager.Read(ServerNetObject type, IReadMessage msg, Single sendingTime, List`1 entities) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Networking\NetEntityEvent\ClientEntityEventManager.cs:line 238

ekqvist commented 4 years ago

Reported by a user on v0.10.5.1: crashreport_object.log

Coryf88 commented 4 years ago

v0.10.5.1 crashreport_object.log

grafol commented 4 years ago

Friends and I have been getting Out of Bounds Errors a handful of times in our current campaign playthrough.

This evening, it happened twice within an hour or two. Unsure how to reproduce, but it seems to happen mostly when we're in combat. When it happens, the game freezes briefly, for maybe 2-3 seconds, before all players - except for the server host (which isn't me) - are kicked to the main menu with the console showing the error. The session never stops for the host, so we all rejoin.

Index was outside the bounds of the array.
Message length: 2004 (250 bytes)
Read position: 2004
Header: ENTITY_POSITION
Previous header: ENTITY_POSITION
Previous object was 128 bits long (16 bytes)

   at Lidgren.Network.NetBitWriter.ReadBytes(Byte[] fromBuffer, Int32 numberOfBytes, Int32 readBitOffset, Byte[] destination, Int32 destinationByteOffset) in C:\Users\Joonas\Documents\Barotrauma-development\Libraries\Lidgren.Network\NetBitWriter.cs:line 72
   at Barotrauma.Networking.MsgReader.ReadBytes(Byte[] buf, Int32& bitPos, Int32 numberOfBytes) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaShared\SharedSource\Networking\Primitives\Message\Message.cs:line 371
   at Barotrauma.Networking.MsgReader.ReadSingle(Byte[] buf, Int32& bitPos) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaShared\SharedSource\Networking\Primitives\Message\Message.cs:line 286
   at Barotrauma.Character.ClientRead(ServerNetObject type, IReadMessage msg, Single sendingTime) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Characters\CharacterNetworking.cs:line 246
   at Barotrauma.Networking.GameClient.ReadIngameUpdate(IReadMessage inc) in C:\Users\Joonas\Documents\Barotrauma-development\Barotrauma\BarotraumaClient\ClientSource\Networking\GameClient.cs:line 2149

I've included the crashreport_object.log and the server logs immediate prior and after the crash:

Coryf88 commented 3 years ago

v0.11.0.9 crashreport_object.log crashreport_object.log

Leptidea commented 3 years ago

V0.11.0.10 crashreport_object.log Usually after couple hours of gameplay the crash occurs and usually there is a lot of stuff going on at that moment. Usually it can be predicted early when the game turns a bit laggy.

Leptidea commented 3 years ago

Here is couple reports more.

crashreport_object2.log crashreport_object1.log

cookins commented 3 years ago

moderator, or not sure who - told me to post here my crashlog. if any other files required - tell me. crashreport_object.log