Issue information

Issue ID
#8456
Status
Fixed
Severity
High
Started
serverkid
Nov 28, 2014 17:45
Last Post
malufett
Dec 14, 2014 13:55
Confirmation
Yes (6)
No (0)

serverkid - Nov 28, 2014 17:45

[url="http://herc.ws/board/topic/7849-map-crash/"]http://herc.ws/board/topic/7849-map-crash/[/url]

[code=auto:0] (gdb) bt full #0 0x00000000004b5468 in skill_cell_overlap () No symbol table info available. #1 0x00000000005995c4 in bl_vforeach.114343 () No symbol table info available. #2 0x000000000057592d in map_vforeachincell () No symbol table info available. #3 0x00000000005759fb in map_foreachincell () No symbol table info available. #4 0x00000000004972ba in skill_castend_pos2.part.25.192696 () No symbol table info available. #5 0x00000000004a9b0a in skill_castend_pos2 () No symbol table info available. #6 0x00000000004a911c in skill_castend_pos () No symbol table info available. #7 0x00000000004130f6 in do_timer.3198 () No symbol table info available. #8 0x0000000000405a94 in main () No symbol table info available. [/code]

serverkid - Nov 28, 2014 18:48

UPDATE: map crashes when casting safety wall in player's position.
- also crashing when angeling casts SW

This post has been edited by serverkid on Dec 2, 2014 2:33

2Wire - Dec 1, 2014 16:58

Same crash for me :( but i can't reproduce that thing with the Safety Wall.

This post has been edited by 2Wire on Dec 1, 2014 17:14

2Wire - Dec 1, 2014 17:41

How to reproduce:

1.- Cast Land Protector on a player.
2.- Cast Safety Wall on that player while Land Protector is active.
3.- Boom! Crash.

Zirius - Dec 2, 2014 2:17

I can confirm this and this I think is a big problem. This scenario is normal specially on WOE and PVP, so.. I wish this can be fixed as soon as possible. :(

This post has been edited by Zirius on Dec 2, 2014 5:46

Michi - Dec 2, 2014 9:28

can't make it crash could you please tell me more info? is it pre-re / re / both? git version? An other way to reproduce?

Zirius - Dec 2, 2014 13:11

pre-re.
no need to cast to other players, use a sage cast LP on ground, cast Safety Wall to where the LP is enabled, after 2 secs, map crash.

Playtester - Dec 2, 2014 13:53

Is this with the custom no cell stacking define (CELL_NOSTACK) enabled just like the other reports or does this actually happen on default settings?

I can imagine that the custom cell stacking feature causes this problem because you can't place units on a wall but with that MOD each player also counts as wall, so it could happen that you start casting and at castend the target tile is suddenly a wall which suddenly makes the whole skill group have no units at all which could maybe lead to some null pointers.

Keep in mind that if you just want the official no cell stacking feature, you don't need to enable this define.

Zirius - Dec 2, 2014 14:11

[quote]
custom_cell_stack_limit: 1[/quote]

is that it?
because disabling it still causes crash. :(

And note that crash occurs even without target, all those skills are ground target.

[b]UPDATE[/b]. It is weird because we all have different scenario/depth.
My Map server doesn't crash if you casted Safety Wall on a player.
It would only crash when there's Land Protector on where you casted it.
Actually I am not sure if that is the only case, because I disabled Safety Wall on all maps, but still my Map Server crashed 2 hrs ago.
So other things might have triggered it I am not just sure what others.

This post has been edited by Zirius on Dec 2, 2014 16:37

Alexandria - Dec 3, 2014 2:48

[font='comic sans ms', cursive][color=rgb(238,130,238)]maybe I have the same problem? pre-renewal. latest version:[/color][/font]

[url="http://herc.ws/board/topic/7888-error-in-skillc-in-a-fresh-and-latest-version-hercules/?p=47178"]http://herc.ws/board/topic/7888-error-in-skillc-in-a-fresh-and-latest-version-hercules/?p=47178[/url]

This post has been edited by Alexandria on Dec 3, 2014 2:49

serverkid - Dec 3, 2014 4:16

@zirius

your may have crashed because an angeling cast safety wall. it happened to me.

Playtester - Dec 3, 2014 6:47

The define is in core.h, make sure it's commented out like here:
[url="https://github.com/HerculesWS/Hercules/blob/master/src/config/core.h"]https://github.com/HerculesWS/Hercules/blob/master/src/config/core.h[/url] /// Uncomment to enable the Cell Stack Limit mod. /// It's only config is the battle_config custom_cell_stack_limit. /// Only chars affected are those defined in BL_CHAR //#define CELL_NOSTACK


But anyway this is a different issue!

The bug in this thread is because of:
[url="https://github.com/HerculesWS/Hercules/commit/883ffd90b3021e561616943d210d045fd441ef66"]https://github.com/HerculesWS/Hercules/commit/883ffd90b3021e561616943d210d045fd441ef66[/url]

I actually think you can't use skill_cell_overlap like this. See lines 10110 to 10114 in that commit? Remove them. That should fix it.

It will still consume Blue Gemstone then, but that's just a minor issue, much better than server crash.
To implement this correctly we should generally change the skill_castend_pos2 structure so that item requirements for castend are only consumed when skill_unitsetting actually created a unit.

There are common rules for consumptions on official servers. For example it has different requirements for castbegin and castend. Castbegin requirements are always consumed and can't even be removed by Mistress card. Castend requirements are consumed only when skill was successful and consumption can also be prevented by Mistress Card. Currently everything is so hackily done for each skill individually. >-<

This post has been edited by Playtester on Dec 3, 2014 7:40

Zirius - Dec 3, 2014 13:35

[quote name="serverkid" timestamp="1417580213"]
@zirius

your may have crashed because an angeling cast safety wall. it happened to me.[/quote]hmm... only possible if Angeling casted SW on a LP ground... but I doubt any of my sage players would hunt Angeling. As far as I know the Safety Wall bug in mine only occurs if SW is casted on LP ground.

serverkid - Dec 3, 2014 16:54

[quote name="Zirius" timestamp="1417613753"][quote name="serverkid" timestamp="1417580213"]

@zirius

your may have crashed because an angeling cast safety wall. it happened to me.[/quote]hmm... only possible if Angeling casted SW on a LP ground... but I doubt any of my sage players would hunt Angeling. As far as I know the Safety Wall bug in mine only occurs if SW is casted on LP ground.[/quote]

on my server when angeling casts SW on a poring or on itself it will crash.

bysqk - Dec 6, 2014 1:19

Was a fix made? >_< . I removed 10110 to 10114 and safety wall didn't work at all anymore

Playtester - Dec 7, 2014 8:50

That doesn't really make any sense. The fix should work. If Safety Wall doesn't work at all anymore that sounds like you completely removed the case for Safety Wall.

Alexandria - Dec 8, 2014 19:50

[color=#ee82ee][font='comic sans ms', cursive]I hope it can be fixed before of 2016 :)[/font][/color]

Michi - Dec 8, 2014 21:49

no one can give me a good gdb dump?

Playtester - Dec 9, 2014 7:30

Do you really need one? I already explained why it crashes.

In detail:

1. The skill_cell_overlap function expects parameters:[code=auto:0]skill_id = va_arg(ap,int); alive = va_arg(ap,int *);[/code]
As well as a bl "src".

2. Calling skill_cell_overlap via map->foreachincell should look like this:[code=auto:0]map->foreachincell(skill->cell_overlap,src->m,ux,uy,BL_SKILL,skill_id, &alive, src);[/code]
As you can see, skill_id, &alive and src source are forwarded here.

3. In the code I recommended to remove the call is wrong, look here:[code=auto:0]if (map->foreachincell(skill->cell_overlap,src->m,x,y,BL_SKILL)) {[/code]
As you can see the parameters skill_id, &alive and src are missing.

4. Because of this, the function skill_cell_overlap will write into variables that have no memory assigned at all, so it just writes something into some random data it shouldn't access (whatever comes behind in the memory). Very very bad by itself as you are changing data of something completely different. And can lead to server crash if memory is not accessible.

Should be fixed asap. Either remove that code or create dummy data you can give to the function. Just look how it was done with other calls.

malufett - Dec 14, 2014 13:55

Fixed @ fe7734dcb4ee15221b5dd006ea269ddf2f42e4b2
:meow: