Issue information

Issue ID
#7140
Status
Fixed
Severity
None
Started
Frost
Mar 31, 2013 13:01
Last Post
malufett
Apr 2, 2013 18:15
Confirmation
Yes (1)
No (0)

Frost - Mar 31, 2013 13:01

Hi! i notice that in the channel system, when i try to type #asdasdasd or any other names, ETC. the map server will crash. i suggest to add a display notice that if i typed eg: #Indishandsome ( if this channel is not created ) a message will show like this "#Indishandsome" Channel is not Available or not exist.

Ind - Mar 31, 2013 13:41

can you please elaborate on how to reproduce? i didn't crash o-o (it does have a message when channel is not found)

Frost - Mar 31, 2013 13:59

hmm i use default modification, then when i try to use #trade it crashes the map server.

i think #trade is missing coz when i try to use @channel list, only 3 out of 4 is shown. main, offtopic, support

Ind - Mar 31, 2013 14:04

hum o-o that is weird, i have the default modification and #trade is there hmmm nothing else different?

Frost - Mar 31, 2013 14:07

when i try to use #trade in "whisper box" the small box in the left, it crashes the server.

Ind - Mar 31, 2013 14:11

hum o_O I still can't reproducee T_T well there is one way to figure oo can you provide a gdb dump of the crash?

Frost - Mar 31, 2013 14:21

Hmm i think i got the error in my client try to use older clients like 2010-07-30

Ind - Mar 31, 2013 14:26

can you send me your client exe? i dont have one like that and it'll take me quite some time to get one diffed (im bad with client stuff D:)

Frost - Mar 31, 2013 14:29

Hmm sorry ind i'm using ipad right now but you can diff your own client here [url="http://rathena.org/tools/diff_patcher.php"]http://rathena.org/tools/diff_patcher.php[/url]

Frost - Mar 31, 2013 14:30

Btw im using 2010-07-30

Ind - Mar 31, 2013 15:02

my lua files are not 2010-07-03 compatible D: i'll wait for the gdb dump

Ind - Mar 31, 2013 19:06

thanks to Mysterious I was able to get the client properly setup, no crashes or whatsoever. couldn't reproduce.

Frost - Mar 31, 2013 22:31

hmm.. try to not use @join <#channel_name>, instead use #trade directly, i've noticed that i'm in #map channel then i try to use #trade.

Ind - Mar 31, 2013 22:56

I did test that too, couldn't reproduce. our best way to figure this is if you provide me with a gdb dump of the crash (start map server with gdb (gdb ./map-server) and then crash it by doing that, then type 'bt full' and copy the output here)

Frost - Apr 1, 2013 5:08

hmm im sorry ind, but im testing it on offline, my operating system is win 7.

Zopokx - Apr 1, 2013 10:41

Well, I just have test this, and it's crashing for me too, but only when I have >1 users online.

BTW, here is the gdb dump (I hope it will be ok, because it's my first time debugging Hercules)
[code=nocode:0] #0 clif_parse_WisMessage (fd=7, sd=0xdc4fa80) at clif.c:10143 k = 2 '\002' channel = 0x7 chname = 0xac7fb402 "\004\t\t\b\026" dstsd = <value optimized out> i = <value optimized out> target = 0xac7fb4e8 "#adsa" message = 0xac7fb500 "adsa" namelen = 5 messagelen = <value optimized out> #1 0x08090fce in clif_parse (fd=7) at clif.c:16541 cmd = 140627808 packet_ver = 31 packet_len = <value optimized out> err = 6 sd = 0xdc4fa80 pnum = 0 #2 0x081e07ce in do_sockets (next=50) at socket.c:809 rfd = {__fds_bits = {128, 0 <repeats 31 times>}} timeout = {tv_sec = 0, tv_usec = 5686} ret = <value optimized out> i = 7 #3 0x081deb65 in main (argc=1, argv=0xbfb96fa4) at core.c:334 next = -1469706568 [/code]

malufett - Apr 1, 2013 15:54

due to this one
[code=auto:0]void clif_hercules_chsys_delete(struct hChSysCh *channel) { if( db_size(channel->users) && !hChSys.closing ) { DBIterator *iter; struct map_session_data *sd; char message[60]; unsigned char i; sprintf(message, "#%s channel is being shut down",channel->name); clif->chsys_msg(channel,sd,message); <<<<<<< sd is used before it was initialize iter = db_iterator(channel->users); for( sd = dbi_first(iter); dbi_exists(iter); sd = dbi_next(iter) ) { for( i = 0; i < sd->channel_count; i++ ) { if( sd->channels[i] == channel ) { sd->channels[i] = NULL;[/code]
:meow:

This post has been edited by malufett on Apr 1, 2013 16:18

Ind - Apr 1, 2013 16:16

[quote name="Zopokx" timestamp="1364812877"]
Well, I just have test this, and it's crashing for me too, but only when I have >1 users online.

BTW, here is the gdb dump (I hope it will be ok, because it's my first time debugging Hercules)[code=nocode:0]#0 clif_parse_WisMessage (fd=7, sd=0xdc4fa80) at clif.c:10143 k = 2 '\002' channel = 0x7 chname = 0xac7fb402 "\004\t\t\b\026" dstsd = <value optimized out> i = <value optimized out> target = 0xac7fb4e8 "#adsa" message = 0xac7fb500 "adsa" namelen = 5 messagelen = <value optimized out> #1 0x08090fce in clif_parse (fd=7) at clif.c:16541 cmd = 140627808 packet_ver = 31 packet_len = <value optimized out> err = 6 sd = 0xdc4fa80 pnum = 0 #2 0x081e07ce in do_sockets (next=50) at socket.c:809 rfd = {__fds_bits = {128, 0 <repeats 31 times>}} timeout = {tv_sec = 0, tv_usec = 5686} ret = <value optimized out> i = 7 #3 0x081deb65 in main (argc=1, argv=0xbfb96fa4) at core.c:334 next = -1469706568 [/code]

[/quote]Thank you very much. by the way,
is this your clif.c line 10134?[code=auto:0] } else if( channel->pass[0] == '\0' ) { [/code]

Ind - Apr 1, 2013 20:35

[quote name="malufett" timestamp="1364831678"]
due to this one[code=auto:0]void clif_hercules_chsys_delete(struct hChSysCh *channel) { if( db_size(channel->users) && !hChSys.closing ) { DBIterator *iter; struct map_session_data *sd; char message[60]; unsigned char i; sprintf(message, "#%s channel is being shut down",channel->name); clif->chsys_msg(channel,sd,message); <<<<<<< sd is used before it was initialize iter = db_iterator(channel->users); for( sd = dbi_first(iter); dbi_exists(iter); sd = dbi_next(iter) ) { for( i = 0; i < sd->channel_count; i++ ) { if( sd->channels[i] == channel ) { sd->channels[i] = NULL;[/code] :meow:

[/quote]ops i'm sorry i didn't see your reply D: ( i guess i was so hectic when i saw the dump that i jumped straight to the reply box not paying attention to any other replies D: ) you're absolutely absolutely right, ...however the gdb dump doesn't point there so I guess there is more than 1 error

This post has been edited by Ind on Apr 1, 2013 20:37

Ind - Apr 1, 2013 20:43

what malufett found was fixed here: [url="https://github.com/HerculesWS/Hercules/commit/1e87c09c8463009a4c97d30277d2345b3c83b0f3"]https://github.com/HerculesWS/Hercules/commit/1e87c09c8463009a4c97d30277d2345b3c83b0f3[/url]
however I think this was not the cause of this bug (since channel deletion is not performed when you try to pm, so the reason for the crash is still unclear)

Ind - Apr 1, 2013 20:44

oh here is the reason for this crash: [url="http://herc.ws/board/tracker/issue-7141-some-warnings/"]http://herc.ws/board/tracker/issue-7141-some-warnings/[/url]

Ind - Apr 1, 2013 20:51

the reason i wasnt able to reproduce was because this is a system-dependent error, I became aware of it thanks to Zopokx, fixed in [url="http://herc.ws/board/tracker/issue-7141-some-warnings/"]http://herc.ws/board/tracker/issue-7141-some-warnings/[/url]

Frost - Apr 1, 2013 22:02

Thank you so much for fixing this Ind!

malufett - Apr 2, 2013 16:49

@Ind
still crashing @ windows and still gives a warning..
[code=auto:0] \src\map\clif.c(10376): warning C4700: uninitialized local variable 'sd' used [/code]
and why is it
[code=auto:0] clif->chsys_msg(channel,sd,message); [/code]
is invoked after sd was initialized??

:meow:

Ind - Apr 2, 2013 18:08

[quote name="malufett" timestamp="1364921387"]
@Ind
still crashing @ windows and still gives a warning..[code=auto:0]\src\map\clif.c(10376): warning C4700: uninitialized local variable 'sd' used [/code]and why is it[code=auto:0]clif->chsys_msg(channel,sd,message); [/code]is invoked after sd was initialized??

:meow:

[/quote]i think your clif.c is out of date, I've removed that line

malufett - Apr 2, 2013 18:15

wew...toirtoise trolling me again...huhuhu..

:meow: