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

Pauses after resuming #26

Closed
ivanskodje opened this issue Apr 4, 2017 · 16 comments
Closed

Pauses after resuming #26

ivanskodje opened this issue Apr 4, 2017 · 16 comments

Comments

@ivanskodje
Copy link

When I attach a process, the game automatically pauses. (I guess that is fine)
However, when I press F3 to resume, it takes about 1 second before it pauses again by itself.
If I were to close the memory viewer and press F3 to resume again, it pauses and the memory viewer opens up again.

I do not believe this is intentionally designed to behave like this (I hope).
If there is any additional information I can provide, let me know.

@korcankaraokcu
Copy link
Owner

No, this is not intentionally designed. This only happened to me once and the game was Hearthstone. Some games are known to have some kind of anti-debugging behavior. Could you send me the logfile? It can be found in /tmp/PINCE-connection/pid/gdb_log.txt

Also, could you tell me what output PINCE gives in the terminal when the inferior pauses itself? You should see something like this:

~"1 \"kmines\" received signal SIGINT, Interrupt.\n"
~"0x00007f3132efbb5d in poll () from /lib/x86_64-linux-gnu/libc.so.6\n"
*stopped,reason="signal-received",signal-name="SIGINT",signal-meaning="Interrupt",frame={addr="0x00007f3132efbb5d",func="poll",args=[],from="/lib/x86_64-linux-gnu/libc.so.6"},thread-id="1",stopped-threads="all",core="1"

So, in your case it should read something like:
~"1 \"kmines\" received signal SIGUSR1, Interrupt.\n"
I believe that it's a custom signal.

@korcankaraokcu
Copy link
Owner

Also, forgot to ask. What's the title of the game?

@ivanskodje
Copy link
Author

ivanskodje commented Apr 4, 2017

Game: 7 Days to Die
Logfile: gdb_log.txt

@korcankaraokcu
Copy link
Owner

I can't seem to find something like "received signal bla bla" in that logfile, are you sure that you sent me the logfile after the self-pausing event?

@ivanskodje
Copy link
Author

ivanskodje commented Apr 4, 2017

https://pastebin.com/dh99RkeP
I made sure to try it again, got the pause-issue and closed the program.

@korcankaraokcu
Copy link
Owner

I've found it! received signal SIGPWR, Power fail/restart, there you go. This looks like a gdb-specific error which usually occurs while attaching to processes written with mono. You can try ignoring this signal to continue working on this game. Open the gdb console from top right in the main window(black terminal thingy) and execute this command from there: handle SIGPWR nostop. If that doesn't work try these too: handle SIGPWR pass and handle SIGPWR nopass

Detailed information here

@ivanskodje
Copy link
Author

ivanskodje commented Apr 5, 2017

Very nice.
Although for future improvements: Would it not be beneficial for the majority of users if that was the default? After all, if you are reverse engineering/debugging, you would probably set your own breakpoints and such. :)
(I don't really know, as I have not really been working on that yet)

@korcankaraokcu
Copy link
Owner

In fact I've planned this feature long time ago. See the bottom part of readme file. It reads:

Hearthstone(It interrupts itself with SIGUSR1 whenever continued, implementing signal passing on PINCE might be very useful in future)

So, at last, the future has come! 😃 I'll implement this feature similar to how Ollydbg does. An interface that contains list of signals and radioboxes aligned to them to determine what to do with the signals. The options will be nostop, pass, nopass etc. But I'm going thru a series of exams right now. So, I'll be busy this entire week. Considering the other important bugfixes in the current development plan, expect this feature to be implemented in 2 weeks. Until that day, I'm closing this issue. Thanks for reporting this bug.

@ivanskodje
Copy link
Author

Best of luck on your exams! (I know the pain and suffering you are going through)

@korcankaraokcu
Copy link
Owner

korcankaraokcu commented Apr 19, 2017

I've changed the plan and implemented a solution without touching the settings file.

With this commit, you can now use gdbinit file provided by PINCE to execute any gdb command before attaching to the program. So you should just append handle SIGPWR nostop to the gdbinit file. It can be found in ~/.config/PINCE/PINCE_USER_FILES/gdbinit

I've solved this problem 10 days ago but forgot to tell you, sorry about that. I forget things quickly.

@korcankaraokcu
Copy link
Owner

korcankaraokcu commented Apr 23, 2017

This issue now has its place in the wiki, check here
Edit: Updated the link, wiki page has been updated as well. Init files can now execute libPINCE functions automatically

@korcankaraokcu
Copy link
Owner

korcankaraokcu commented Apr 26, 2022

Settings menu now offers an option to ignore some signals, you don't need to modify init files for those signals anymore. Wiki page of init files has been updated

@ivanskodje
Copy link
Author

I came to search up this problem again, and just happen to find this thread via a ducksearch, only to discover that I was the one that posted this thread! Small world, huh?

Thank you for the fix, going into setting and disabling the signal helped 🥳

@ThubLives
Copy link

Could SIGXCPU be added to the Handle Signals options? I've seen this in more than one Unity game.

@korcankaraokcu
Copy link
Owner

https://superuser.com/a/1185648

You are right, apparently SIGPWR and SIGXCPU are used to trigger the garbage collector in mono runtime. I've added SIGXCPU to the ignore list. Just pull the latest changes, no reinstallation is required, enjoy

@korcankaraokcu
Copy link
Owner

Handle signals menu now includes all signals

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