nagalun / multiplayerpiano-server

Unofficial server for the http://multiplayerpiano.com client.
https://piano.ourworldofpixels.com
ISC License
12 stars 16 forks source link

Someone keeps crashing the server #25

Closed ghost closed 3 years ago

ghost commented 4 years ago
User found in database.
New client: xx.xxx.xxx.xx
Deleted client: xx.xxx.xxx.xx
User found in database.
New client: xx.xxx.xxx.xx
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
New client: xx.xxx.xx.xxx
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
New client: xx.xxx.xx.xxx
Created new room: lobby
User found in database.
New client: xx.xxx.xxx.xx
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
Set default room color to: 242464
Listening on 0.0.0.0:8443
Password is: meow
User found in database.
New client: xx.xxx.xxx.xx
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
nagalun commented 4 years ago

A stack trace for both of your issues would be nice. You can probably get it with valgrind I guess.

ghost commented 4 years ago

image

ghost commented 4 years ago

I could not reproduce

ar065 commented 3 years ago

I could reproduce on your server, lamp. I could send you the code used to do it if you'd like.

ghost commented 3 years ago

I could reproduce using your code.

ghost commented 3 years ago

I reproduced in local test environment. It only worked after connecting a regular client to the server; nothing happened when there was nothing else connected.

(gdb) run dog
Starting program: /home/me/multiplayerpiano-server/out dog
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Listening on 0.0.0.0:1234
Password is: dog
New client: 127.0.0.1
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
ghost commented 3 years ago

Valgrind output

$ valgrind ./out dog
==11497== Memcheck, a memory error detector
==11497== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==11497== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==11497== Command: ./out dog
==11497==
==11497== error calling PR_SET_PTRACER, vgdb might block
Listening on 0.0.0.0:1234
Password is: dog
New client: 127.0.0.1
Created new room: lobby
terminate called after throwing an instance of 'std::out_of_range'
  what():  _Map_base::at
==11497==
==11497== Process terminating with default action of signal 6 (SIGABRT)
==11497==    at 0x4E3E18B: raise (raise.c:51)
==11497==    by 0x4E1D858: abort (abort.c:79)
==11497==    by 0x4C98950: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==11497==    by 0x4CA447B: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==11497==    by 0x4CA44E6: std::terminate() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==11497==    by 0x4CA4798: __cxa_throw (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==11497==    by 0x4C9B3BD: std::__throw_out_of_range(char const*) (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==11497==    by 0x135AFD: ??? (in /home/me/multiplayerpiano-server/out)
==11497==    by 0x131EE9: ??? (in /home/me/multiplayerpiano-server/out)
==11497==    by 0x113A64: ??? (in /home/me/multiplayerpiano-server/out)
==11497==    by 0x11A2CF: ??? (in /home/me/multiplayerpiano-server/out)
==11497==    by 0x139EBC: ??? (in /home/me/multiplayerpiano-server/out)
==11497==
==11497== HEAP SUMMARY:
==11497==     in use at exit: 1,022,814 bytes in 3,770 blocks
==11497==   total heap usage: 4,979 allocs, 1,209 frees, 1,172,563 bytes allocated
==11497==
==11497== LEAK SUMMARY:
==11497==    definitely lost: 0 bytes in 0 blocks
==11497==    indirectly lost: 0 bytes in 0 blocks
==11497==      possibly lost: 144 bytes in 1 blocks
==11497==    still reachable: 1,022,670 bytes in 3,769 blocks
==11497==                       of which reachable via heuristic:
==11497==                         stdstring          : 38 bytes in 1 blocks
==11497==         suppressed: 0 bytes in 0 blocks
==11497== Rerun with --leak-check=full to see details of leaked memory
==11497==
==11497== For lists of detected and suppressed errors, rerun with: -s
==11497== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Aborted (core dumped)
nagalun commented 3 years ago

Fixed by f2c91e305533aa7597b6853a0244f837bbefab5c