Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

  • #008405

  • 0 - None Assigned

  • Needs More Info

Issue Confirmations

  • Yes (0)No (0)
Photo

Map-Server crash

Posted by Ink on 17 October 2014 - 02:13 PM

(gdb) bt full
#0  0x081009b7 in clif_parse_WisMessage (fd=21, sd=0xbc942b8) at clif.c:10397
        dstsd = <value optimized out>
        i = <value optimized out>
        target = 0x0
        message = 0x0
        namelen = 0
        messagelen = <value optimized out>
        __FUNCTION__ = "clif_parse_WisMessage"
#1  0x080f1fd5 in clif_parse (fd=21) at clif.c:18409
        parse_cmd_func = <value optimized out>
        cmd = <value optimized out>
        packet_len = 38
        sd = 0xbc942b8
        pnum = <value optimized out>
#2  0x0824ce8e in do_sockets (next=50) at socket.c:869
        rfd = {fds_bits = {2097152, 0 <repeats 31 times>}}
        timeout = {tv_sec = 0, tv_usec = 46282}
        ret = <value optimized out>
        i = <value optimized out>
#3  0x08249847 in main (argc=1, argv=0xbf939f04) at core.c:256
        next = <value optimized out>
        retval = 0
Can you tell me what's wrong? The crashes seems to happen random, at least i can't figure what causes it.

edit: checked all my crash dumps (10 now) all saying the same

Ind 
changed status to: Needs More Info

whats in your clif.c 10397? on mine its a //commented line so

//-------------------------------------------------------//
//   Lordalfa - Paperboy - To whisper NPC commands       //
//-------------------------------------------------------//
if (target[0] && (strncasecmp(target,"NPC:",4) == 0) && (strlen(target) > 4)) {

edit: i did a diff with latest clif.c

mine has
return;

pc_stop_walking(sd, 1);

pc_stop_attack(sd);
while latest has
return;

if(action_type != 0x00 && action_type != 0x07)
pc_stop_walking(sd, 1);
pc_stop_attack(sd);


Posted Image

Im using the version of last week

edit2: i didnt apply any diff, on the right side you see my clif.c (around 1 week old) and on the left, you see the one from the latest repository.

Edited by Ink, 17 October 2014 - 06:44 PM.


and here the difference: i use the clif.c BEFORE this change

https://github.com/H...bd3c2b53c9b0d54

i did my last update on october 11th so my repository is from pre- Commits on Oct 13, 2014,

the last update i made was "Fix Kyougaku make client crash" on Oct 10, 2014

Edited by Ink, 17 October 2014 - 06:48 PM.


hmm, what does gdb claim the error was? (for example it can say "SIGSEGV/SIGPIPE/WHATEVER" segment fault)

hmm, what does gdb claim the error was? (for example it can say "SIGSEGV/SIGPIPE/WHATEVER" segment fault)

where can i find that? :x


edit: do you mean this?
Program terminated with signal 11, Segmentation fault.
#0  0x081009b7 in clif_parse_WisMessage (fd=58, sd=0xc3871b0) at clif.c:10397
10397           if (target[0] && (strncasecmp(target,"NPC:",4) == 0) && (strlen(target) > 4)) {

Edited by Ink, 17 October 2014 - 09:49 PM.


whats in your clif.c 10397? on mine its a //commented line so



ok using fully updated revision now:
Core was generated by `./map-server'.
Program terminated with signal 11, Segmentation fault.
#0  0x08105166 in clif_parse_WisMessage (fd=9, sd=0xc884578) at clif.c:10398
10398           if (target[0] && (strncasecmp(target,"NPC:",4) == 0) && (strlen(target) > 4)) {
(gdb) bt full
#0  0x08105166 in clif_parse_WisMessage (fd=9, sd=0xc884578) at clif.c:10398
        dstsd = <value optimized out>
        i = <value optimized out>
        target = 0x0
        message = 0x0
        namelen = 0
        messagelen = <value optimized out>
        __FUNCTION__ = "clif_parse_WisMessage"
#1  0x080e6b05 in clif_parse (fd=9) at clif.c:18410
        parse_cmd_func = <value optimized out>
        cmd = <value optimized out>
        packet_len = 40
        sd = 0xc884578
        pnum = <value optimized out>
#2  0x082597ee in do_sockets (next=50) at socket.c:869
        rfd = {fds_bits = {512, 0 <repeats 31 times>}}
        timeout = {tv_sec = 0, tv_usec = 43304}
        ret = <value optimized out>
        i = <value optimized out>
#3  0x082560c7 in main (argc=1, argv=0xbf800114) at core.c:256
        next = <value optimized out>
        retval = 0


clif.c
//-------------------------------------------------------//
//   Lordalfa - Paperboy - To whisper NPC commands       //
//-------------------------------------------------------//
if (target[0] && (strncasecmp(target,"NPC:",4) == 0) && (strlen(target) > 4)) {
char* str = target+4; //Skip the NPC: string part.
struct npc_data *nd;


All "OnWhisperGlobal" were removed from scripts. Still happening ~.~

Edited by Ink, 20 October 2014 - 04:16 PM.


another update

the map-server crashes as soon as you whisper to a name with max letter, it doesnt even have to be a name or an actual play. you can just whisper to "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa" any message

--> map server crashes

Edited by Ink, 22 October 2014 - 09:55 PM.


ok finally found the issue. The map server stopped crashing after removing this plugin:

http://herc.ws/board...l-pay-for-help/

If you still want to use the plugin you should replace "return true;" with "return retVal;"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../map/pc.h"
#include "../map/clif.h"
#include "../common/HPMi.h"
#include "../common/socket.h"

#include "../common/HPMDataCheck.h" // should always be the last file included! (if you don't make it last, it'll intentionally break compile time)

HPExport struct hplugin_info pinfo = {
	"GM_impersonate",	// Plugin name
	SERVER_TYPE_MAP,// Which server types this plugin works with?
	"0.1",			// Plugin version
	HPM_VERSION,	// HPM Version (don't change, macro is automatically updated)
};

bool clif_process_message_spaces( int retVal, struct map_session_data *sd, int format, char **name_, size_t *namelen_, char **message_, size_t *messagelen_) {
	if ( retVal == true ) {
		normalize_name( *message_, "\255\xA0\032\t\x0A\x0D " );
		if ( stristr( *message_, "\x20\x3A\x20" ) || stristr( *message_, "\x20\x3B\x20" ) ) { // type " : " OR " ; " will be blocked
			clif->colormes( sd->fd, COLOR_RED, "You can't impersonate other players !" );
			return false;
		}
	}
	return retVal;
}

HPExport void plugin_init (void) {
	clif = GET_SYMBOL("clif");
	session = GET_SYMBOL("session");
	strlib = GET_SYMBOL("strlib");

	addHookPost("clif->process_message", clif_process_message_spaces);
}