Linux Segmentation fault

Ysupport

New Member
Joined
Mar 12, 2017
Messages
3
Best answers
0
Reaction score
0
Hello my TFS 0.3.6 with clien 8.60 got crashed last night, and the only error i saw in my console was

"segmentation fault"

How can i find out why it crashes and i would be happy if someone helps me out to fix this crashes ;/


Kind regards,
 

Don Daniello

/root
Staff member
Administrator
Joined
Apr 11, 2008
Messages
3,506
Best answers
15
Reaction score
895
Location
Proland
You can try debugging that with gdb but 0.3.6 is quite old and the number of fixes to be made may be large.
 
OP
Y

Ysupport

New Member
Joined
Mar 12, 2017
Messages
3
Best answers
0
Reaction score
0
But its also not easy to update the tfs version to new one with all scripts still work, or u goes it will be the easier way to fix this ?
And how do i do the debuggin with gdb..?
 
Last edited:

WibbenZ

Global Moderator
Staff member
Global Moderator
Joined
Oct 16, 2008
Messages
6,196
Best answers
224
Reaction score
1,134
Location
Sweden
But its also not easy to update the tfs version to new one with all scripts still work, or u goes it will be the easier way to fix this ?
And how do i do the debuggin with gdb..?
You will have to put in some work sure, but start fresh with a clean 1.2/1.3 datapack.
Add your map, add your custom scripts and then check everything, you might have to tweak formulas of spells, add functions from your lib folder etc etc
But compat.lua (forgottenserver/compat.lua at master · otland/forgottenserver · GitHub) does most of the work for you.

You should how ever aim to remove compat.lua by converting all the scripts.

And BTW if you were to do this or start on another server etc ALWAYS create a new directory ex data/actions/scripts/custom and add your files in there, don't use the default paths, leave them alone.
This will make it a billion times easier when converting your server to another server.
 

Wirox

Member
Joined
Sep 3, 2016
Messages
76
Best answers
1
Reaction score
18
I'll just add that segmentation fault means you're trying to access some part of memory you do not have access to.

So, for example, if you declared an array:
C++:
int32_t stats[STAT_LAST] = { 0 };
which would create stats[0], stats[1], (...), stats[STAT_LAST-1] and then tried to access stats[STAT_LAST], which hasn't been declared, you would get a segmentation fault.
 
Top