Jump to content
  • 0

Crash Map Server


Haku

Question


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   2
  • Joined:  12/04/13
  • Last Seen:  

Error in GDB:

 

0bb2mcb.png

 

 

Line 13015 status.c with **:

13008: case SC_VACUUM_EXTREME:
13009: if (sce->val4) {
13010: if (unit_movepos(bl, sce->val3>>16, sce->val3&0xFFFF, 0, false)) {
13011: clif_slide(bl, sce->val3>>16, sce->val3&0xFFFF);
13012: clif_fixpos(bl);
13013: }
13014: sc_timer_next(tick+sce->val4, status_change_timer, bl->id, data);
**13015:  sce->val4 = 0;
13016: }
13017: break;
13018: }

Line 369 timer.c with **:

363: if( timer_data[tid].func )
364: {
365: if( diff < -1000 )
366: // timer was delayed for more than 1 second, use current tick instead
367: timer_data[tid].func(tid, tick, timer_data[tid].id, timer_data[tid].data);
368: else
**369: timer_data[tid].func(tid, timer_data[tid].tick, timer_data[tid].id, timer_data[tid].data);
370: }

Line 367 core.c with **:

365: // Main runtime cycle
366: while (runflag != CORE_ST_STOP) { 
**367: int next = do_timer(gettick_nocache());
368: do_sockets(next);
369: }

Help me please!

Edited by Haku
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   1
  • Joined:  06/09/16
  • Last Seen:  

inside function "status_change_timer", the sd = 0x0 , this cause ur map server crash.

just add a code to check if sd is NULL, then return 0;

 

i don't have ur status.c file, so i can just roughly guide,

 

in function "status_change_timer", find a line "sd = BL_CAST(BL_PC, bl);"

then add the following code after it:

if(sd == NULL)

            return 0;

 

 

 

edit: remember recompile it

Edited by JJTE
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

Don't do that, it will break monster statuses as well.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   1
  • Joined:  06/09/16
  • Last Seen:  

the code i suggested it won't affected any of  your existing functionality.

this is for temporary solution to prevent your map-server crashed again.

and during that time, u can slowly in deep track down to which function causing the null sd.

Edited by JJTE
Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  141
  • Reputation:   45
  • Joined:  08/14/12
  • Last Seen:  

But that's not even the problem. sd is null because it's a monster, not a player.

 

sce is set to null in here

             sc_timer_next(tick+sce->val4, status_change_timer, bl->id, data);

sc_timer_next is a macro, with it's definition here

#define sc_timer_next(t,f,i,d) \
    if( (sce=sc->data[type]) ) \
        sce->timer = add_timer(t,f,i,d); \
    else \
        ShowError("status_change_timer: Unexpected NULL status change id: %d data: %d\n", id, data)

So there must have been an error pop up in the console.

On the next line, there's a segfault because sce is null.

He needs to change

            sce->val4 = 0;

to

            if (sce) {
                 sce->val4 = 0;
            }
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   1
  • Joined:  06/09/16
  • Last Seen:  

ops.. sry the sd is already handle on the remaing line. so the only problem caused the map server crashed will be if sce is null.

 

erm... my version of status.c looks different from urs, maybe can u share with us about ur status.c file?
just share a link will do, don't post the whole status.c code here.


Edited by JJTE
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...