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

Crash on stopping world #2286

Closed
ghost opened this issue Jun 23, 2015 · 12 comments
Closed

Crash on stopping world #2286

ghost opened this issue Jun 23, 2015 · 12 comments

Comments

@ghost
Copy link

ghost commented Jun 23, 2015

This plugin will teleport the player from one world to another world. I think it's the same problem like in #2056, but this occurs on stopping the world.

Requirements:
Add a world named test and the lua test plugin below.

Reproduce:

  1. Connect to the server
  2. Run the command test
  3. After you have been teleported one ore more times, disconnect
  4. Connect again to the server
  5. Disconnect
  6. Stop the server, it should crash

Lua test plugin:

function Initialize(Plugin)
    Plugin:SetName("TestPlugin")
    Plugin:SetVersion(1)

    -- Command Bindings
    cPluginManager.BindCommand("/test", "test", CmdTest , " test")

    LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
    return true
end

function CmdTest(a_Split, a_Player)
    local playerName = a_Player:GetName()
    CALLBACK = 
        function(a_World)
            a_World:DoWithPlayer(playerName,
                function(a_Player2)
                    if (a_Player2:GetWorld():GetName() == "world") then
                        a_Player2:MoveToWorld("test")
                    else
                        a_Player2:MoveToWorld("world")
                    end
                    a_Player2:GetWorld():ScheduleTask(20, CALLBACK)
                end)
        end
    a_Player:GetWorld():ScheduleTask(20, CALLBACK)
    return true
end
@madmaxoft
Copy link
Member

So many crashes lately...

@ghost
Copy link
Author

ghost commented Jun 26, 2015

Okay no need for the lua code.

  1. Connect to the server
  2. Teleport to a other world
  3. Disconnect
  4. Connect
  5. Disconnect
  6. Stop the server, it should crash

@worktycho
Copy link
Member

It's the player destruction code. Does anyone fully understand how it works?

@ghost
Copy link
Author

ghost commented Jun 26, 2015

I think this error counts to that issue, too.

#0  0x00000000005214da in cChunk::AddClient(cClientHandle*) ()
#1  0x000000000052a9bf in cChunkMap::AddChunkClient(int, int, cClientHandle*)
    ()
#2  0x0000000000534802 in cClientHandle::StreamChunk(int, int, cChunkSender::eChunkPriority) ()
#3  0x000000000053471b in cClientHandle::StreamNextChunk() ()
#4  0x000000000053891d in cClientHandle::Tick(float) ()
#5  0x00000000005a2eeb in cWorld::TickClients(float) ()
#6  0x00000000005946d0 in cWorld::Tick(std::chrono::duration<long, std::ratio<1l, 1000l> >, std::chrono::duration<long, std::ratio<1l, 1000l> >) ()
#7  0x00000000005943cc in cWorld::cTickThread::Execute() ()
#8  0x00007ffff71e5e40 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00007ffff74b2182 in start_thread ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#10 0x00007ffff6c4c47d in clone () from /lib/x86_64-linux-gnu/libc.so.6

@Seadragon91
Copy link
Contributor

Any updates on this?

@sphinxc0re sphinxc0re added this to the Testing-0.1 milestone Oct 23, 2015
@sphinxc0re
Copy link
Contributor

If something is labeled as important, it has to be added to the Testing-0.1 milestone

@SafwatHalaby
Copy link
Member

@sphinxc0re Some "important" issues/crashes can be introduced in Master, but are not a problem at all in testing because that code is older.

@SafwatHalaby
Copy link
Member

#2940 prevents the crash in this scenario:

1) Connect to the server
2) Teleport to a other world
3) Disconnect
4) Connect
5) Disconnect
6) Stop the server, it should crash

@SafwatHalaby
Copy link
Member

Do #2939 and/or #2941 fix this?

@sphinxc0re
Copy link
Contributor

I don't really know. Could you file a test case?

@SafwatHalaby
Copy link
Member

A test case would be running @ghost's initial instructions over the current master in debug mode.

@SafwatHalaby
Copy link
Member

Fixed in #2941

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants