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

Ignore broken pipe / SIGPIPE signal to avoid crash #11475

Merged
merged 2 commits into from
Oct 17, 2018

Conversation

pleonex
Copy link
Contributor

@pleonex pleonex commented Oct 16, 2018

Every time I enabled the remote debugger setting, the emulator crashed immediately. Even without running any game. Also, it started to crash on the start-up, without showing the UI yet. In all cases the crash was because a broken pipe (SIGPIPE).

I am running Linux (Fedora 28) and the issue affects to both QT and SDL versions. Tested with the latest commit of master branch.

Thanks @unknownbrackets for suggesting the fix!
The issue is fixed by ignoring the SIGPIPE signal in the send call. The error is still returned as EPIPE so it can be handled without crashing the whole application.

Stacktrace:

Thread 3 "Downloader::Do" received signal SIGPIPE, Broken pipe.
#0  0x00007ffff7bc808e in send () from /lib64/libpthread.so.0
#1  0x00000000008fd8ad in Buffer::FlushSocket (this=0x7fffc7ffe5b0, sock=26) at /lab/romhacking/emulators/ppsspp/ext/native/base/buffer.cpp:146
#2  0x0000000000921ef0 in http::Client::SendRequestWithData (this=0x7fffc7ffe780, method=0x1231eb5 "GET", resource=0x7fffc7ffe8c0 "/version.json", data="", otherHeaders=0x1231e90 "Accept: */*\r\nAccept-Encoding: gzip\r\n", progress=0x206
6540) at /lab/romhacking/emulators/ppsspp/ext/native/net/http_client.cpp:286
#3  0x0000000000921dc0 in http::Client::SendRequest (this=0x7fffc7ffe780, method=0x1231eb5 "GET", resource=0x7fffc7ffe8c0 "/version.json", otherHeaders=0x1231e90 "Accept: */*\r\nAccept-Encoding: gzip\r\n", progress=0x2066540) at /lab/rom
hacking/emulators/ppsspp/ext/native/net/http_client.cpp:263
#4  0x000000000092197d in http::Client::GET (this=0x7fffc7ffe780, resource=0x7fffc7ffe8c0 "/version.json", output=0x2066548, responseHeaders=std::vector of length 0, capacity 0, progress=0x2066540, cancelled=0x20665a6) at /lab/romhacking
/emulators/ppsspp/ext/native/net/http_client.cpp:208
#5  0x0000000000921a75 in http::Client::GET (this=0x7fffc7ffe780, resource=0x7fffc7ffe8c0 "/version.json", output=0x2066548, progress=0x2066540, cancelled=0x20665a6) at /lab/romhacking/emulators/ppsspp/ext/native/net/http_client.cpp:228
#6  0x0000000000922b3a in http::Download::Do (this=0x2066540, self=std::shared_ptr<http::Download> (use count 4, weak count 0) = {...}) at /lab/romhacking/emulators/ppsspp/ext/native/net/http_client.cpp:457

pleonex and others added 2 commits October 16, 2018 22:57
Only Linux seems to support it.
For other OSes we set to the default value 0x00 to do nothing.
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

Successfully merging this pull request may close these issues.

2 participants