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

segfault with fresh 1.5 build, entering online game (local game works fine) #11

Open
clort81 opened this issue Sep 6, 2019 · 14 comments

Comments

@clort81
Copy link

clort81 commented Sep 6, 2019

``Using server ziz.gp2x.de/hase/server17 with Version 17
Thread 1 "hase" received signal SIGSEGV, Segmentation fault.
0x0000555555563eca in start_lobby_game (font=0x55555588db40, resize=0x5555555579a5 , game=0x0,
spectate=0) at lobbyGame.c:1331
1331 after_start = (game->status != 0);
(gdb) bt
#0 0x0000555555563eca in start_lobby_game (font=0x55555588db40, resize=0x5555555579a5 , game=0x0,
spectate=0) at lobbyGame.c:1331
#1 0x000055555555e5c0 in ll_calc (steps=10) at lobbyList.c:296
#2 0x0000555555587f8a in spLoop ()
#3 0x000055555555f052 in start_lobby (font=0x55555588db40, resize=0x5555555579a5 , start_chat=1)
at lobbyList.c:541
#4 0x00005555555587d6 in main (argc=1, argv=0x7fffffffe078) at lobby.c:285

@clort81
Copy link
Author

clort81 commented Sep 6, 2019

if i print after_start, gdb says it's zero / 0, so if i change
after_start = (game->status != 0); to
after_start = 0; //temptest
the next segfault comes line 1342
1342 (game->local == 1 && text_box(font,resize,"Enter player name:",gop_username(),32,1,NULL,0) == 1)

so looks like game has a null pointer... why this?
(gdb) print game $1 = (pGame) 0x0

@pocak100
Copy link
Contributor

pocak100 commented Sep 7, 2019

It's because the server is not working properly, and replies Internal Server Error.

So we have in create_game() in line 499 of client.c :
result = sendMessage(message,NULL,NULL,0,"create_game.php",hase_url);

sendMessage sends POST /hase/server17/create_game.php HTTP/1.1 etc.
The server replies

HTTP/1.1 500 Internal Server Error
Date: Sat, 07 Sep 2019 20:30:57 GMT
Server: Apache/2.4.38
X-Powered-By: PHP/7.0.33-10+0~20190807.18+debian10~1.gbp5452d8
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Content-Type-Options: nosniff
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

1


0

result becomes NULL and thus create_game returns NULL, which is then used in ll_calc() without checking if it's valid.

@clort81
Copy link
Author

clort81 commented Sep 10, 2019

So to start a game maybe I can host own server? Anyone interested in tweaking hase to make it easy to do?

@theZiz
Copy link
Owner

theZiz commented Sep 10, 2019

Hey guys, I don't have time to dig into this null pointer bug, but at least the server is working again :)

@pocak100
Copy link
Contributor

Er, I'm still getting Internal Server Error responses...

@theZiz
Copy link
Owner

theZiz commented Sep 10, 2019

No Internal Server Error anymore but a crash instead. >.< I will see what I can do. 😉

@theZiz
Copy link
Owner

theZiz commented Sep 19, 2019

Okay, no crash for me anymore, but still an internal server error at ed's site and I know now why: I am using mysql_connect which is not supported by php7 anymore. -_-

Let's see what I can do 😃

@clort81
Copy link
Author

clort81 commented Oct 8, 2019

Thank you for your time theZiz.

How often does Hase really need to communicate with other players? Could turn-data be sent to other players in a private irc channel, so the game can run serverless?

@theZiz
Copy link
Owner

theZiz commented Oct 24, 2019

@clort81 Technically that would be possible, but is still not serverless. A irc server is a server, too. However as I did not receive an answer from the server owner yet and I have my own homeserver running in my apartment I will move the hase server to my own hardware afap. Unfortunately that does not mean a lot as I have not very much spare time atm. But I will keep you updated!

@clort81
Copy link
Author

clort81 commented Dec 9, 2019

Still no luck with server. And starting a local game in gdb gives me:

`[New Thread 0x7fb5ed6130 (LWP 7081)]
Try to open Sound: Success
8 channels are avaible as default
Load mapping...
Save mapping...
Load mapping...
Save mapping...
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

Thread 1 "hase" received signal SIGINT, Interrupt.
__GI_raise (sig=) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 __GI_raise (sig=) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x000000555555c3b8 in create_game (game_name=0x5555610140 "New game", options=125841442,
seconds_per_turn=45,
level_string=0x7fffffea30 "4 16o 16orz qb akz o9 4y*h2 rt 18^on fv l1 o8 of k7^nh er lu f8 mm f8-^ve uj xr u1 ve uj#dk m0 gu m7 h1 ix dr iq#eh o5 ho sp m9 pi j1 kx#hk r0 qy pe pc g0 fy hm", local=1,
hares_per_player=3) at client.c:506
#2 0x000000555555a6e0 in main (argc=1, argv=0x7fffffeda8) at lobby.c:263
`

@theZiz
Copy link
Owner

theZiz commented Dec 12, 2019

I just released a new version. Hopefully this is working for you now. :)

@clort81
Copy link
Author

clort81 commented Aug 26, 2020

thanks ziz! hope your year is going well (cough)

Currently online games are broken again
0x0040dbc0 in start_lobby_game (font=0x6ec718, resize=0x402969 , game=0x0, spectate=0)
at lobbyGame.c:1331
1331 after_start = (game->status != 0);
Right after i finally persuaded some friends to try hase :)

Of course i can host my own server, which maybe i should have been doing for a long time anyway.

@theZiz
Copy link
Owner

theZiz commented Oct 6, 2020

Okay, I just checked, to server works. And my hase build, too. Can you try to most recent version?

Sorry for the late response. I got a new job and it's quite exhausting. Hope to be able to increase my response time in the future... :\

Please make also sure that hase sets up the right server. It should do this automatically but well this is quite untested. 🙄 So in your config.ini (probably in $HOME/.config/hase) should be this line:

server: hase.schmidt-matthes.de/hase.php

@clort81
Copy link
Author

clort81 commented Oct 7, 2020

Thanks for response theZiz. I occasionally try to insist that friends try Hase. I'm stubborn like that :) Will give it a try by the weekend. And hopefully get a package finished. We still have SDL problems on leste.

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

No branches or pull requests

3 participants