Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instances & Map Server Down #3386

Closed
heimdallcodex opened this issue Aug 3, 2018 · 11 comments
Closed

Instances & Map Server Down #3386

heimdallcodex opened this issue Aug 3, 2018 · 11 comments
Labels
status:duplicate Issue that has been reported before

Comments

@heimdallcodex
Copy link

heimdallcodex commented Aug 3, 2018

  • rAthena Hash: 68fccf4

  • Client Date:

  • Server Mode: Pre-Renewal
  • Description of Issue: Since the last update on my server (last Sunday), it has a problem with a lot of instances... When players make a team and launch an instance (for example Endless Tower or Old Glast Heim) all the walkable areas are mixed with the non-walkable areas... (we cannot walk in the walkable zone, and we could be warped on a black zone). I don't think it is a mapcache problem because when I go to the original map of the instance, I can walk normally... the problem is going when the server duplicates the map when an instance is launched... It is my first problem! After it, when the team leader breaks the team, or after the delay of the instance... the map server is down..

  • Modifications that may affect results:

@heimdallcodex heimdallcodex changed the title Instances & Map Server Instances & Map Server Down Aug 3, 2018
@teededung
Copy link
Contributor

@heimdallcodex You need to use ISSUE TEMPLATE to describe your issue.

@gustavobrigo
Copy link
Contributor

gustavobrigo commented Aug 4, 2018

I can confirm that as well..


gdb map-server core.4767
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/ragnabr/rbrathena/map-server...done.
[New LWP 4767]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `./map-server'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000004a2e14 in instance_delusers (instance_id=1) at instance.cpp:886
886                     users += max(map_getmapdata(im->map[i]->m)->users,0);
Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-19.el7.x86_64 libcom_err-1.42.9-12.el7_5.x86_64 libgcc-4.8.5-28.el7_5.1.x86_64 libselinux-2.5-12.el7.x86_64 libstdc++-4.8.5-28.el7_5.1.x86_64 openssl-libs-1.0.2k-12.el7.x86_64 pcre-8.32-17.el7.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) bt full

(gdb) bt full
#0  0x00000000004a2e14 in instance_delusers (instance_id=1) at instance.cpp:886
        im = 0x948d80 <instance_data+64>
        i = 0
        users = 0
#1  0x0000000000504de8 in pc_setpos (sd=sd@entry=0x9ca3980, mapindex=<optimized out>, x=155, y=179, clrtype=clrtype@entry=CLR_TELEPORT) at pc.cpp:5522
        instance_found = false
        p = <optimized out>
        g = <optimized out>
        i = <optimized out>
        m = <optimized out>
        mapdata = 0x29eb838
        clrtype = <optimized out>
        y = 179
        mapindex = 187
        x = 155
        sd = 0x9ca3980
#2  0x00000000004b4936 in map_instancemap_leave(block_list *, typedef __va_list_tag __va_list_tag *) (bl=0x9ca3980, ap=<optimized out>)
    at map.cpp:2687
        ap = <optimized out>
        bl = 0x9ca3980
#3  0x00000000004bb8b0 in map_foreachinmap (func=func@entry=0x4b48d0 <map_instancemap_leave(block_list *, typedef __va_list_tag __va_list_tag *)>,
    m=m@entry=920, type=type@entry=1) at map.cpp:1500
        bsize = <optimized out>
        returnCount = 0
        bl = <optimized out>
        blockcount = 0
        i = 0
        b = <optimized out>
        mapdata = <optimized out>
        ap = {{gp_offset = 24, fp_offset = 48, overflow_arg_area = 0x7ffe307c4b80, reg_save_area = 0x7ffe307c4aa0}}
#4  0x00000000004bef46 in map_delinstancemap (m=920) at map.cpp:2733
        mapdata = 0x1d32c998
        __FUNCTION__ = "map_delinstancemap"
#5  0x00000000004a2784 in instance_destroy (instance_id=<optimized out>) at instance.cpp:668
        mode = IM_PARTY
        im = 0x948d80 <instance_data+64>
        sd = 0x0
        cd = 0x0
        type = 1
        __FUNCTION__ = "instance_destroy"
        pd = 0x7fc15cdbecf4
        gd = 0x0
        i = 1
        now = <optimized out>
#6  0x00000000004a2c3c in instance_delete_timer (tid=<optimized out>, tick=<optimized out>, id=<optimized out>, data=<optimized out>)
    at instance.cpp:96
No locals.
#7  0x00000000005f625a in do_timer (tick=<optimized out>) at timer.cpp:370
        tid = 12301
        diff = 0
        do_timer(unsigned int)::__FUNCTION__ = "do_timer"
#8  0x0000000000406d14 in main (argc=1, argv=0x7ffe307c4da8) at core.cpp:367
        next = <optimized out>
(gdb)

@aleos89
Copy link
Contributor

aleos89 commented Aug 4, 2018

Sounds like you didn't properly merge the map update. I had these issues while testing but it's not present on master (68fccf4 at this point in time).

@gustavobrigo
Copy link
Contributor

gustavobrigo commented Aug 4, 2018

@aleos89 Straight clone from 3165e52
No customizations and loaded just pre-re instances.

@arby89
Copy link

arby89 commented Aug 4, 2018

Just to add, idk related or not:

  1. instance with multi map, error when use instance_destroy(), instance with single map, working great.
  2. warpparty in instance with multi map just warp all other party member but not party leader, instance with single map warpparty working well.

@gustavobrigo
Copy link
Contributor

gustavobrigo commented Aug 4, 2018

Well, i think this shoud be related with those recent "cleanups" (#2943)

I was looking back to modifications and 10 days ago there was some fix related to instance destruction rolled and seems to still exists some serious problem happening here..

I think this should be rolled back while it is under code review because seems to had broken several parts of the emulator.

@gustavobrigo
Copy link
Contributor

Moving on reviewing the code, seems to be related to the merge of instance_start and map_num on the same vector, BEFORE, when a instance was added, the value of map_num was increased, this code is for a revision before the merge of the "cleanups":
Function map_addinstancemap on map.cpp

	for(i = instance_start; i < MAX_MAP_PER_SERVER; i++) {
		if(!map[i].name[0])
			break;
	}
	if(i < map_num) // Destination map value overwrites another
		dst_m = i;
	else if(i < MAX_MAP_PER_SERVER) // Destination map value increments to new map
		dst_m = map_num++;
	else {
		// Out of bounds
		ShowError("map_addinstancemap failed. map_num(%d) > map_max(%d)\n",map_num, MAX_MAP_PER_SERVER);
		return -3;
	}

Take a look at dst_m = map_num++;, map_num is incremented when the instance map is created BUT instance_start is kept to the default index when the server was started, so, every time the interation try to find a "instance map" free from the last non-instanced maps.

I guess there is some mess with map indexing with this new cleanup.

@aleos89 aleos89 added the status:duplicate Issue that has been reported before label Aug 5, 2018
@aleos89
Copy link
Contributor

aleos89 commented Aug 5, 2018

I'll close this as it's a duplicate of the other issues (#3369).

@aleos89 aleos89 closed this as completed Aug 5, 2018
@heimdallcodex
Copy link
Author

heimdallcodex commented Aug 5, 2018

Thank you @aleos89 but my problem is NOT only linked to the instance OGH... but with a lot of official instances and it is since the last upgrade. Before it, I never had this kind of problems in two years.
It seems problematic for my community and the others who cannot launch any instance, without this result (of walkable areas and map server)...

These instances have this problem.

  • Endless Tower,
  • Sealed Catacomb,
  • Orc's Memory,
  • Nidhoggur's
  • Nest,
  • Culvert,
  • Wolfchev's Laboratory,
  • Old Glast Heim,
  • Geffen Magic Tournament,
  • Isle of Bios

If i do @mapexit during the instance (in local) i have this message :

(08/05/2018 23:20:18) [ Warning ] : Memory leak detected at ERS 'instance.cpp::instance_maps_ers', 6 objects not freed.

@aleos89
Copy link
Contributor

aleos89 commented Aug 5, 2018

You can apply #3384 and it should resolve your issues.

@heimdallcodex
Copy link
Author

It did't.

After a revert of it, #3347, my instances are perfectly functional (no any map server down and the walkable areas are good).

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:duplicate Issue that has been reported before
Projects
None yet
Development

No branches or pull requests

5 participants