nwnxee / unified

Binaries available under the Releases tab on Github
https://nwnxee.github.io/unified
GNU General Public License v3.0
128 stars 91 forks source link

Segmentation fault related to AI / Henchman #1688

Open b5635 opened 12 months ago

b5635 commented 12 months ago
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  | ==============================================================
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |  NWNX 8193.35-40 (b419e42) has crashed. Fatal error: Segmentation fault (11).
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |  Please file a bug at https://github.com/nwnxee/unified/issues
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  | ==============================================================
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  | 
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |   Backtrace:
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     /nwn/nwnx/NWNX_Core.so(_ZN7NWNXLib8Platform13GetStackTraceB5cxx11Eh+0x3b) [0x7faa573d3b6b]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     /nwn/nwnx/NWNX_Core.so(nwnx_signal_handler+0xac) [0x7faa57383b7c]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     /lib/x86_64-linux-gnu/libc.so.6(+0x3bf90) [0x7faa56e81f90]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_ZN12CNWSCreature21ResolveSafeProjectileEji+0xba) [0x55c1c82295ca]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_ZN12CNWSCreature18SignalRangedDamageEP10CNWSObjecti+0x15f) [0x55c1c822cb3f]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_ZN12CNWSCreature20AIActionAttackObjectEP20CNWSObjectActionNode+0x5af) [0x55c1c8238f6f]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_ZN10CNWSObject10RunActionsEjjm+0xafe) [0x55c1c82c43fe]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_ZN12CNWSCreature8AIUpdateEv+0x15e) [0x55c1c820334e]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_ZN15CServerAIMaster11UpdateStateEv+0x54c) [0x55c1c831e53c]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_ZN21CServerExoAppInternal8MainLoopEv+0x7dc) [0x55c1c833385c]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     /nwn/nwnx//NWNX_Tracking.so(_ZN8Tracking8Activity14MainLoopUpdateEP21CServerExoAppInternal+0x44) [0x7faa50c10454]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(main+0x13a5) [0x55c1c809d535]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     /lib/x86_64-linux-gnu/libc.so.6(+0x2718a) [0x7faa56e6d18a]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7faa56e6d245]
2023-07-26 02:25:34 the-frozen-north-tfn-server-dev-1  |     ./nwserver(_start+0x2a) [0x55c1c80a188a]

To reproduce:

You can run this via Docker using a batch script on Windows or on Linux. You should be able to run it natively too, just make sure you use the env variables. To reproduce:

  1. Create character.
  2. Log-in as DM. Console command dm_login tfndev
  3. Level up to 12.
  4. Teleport to the Trade of Blades, grab Tomi, Linu, Sharwyn, and Daelan. You might need persuade to do that.
  5. Teleport to any place in the Underdark. This is where I have been able to consistently crash.

EDIT: Just did some further testing and it's not related to being logged in as a DM, either. I teleported to Lith My'athar, did not crash at all. Logged out from being player DM. As soon as the henchman engages in combat, the crash happens

EDIT 2: Upon further testing I've isolated it to Tomi. It seems to happen when he attacks with a bow while stealthed. I do have a 2da tweak to allow running while stealthed.

EDIT 3: This is related to item properties. What happens is that Tomi is given a bow with unlimited ammo, then the infinite ammo property is upgraded (replaced in the script). When this happens his ammo disappears, and the server goes kaput when he attempts to fire without any ammo.

Is this still considered a bug? Maybe something to attempt to re-produce to see if it is an issue in the base game. Feel free to close if you guys feel like this is more user error than a bug.

New folder.zip