3

To be more specific, here's the situation.

I was working on MyPaint from a blank document and, after a few hours during which I didn't save anything (of course…) the program freezed. I didn't close it.

In the MyPaint autosave directory, the file is corrupted (1,4 ko only).

So, I was wondering if I can dump the file from the RAM (the process is still running) and how.

Thank you.

2 Answers 2

2

Slightly better than saving memory would be to have the program save your work for you.

First obtain the pid (process ID) of the running program. This can be done from a command line with the ps command:

$ ps x
  PID TTY      STAT   TIME COMMAND
(... lots of usual programs omitted)
 3039 ?        Sl    40:59 /usr/lib/someprogram
...
30263 pts/8    R+     0:00 ps x

Let's say I wanted to trigger someprogram to clean up and save the files, assuming it is a professional grade program (try each in sequence until one works):

$ kill -HUP 3039        # trigger the program's "terminal disconnect by hang up"
                        #  logic (which might save the file)
$ kill -INT 3039        # Interrupt
$ kill -STOP 3039       # Stop
$ kill -CONT 3039       # Continue

A more-grasping-at-straws approach would be to have the program's memory written to a core file. Then at least, someone familiar with the internals of MyPaint could load it into the debugger and reconstruct the data for subsequent use. This is "hard" though and will involve hours to days of expert attention.

To dump core, try these. Core dumps might not be enabled in your system's configuration.

$ kill -ABRT 3039       # abort
$ kill -QUIT 3039       # quit
$ kill -SEGV 3039       # illegal memory access
$ kill -TRAP 3039
1
  • I don't know exactly how but finally MyPaint unfroze an hour ago… but I will try your tip on a brand new file tomorrow. For the record, I find PID using pgrep -l programname.
    – Hyogapag
    May 29, 2014 at 22:34
1

you may know that ram doesnt save any files. so you wont be able to recover anything from it. i reccomend to start redoing it and save frequentley next time(or setup a script to autosave for you). im very sorry, but there isnt anything else you can do to recover it(as far as i know).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .