nagalun / multiplayerpiano-server

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

Server crashes when receiving an invalid message! #16

Closed ghost closed 5 years ago

ghost commented 5 years ago
May 23 00:00:01 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:00:01 ts out[26878]: Set default room color to: 242464
May 23 00:00:01 ts out[26878]: Listening on 0.0.0.0:8443
May 23 00:00:01 ts out[26878]: Password is: ****
May 23 00:00:01 ts out[26878]: New client: 18.***.***.***
May 23 00:00:01 ts out[26878]: Created new room: lobby
May 23 00:00:02 ts out[26878]: New client: 77.***.***.**
May 23 00:00:02 ts out[26878]: User found in database.
May 23 00:00:02 ts out[26878]: New client: 178.**.**.**
May 23 00:00:03 ts out[26878]: Created new room:
May 23 00:04:28 ts out[26878]: Deleted room:
May 23 00:05:30 ts out[26878]: Created new room:
May 23 00:06:09 ts out[26878]: User found in database.
May 23 00:06:09 ts out[26878]: New client: 118.**.**.***
May 23 00:06:29 ts out[26878]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:06:29 ts out[26878]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:06:29 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:06:29 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:06:29 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:06:29 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:06:29 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:06:29 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:06:29 ts out[27483]: Set default room color to: 242464
May 23 00:06:29 ts out[27483]: Listening on 0.0.0.0:8443
May 23 00:06:29 ts out[27483]: Password is: 8888
May 23 00:06:30 ts out[27483]: New client: 77.***.***.**
May 23 00:06:30 ts out[27483]: Created new room: lobby
May 23 00:06:30 ts out[27483]: User found in database.
May 23 00:06:30 ts out[27483]: New client: 178.**.**.**
May 23 00:06:30 ts out[27483]: Created new room:
May 23 00:06:31 ts out[27483]: User found in database.
May 23 00:06:31 ts out[27483]: New client: 118.**.**.***
May 23 00:06:32 ts out[27483]: New client: 18.***.***.***
May 23 00:06:38 ts out[27483]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:06:38 ts out[27483]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:06:38 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:06:38 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:06:38 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:06:38 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:06:38 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:06:38 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:06:38 ts out[27492]: Set default room color to: 242464
May 23 00:06:38 ts out[27492]: Listening on 0.0.0.0:8443
May 23 00:06:38 ts out[27492]: Password is: ****
May 23 00:06:39 ts out[27492]: New client: 77.***.***.**
May 23 00:06:39 ts out[27492]: User found in database.
May 23 00:06:39 ts out[27492]: New client: 118.**.**.***
May 23 00:06:39 ts out[27492]: Created new room: lobby
May 23 00:06:39 ts out[27492]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:06:39 ts out[27492]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:06:39 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:06:39 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:06:39 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:06:39 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:06:39 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:06:39 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:06:39 ts out[27495]: Set default room color to: 242464
May 23 00:06:39 ts out[27495]: Listening on 0.0.0.0:8443
May 23 00:06:39 ts out[27495]: Password is: ****
May 23 00:06:40 ts out[27495]: User found in database.
May 23 00:06:40 ts out[27495]: New client: 118.**.**.***
May 23 00:06:40 ts out[27495]: New client: 77.***.***.**
May 23 00:06:40 ts out[27495]: User found in database.
May 23 00:06:40 ts out[27495]: New client: 178.**.**.**
May 23 00:06:40 ts out[27495]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:06:40 ts out[27495]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:06:40 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:06:40 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:06:40 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:06:41 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:06:41 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:06:41 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:06:41 ts out[27498]: Set default room color to: 242464
May 23 00:06:41 ts out[27498]: Listening on 0.0.0.0:8443
May 23 00:06:41 ts out[27498]: Password is: ****
May 23 00:06:41 ts out[27498]: New client: 18.***.***.***
May 23 00:06:41 ts out[27498]: Created new room: lobby
May 23 00:06:42 ts out[27498]: User found in database.
May 23 00:06:42 ts out[27498]: New client: 118.**.**.***
May 23 00:06:42 ts out[27498]: New client: 77.***.***.**
May 23 00:06:42 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:06:42 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:06:42 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:06:42 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:06:42 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:06:42 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:06:42 ts out[27500]: Set default room color to: 242464
May 23 00:06:42 ts out[27500]: Listening on 0.0.0.0:8443
May 23 00:06:42 ts out[27500]: Password is: ****
May 23 00:06:42 ts out[27500]: New client: 77.***.***.**
May 23 00:06:43 ts out[27500]: Created new room: lobby
May 23 00:06:43 ts out[27500]: User found in database.
May 23 00:06:43 ts out[27500]: New client: 118.**.**.***
May 23 00:06:45 ts out[27500]: New client: 18.***.***.***
May 23 00:06:47 ts out[27500]: User found in database.
May 23 00:06:47 ts out[27500]: New client: 178.**.**.**
May 23 00:06:47 ts out[27500]: Created new room:
May 23 00:09:02 ts out[27500]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:09:02 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:09:02 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:09:02 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:09:02 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:09:02 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:09:02 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:09:02 ts out[27722]: Set default room color to: 242464
May 23 00:09:02 ts out[27722]: Listening on 0.0.0.0:8443
May 23 00:09:02 ts out[27722]: Password is: ****
May 23 00:09:03 ts out[27722]: New client: 77.***.***.**
May 23 00:09:03 ts out[27722]: Created new room: lobby
May 23 00:09:03 ts out[27722]: User found in database.
May 23 00:09:03 ts out[27722]: New client: 118.**.**.***
May 23 00:09:03 ts out[27722]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:09:03 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:09:03 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:09:03 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:09:03 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:09:03 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:09:03 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:09:03 ts out[27726]: Set default room color to: 242464
May 23 00:09:04 ts out[27726]: New client: 118.**.**.***
May 23 00:09:04 ts out[27726]: User found in database.
May 23 00:09:04 ts out[27726]: New client: 178.**.**.**
May 23 00:09:04 ts out[27726]: New client: 77.***.***.**
May 23 00:09:04 ts out[27726]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:09:04 ts out[27726]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:09:04 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:09:04 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:09:04 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:09:05 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:09:05 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:09:05 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:09:05 ts out[27728]: Set default room color to: 242464
May 23 00:09:05 ts out[27728]: Listening on 0.0.0.0:8443
May 23 00:09:05 ts out[27728]: Password is: ****
May 23 00:09:05 ts out[27728]: New client: 18.***.***.***
May 23 00:09:05 ts out[27728]: Created new room: lobby
May 23 00:09:05 ts out[27728]: User found in database.
May 23 00:09:05 ts out[27728]: New client: 118.**.**.***
May 23 00:09:06 ts out[27728]: New client: 77.***.***.**
May 23 00:09:06 ts out[27728]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:09:06 ts out[27728]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:09:06 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:09:06 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:09:06 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:09:06 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:09:06 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:09:06 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:09:06 ts out[27731]: Set default room color to: 242464
May 23 00:09:06 ts out[27731]: Listening on 0.0.0.0:8443
May 23 00:09:06 ts out[27731]: Password is: ****
May 23 00:09:07 ts out[27731]: New client: 77.***.***.**
May 23 00:09:07 ts out[27731]: Created new room: lobby
May 23 00:09:07 ts out[27731]: User found in database.
May 23 00:09:07 ts out[27731]: New client: 118.**.**.***
May 23 00:09:07 ts out[27731]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:09:07 ts out[27731]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:09:07 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:09:07 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:09:07 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:09:07 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:09:07 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:09:07 ts systemd[1]: Started Multiplayer Piano Server.
May 23 00:09:07 ts out[27733]: Set default room color to: 242464
May 23 00:09:07 ts out[27733]: Listening on 0.0.0.0:8443
May 23 00:09:07 ts out[27733]: Password is: ****
May 23 00:09:08 ts out[27733]: New client: 77.***.***.**
May 23 00:09:08 ts out[27733]: Created new room: lobby
May 23 00:09:08 ts out[27733]: User found in database.
May 23 00:09:08 ts out[27733]: New client: 118.**.**.***
May 23 00:09:08 ts out[27733]: terminate called after throwing an instance of 'nlohmann::detail::parse_error'
May 23 00:09:08 ts out[27733]:   what():  [json.exception.parse_error.101] parse error at 1: syntax error - invalid literal; last read: 'u'
May 23 00:09:08 ts systemd[1]: mpp-server.service: Main process exited, code=killed, status=6/ABRT
May 23 00:09:08 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:09:08 ts systemd[1]: mpp-server.service: Failed with result 'signal'.
May 23 00:09:08 ts systemd[1]: mpp-server.service: Service hold-off time over, scheduling restart.
May 23 00:09:08 ts systemd[1]: Stopped Multiplayer Piano Server.
May 23 00:09:08 ts systemd[1]: mpp-server.service: Start request repeated too quickly.
May 23 00:09:08 ts systemd[1]: Failed to start Multiplayer Piano Server.
May 23 00:09:08 ts systemd[1]: mpp-server.service: Unit entered failed state.
May 23 00:09:08 ts systemd[1]: mpp-server.service: Failed with result 'start-limit-hit'.
nagalun commented 5 years ago

I guess nlohmann's lib changed the exception type thrown when parsing fails on some update and I didn't notice. Easy fix here: https://github.com/nagalun/multiplayerpiano-server/blob/master/src/server.cpp#L474

nagalun commented 5 years ago

Should be fixed now with 1.1.1