Jump to content
  • 0
Sign in to follow this  
utofaery

Crash rebellion random mapserver scriptcommand Class

Question

Why is that is you try to use npc to check player job class will randomly crashes mapserver 

and mostly occur to rebellion or gunslinger class??

eg.

prontera,154,174,5    script    Tester    4_M_PAY_SOLDIER,{
    mes ("Good day~~!");
    if ( Class == Job_Rebellion ) {
        mes ("Class :: " + jobname(Job_Rebellion) ) ;
    }
    close2;
end;
}
 

if talk to said npc multiple time can randomly crashes map server is this normal??

 

 

 

Client 20180621 if matters.

Share this post


Link to post
Share on other sites

19 answers to this question

Recommended Posts

  • 0

crash dump ?

couldn't reproduce your error

if you have random crash, 1st thing you should do is try to reproduce the error by taking out your source edits and plugins 1 by 1

Share this post


Link to post
Share on other sites
  • 0

@utofaery to see crash need some kind of crash dump, atleast something.

Also do you have any custom mods or plugins?

Share this post


Link to post
Share on other sites
  • 0

1. how to find crash dump?

2. map server sometime random crash and finishes restart less that 10 seconds since I changed the 15 seconds in serv.bat to 5 seconds.

plugins_list: [
    /* Enable HPMHooking when plugins in use rely on Hooking */
    "HPMHooking",
    "db2sql",
    //"sample",
    //"other",
    "mapcache",
    "xGetStorageList",
    "xMaxLvlCheck",
]
 

Plugin 1 :  xGetStorageList

  Reveal hidden contents

Plugin 2 : xMaxLvlCheck

  Reveal hidden contents

 

Since I dont really know much of the source so,

The only source edit would be 

 

atcommand.c

@go changed x y

@summon increased duration

 

skill.c, status.c

increased or decreased value or chance

 

Pc.h

#define MAX_PC_BONUS 100 //xsa // 10  << Could this be the culprit???  
 

pc.c

static int pc_checkallowskill(struct map_session_data *sd)
            SC_NONE
//xsa        SC_AUTOGUARD,
//xsa        SC_DEFENDER,
//xsa        SC_REFLECTSHIELD,
//xsa        SC_LG_REFLECTDAMAGE
 

mmo.h    

#define PACKETVER 20180620 //xsa

 

itemdb.h

#define MAX_ITEMDELAYS 1 // The maximum number of item delays //xsa
 

mob.c

        "mob_classchange.txt", //xsa
        "mob_customNormal.txt", //xsa  << added
        "mob_customMVP.txt"}; //xsa << added

mob.h

#define MAX_RANDOMMONSTER 9 //xsa // 5
#define MAX_MOB_DB 20000 // 5000 //xsa
 

renewal.h

//#define RENEWAL_EXP
 

how can this minor edit be crashy or is it critical??

Share this post


Link to post
Share on other sites
  • 0

use gdb for get back trace on linux

or use visual studio on windows

Share this post


Link to post
Share on other sites
  • 0
  On 2/6/2019 at 10:29 PM, utofaery said:

how can this minor edit be crashy or is it critical??

any kind of source edit can be critical

 

good timing, I just reproduce a crash with rathena test server,
not going to tell how to reproduce, let's see how long they take to find this bug

so, here's the screenshots

you should get this window when there's a crash, select Debug the Program

crashdump_vs_1.png

Open a new instance with Visual Studio

crashdump_vs_2.png

then you can see the trace from Visual Studio, the Call Stack field matters a lot

crashdump_vs_3.png

Share this post


Link to post
Share on other sites
  • 0

rathena seems sort of ... changing everything from 32-bit into 64-bit
rathena can crash my arathi basin script ... ->https://rathena.org/board/topic/104325-wow-arathi-basin/?do=findComment&comment=356135  fixed
also crash my MVP ladder script ... -> https://github.com/rathena/rathena/issues/3881
these 2 bugs are just fixed recently

yeah I just found 3rd bug ... as you can see from the crash dump, it has something to do with array

 

hercules works just fine ....
com;on I'm quick to report bugs on hercules, you know it :P

Share this post


Link to post
Share on other sites
  • 0

About the crash It's not showing that kind of image

crashdump_vs_1.png

map server just auto restart

like I cast heal on myself ... mapserver auto restart

or I job change instant restart again...seems creepy...

 

 

Edit:

Found this in the file 

C:\Users\Rio\Desktop\Hercules\log\map-server.exe.leaks

  Reveal hidden contents

Is this something important?

all the line is alike in that file

 

 

Here's a diff of what Changed in src folder

  Reveal hidden contents

And Retarget Project because I had a 17xxx something SDK of 2017

  Reveal hidden contents

 

 

Edited by utofaery

Share this post


Link to post
Share on other sites
  • 0

Another question HeidiSql not like this line of sql

+REPLACE INTO `mob_skill_db` VALUES (2142,'Nydhogg's Memory@NPC_SUMMONSLAVE','idle',196,1,10000,0,0,'no','self','onspawn',NULL,2143,NULL,NULL,NULL,NULL,NULL,NULL);
 

Nydhogg's Memory  << the ' between "Nydhogg" and "s" is the one it doesn't like 

How would I restructure them so it works?

 

 

HeidiSql 9.4.0.5125

MariaDB 10.3

Share this post


Link to post
Share on other sites
  • 0

Replace

Nydhogg's Memory

to

Nydhogg''s Memory

 

Share this post


Link to post
Share on other sites
  • 0

About leaks it show line number. you should see what you code have at this line and around it.

 

 

Share this post


Link to post
Share on other sites
  • 0
  On 2/8/2019 at 1:08 AM, 4144 said:

About leaks it show line number. you should see what you code have at this line and around it.

 

 

I had achievement_db and quest_db emptied
and only keep minimal mobs, warps, and woe script while disable everything else.
so I don't get notified so many time of found something or any how

  Reveal hidden contents

 

Empty line can create Leaks?  

or does it has to do with having quest db emptied?

  Reveal hidden contents

 

Share this post


Link to post
Share on other sites
  • 0

every time there is a crash, I always see that window come out
if the window doesn't come out, no idea .... I used this method to debug my test server ever since I used visual studio 2010

I think you should show us the patch what have you done on your server...
and we hercules don't use patch, everything should be plugin

 

  On 2/8/2019 at 1:07 AM, 4144 said:

Replace

Nydhogg's Memory

to

Nydhogg''s Memory

 

in MySQL is

Nydhogg\'s Memory

perhaps different syntax

Share this post


Link to post
Share on other sites
  • 0

I don't have patch only plugin 2 from your hand I think.

so it all fall backs to minor source edit?

all I have is the tortoise git generated diff from main branch of hercules of what I changed in src folder.

I never did use any patch.

src folder diff generated from tortoise git 

It's very long..!

  Reveal hidden contents

 

Another thing I found crash server is heal (28) skill

in when use that skill heal (28) on self or others map server instant restart

 

Share this post


Link to post
Share on other sites
  • 0

Unhandled exception thrown: read access violation.
**dstmd** was nullptr. occurred

 

This happen'd when I use Heal skill (28) on any target.

  Reveal hidden contents

 

Share this post


Link to post
Share on other sites
  • 0
  On 2/8/2019 at 9:37 AM, utofaery said:

all I have is the tortoise git generated diff from main branch of hercules of what I changed in src folder.
I never did use any patch.
src folder diff generated from tortoise git 
It's very long..!

  Reveal hidden contents

Another thing I found crash server is heal (28) skill
in when use that skill heal (28) on self or others map server instant restart

can't test your patch because you convert the [tab] into [space]

try upload your patch somewhere else, like github, google drive or https://pastebin.com/
or just use <Code> tag ... seriously

Share this post


Link to post
Share on other sites
  • 0
#include "common/hercules.h"
#include "map/pc.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"getstoragelist",
	SERVER_TYPE_MAP,
	"x_O",
	HPM_VERSION,
};

BUILDIN(getstoragelist) {
	struct map_session_data *sd = script->rid2sd(st);
	char card_var[SCRIPT_VARNAME_LENGTH];
	int i = 0, j = 0, k = 0;

	if ( sd == NULL )
		return true;

	for ( i = 0; i < VECTOR_LENGTH(sd->storage.item); i++ ) {
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_id"), j ), VECTOR_INDEX(sd->storage.item, i).nameid );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_amount"), j ), VECTOR_INDEX(sd->storage.item, i).amount );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_refine"), j ), VECTOR_INDEX(sd->storage.item, i).refine );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_identify"), j ), VECTOR_INDEX(sd->storage.item, i).identify );
		pc->setreg( sd, reference_uid( script->add_variable("@storagelist_attribute"), j ), VECTOR_INDEX(sd->storage.item, i).attribute );
		for ( k = 0; k < MAX_SLOTS; k++ ) {
			sprintf( card_var, "@storagelist_card%d", k +1 );
			pc->setreg( sd, reference_uid( script->add_variable(card_var), j ), VECTOR_INDEX(sd->storage.item, i).card[k]);
		}
		pc->setreg( sd, reference_uid(script->add_variable("@storagelist_expire"), j ), VECTOR_INDEX(sd->storage.item, i).expire_time);
		pc->setreg( sd, reference_uid(script->add_variable("@storagelist_bound"), j ), VECTOR_INDEX(sd->storage.item, i).bound);
		for ( k = 0; k < MAX_ITEM_OPTIONS; k++ ) {
			sprintf( card_var, "@storagelist_opt_id%d", k + 1 );
			pc->setreg(sd, reference_uid(script->add_variable(card_var), j), VECTOR_INDEX(sd->storage.item, i).option[k].index);
			sprintf( card_var, "@storagelist_opt_val%d", k + 1 );
			pc->setreg(sd, reference_uid(script->add_variable(card_var), j), VECTOR_INDEX(sd->storage.item, i).option[k].value);
			sprintf( card_var, "@storagelist_opt_param%d", k + 1 );
			pc->setreg(sd, reference_uid(script->add_variable(card_var), j), VECTOR_INDEX(sd->storage.item, i).option[k].param);
		}
		j++;
	}
	pc->setreg( sd, script->add_variable("@storagelist_count") , j );
	return true;
}

HPExport void plugin_init (void) {
	addScriptCommand( "getstoragelist", "", getstoragelist );
}

// src/plugins/xGetStorageList.c


#include "common/hercules.h"
#include "map/pc.h"
#include "common/HPMDataCheck.h"

HPExport struct hplugin_info pinfo = {
	"maxbaselv",
	SERVER_TYPE_MAP,
	"x_O",
	HPM_VERSION,
};

BUILDIN(maxbaselv) {
	struct map_session_data *sd = script->rid2sd(st);

	if ( sd == NULL )
		return true;

	script_pushint( st, pc->maxbaselv(sd) );
	return true;
}

BUILDIN(maxjoblv) {
	struct map_session_data *sd = script->rid2sd(st);

	if ( sd == NULL )
		return true;

	script_pushint( st, pc->maxjoblv(sd) );
	return true;
}

HPExport void plugin_init (void) {
	addScriptCommand( "maxbaselv", "", maxbaselv );
	addScriptCommand( "maxjoblv", "", maxjoblv );
}
// src/plugins/xMaxLvlCheck.c 

The 2 plugins.

 

 

Mobbranch.txt << need seperate it.
db/mob_customMVP.txt
db/mob_customNormal.txt

 

Unversioned files are not here,

or do I need to pack them up as zip???

Mobbranch.txt

Git Diff.txt

Share this post


Link to post
Share on other sites
  • 0
  On 2/10/2019 at 9:54 AM, AnnieRuru said:

apply patch failed, sorry can't help. You are on your own on this one

k

The down side is Only player can't play or use Heal(28) and some unknown crashy stuff...

any way thanks for helping though.

Share this post


Link to post
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.   Restore formatting

  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.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.