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

FATAL:Segmentation fault && FATAL:Server Unstable #208

Open
Khaldor48 opened this issue Nov 5, 2019 · 15 comments
Open

FATAL:Segmentation fault && FATAL:Server Unstable #208

Khaldor48 opened this issue Nov 5, 2019 · 15 comments

Comments

@Khaldor48
Copy link

Hello, I get this error everytime I get some type of vendor in my visual range view and the server is immediately shutted down and log says this:

13:26:FATAL:Segmentation fault
13:26:DEBUG:__ thread (4148263744) __ |  # | _____________ function _____________ | __ ticks passed from previous function start __
13:26:DEBUG:>>         4148263744     |  0 |                        CChar::OnTick | +0 
13:26:DEBUG:>>         4148263744     |  1 |              CChar::NPC_OnTickAction | +0 
13:26:DEBUG:>>         4148263744     |  2 |                CChar::NPC_Act_GoHome | +0 
13:26:DEBUG:>>         4148263744     |  3 |               CChar::NPC_WalkToPoint | +0 
13:26:DEBUG:>>         4148263744     |  4 |               CChar::NPC_Pathfinding | +0 
13:26:DEBUG:>>         4148263744     |  5 |                CPathFinder::ReadStep | +19 <-- exception catch point (below is guessed and could be incorrect!)
13:26:FATAL:Server Unstable: Aborted
13:26:FATAL:Server Unstable: Aborted
13:26:FATAL:Server Unstable: Aborted
13:26:FATAL:Server Unstable: Aborted
13:26:FATAL:Server Unstable: Aborted
13:26:FATAL:Server Unstable: Aborted
@Khaldor48
Copy link
Author

Khaldor48 commented Nov 5, 2019

Also this appeared and shutted down server when I was walking different path with different vendors

13:36:FATAL:Segmentation fault
13:36:DEBUG:__ thread (4148448064) __ |  # | _____________ function _____________ | __ ticks passed from previous function start __
13:36:DEBUG:>>         4148448064     |  0 |                        CChar::OnTick | +0 
13:36:DEBUG:>>         4148448064     |  1 |              CChar::NPC_OnTickAction | +0 <-- exception catch point (below is guessed and could be incorrect!)
13:36:DEBUG:>>         4148448064     |  2 |                        CGFile::Close | +72 
13:36:DEBUG:>>         4148448064     |  3 |                 CFileText::CloseBase | +0 

And also this. I am pasting it here because it has different ReadStep number

13:35:FATAL:Segmentation fault
13:35:DEBUG:__ thread (4147768128) __ |  # | _____________ function _____________ | __ ticks passed from previous function start __
13:35:DEBUG:>>         4147768128     |  0 |                        CChar::OnTick | +0 
13:35:DEBUG:>>         4147768128     |  1 |              CChar::NPC_OnTickAction | +0 
13:35:DEBUG:>>         4147768128     |  2 |                CChar::NPC_Act_GoHome | +0 
13:35:DEBUG:>>         4147768128     |  3 |               CChar::NPC_WalkToPoint | +0 
13:35:DEBUG:>>         4147768128     |  4 |               CChar::NPC_Pathfinding | +0 
13:35:DEBUG:>>         4147768128     |  5 |                CPathFinder::ReadStep | +24 <-- exception catch point (below is guessed and could be incorrect!)

I hope this will help you identify what's going wrong :( Thank you in advance.

@Khaldor48
Copy link
Author

And now it happened even when I was fighting zombies far away from any vendor. So maybe it's not related to vendors.

In practice first appears Segmentation failed with ReadStep (+24) and then like 200x line with Server Unstable: Aborted

@Khaldor48
Copy link
Author

Hi,
I have update to this issue.

My NPCAI setting in sphere.ini was NPCAI=0001|0004|0008|0400

And when I set NPCAI=0 this error stops from happening. But NPC cannot find path properly anymore :)

@Khaldor48
Copy link
Author

23:49:FATAL:Segmentation fault
23:49:DEBUG:__ thread (4147538752) __ |  # | _____________ function _____________ | __ ticks passed from previous function start __
23:49:DEBUG:>>         4147538752     |  0 |                        CChar::OnTick | +0 
23:49:DEBUG:>>         4147538752     |  1 |              CChar::NPC_OnTickAction | +0 
23:49:DEBUG:>>         4147538752     |  2 |                CChar::NPC_Act_GoHome | +0 
23:49:DEBUG:>>         4147538752     |  3 |               CChar::NPC_WalkToPoint | +0 
23:49:DEBUG:>>         4147538752     |  4 |               CChar::NPC_Pathfinding | +0 
23:49:DEBUG:>>         4147538752     |  5 |                CPathFinder::FindPath | +30 <-- exception catch point (below is guessed and could be incorrect!)
23:49:DEBUG:>>         4147538752     |  6 |          CPathFinderPoint::SetParent | +43 

Still happening when I set NPCAI to this value NPCAI=0001|0004|0008|0400
Can you please check on linux build ? Respawn a few NPCs and wait if it occurs.

@coruja747
Copy link
Collaborator

Does it still happening on latest build?

@Khaldor48
Copy link
Author

I will check ASAP and report here. Thank you for effort :-)

@Khaldor48
Copy link
Author

Hello,
so now when I set NPCAI it is stable and it doesn't drop whole console. Great!

But it looks like NPCAI does not improving npcs now.
The behaviour of NPCs are same with value NPCAI=0 or with value NPCAI=0001|0004|0008|0400

@Khaldor48
Copy link
Author

NPCAI=0001|0004|0008|0400
Today with those NPCAI settings if I try to buy from vendor got this error and sphere froze.

corrupted size vs. prev_size
23:10:FATAL:(sphere_item_magic_armor.scp,88)Server Unstable: Aborted

The line of sphere_item_magic_armor.scp;88 is just regular shield, which can be added and used with no problem..

[ITEMDEF i_buckler_shield_guarding]
ID=i_shield_buckler
NAME=Buckler Shield of Guarding

CATEGORY=Provisions - Armor - Magic
SUBSECTION=Shields
DESCRIPTION=Buckler Shield of Guarding


ON=@Create
	ARMOR=<def0.armor.i_buckler_shield_guarding.ar>
	MOREY=40.0
	ATTR=attr_magic
	HITPOINTS={100 125}
	COLOR=color_magic_guarding

@coruja747
Copy link
Collaborator

Probably it should be something related to NPC pathfind. But I'm testing here on a clean sphere with default script pack using NPCAI=0001|0004|0008|0400 and everything seems to be working fine

Some days ago I optimized the whole NPC pathfind code, so try update to latest build. If it still happening on latest build, try testing each NPCAI flag individually to find what flag is causing the error, like this:

NPCAI=0001
NPCAI=0004
NPCAI=0008|0001   <-- NPC_AI_ALWAYSINT (08) only works when NPC_AI_PATH (01) is enabled
NPCAI=0400

@Khaldor48
Copy link
Author

Ok, thank you. I'll try.

NPC pathfinding is not as good as it used to be before the optimalization. Now when I enable the best possible pathfinding NPCAI, then NPC won't find path to get around an obstacle.

There weren't sphere drops or freezeouts before the optimalization and every NPC could find the way as needed almost perfectly and in matter of few seconds.

Now NPCs are "dumber".

@Khaldor48
Copy link
Author

Khaldor48 commented Jan 9, 2020

Today I got this new error

malloc_consolidate(): invalid chunk size
20:14:FATAL:(sphere_item_magic_armor.scp,120)Server Unstable: Aborted

Happens after I say "buy" to a vendor

@Khaldor48
Copy link
Author

Now I got this error, even with NPCAI=0
So it may be not linked with this settings

corrupted size vs. prev_size
13:40:FATAL:(sphere_item_magic_armor.scp,120)Server Unstable: Aborted

@coruja747
Copy link
Collaborator

Try using latest build to check if it's working fine

@Khaldor48
Copy link
Author

So far so good, it looks stable now. But NPC pathfinding doesn't work as well as before few months. They used to walk past wall and find the right path even among big obstacles (like stone long stone wall). Now they just stand there and doing nothing. This may be somehow related to this issue. Thank you for your work. Great :-)

@coruja747
Copy link
Collaborator

Thanks, you're also doing a great work 😄
Do you have NPC_AI_PATH enabled? This enable the NPC pathfind, but with this flag disabled the NPC will just walk in a "linear" direction, so make sure that its enabled. Also make sure that NPC_AI_PERSISTENTPATH is enabled to make NPC keep trying to reach its target instead give up

If it still not working correctly, try using these builds below to check which one the pathfind is working fine. Finding the build number will make things easier to port the working code to the current build

NOTE: these builds are 32bit only, so if you're currently using a 64bit build, you must also replace your libmysql.dll file with the 32bit version included on zip (or if you're using linux you must change the lib "libmysqlclient-dev" to "libmysqlclient-dev:i386")

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

2 participants