How to fix crashes on startup: Difference between revisions

From RawPedia
Jump to navigation Jump to search
(Updated)
(Major update)
Line 5: Line 5:
To find the cause of the problem, we will begin with the least invasive and most informative steps, and escalate up to the most destructive steps if the informative ones do not help.
To find the cause of the problem, we will begin with the least invasive and most informative steps, and escalate up to the most destructive steps if the informative ones do not help.


# First, have RawTherapee use a different startup folder:
# First, try having RawTherapee use an empty startup folder:
## Create a new empty folder somewhere on your disk,
##: Windows: <code>C:\\test</code>
##: Linux: <code>/home/you/test</code>
## Find the "options" file as described in the [[File paths]] page.
## Find the "options" file as described in the [[File paths]] page.
## Open the "options" file in a text editor like [http://notepad-plus-plus.org/ Notepad++] and see what these two lines are:
## Open the "options" file in a text editor,
##: <code>StartupDirectory=last</code>
##: find the <code>StartupDirectory</code> line and set it to <code>StartupDirectory=last</code>
##: <code>StartupPath=C:\\Documents and Settings\\Administrator</code>
##: find the <code>StartupPath</code> line and set it to point to the empty folder you just created (it must be an '''existing''', '''empty''' folder, and you have to type the whole, absolute path, no shortcuts, with double back-slashes if you use Windows) e.g.
## Make sure the first one is
##: Windows: <code>StartupPath=C:\\test</code>
##: <code>StartupDirectory=last</code>
##: Linux: <code>StartupPath=/home/you/test</code>
## Create a new empty directory somewhere on your disk,
## Now try starting RawTherapee again. If it works, then you know that one of the photos, PP3 files or other files in the original <code>StartupPath</code> is faulty, so skip step 2 and jump straight to step 3. However, if RawTherapee still crashes right after starting, proceed to the next step.
##: Windows: <code>C:\\foo</code>
##: Linux: <code>/home/bob/foo</code>
## Change the <code>StartupPath=</code> argument to the directory you just created (it must be an '''existing''' directory which does not contain any photos or PP3 files, and you have to type the whole, absolute path, no shortcuts, with double back-slashes if you use Windows) e.g.
##: Windows: <code>StartupPath=C:\\foo</code>
##: Linux: <code>StartupPath=/home/bob/foo</code>
## Now try starting RawTherapee again. If it works, then you know that one of the photos or PP3 files in the original <code>StartupPath</code> is faulty, so skip step 2 and jump straight to step 3. However, if RawTherapee still crashes right after starting, proceed to the next step.
# Delete the <code>batch</code> folder:
# Delete the <code>batch</code> folder:
## Find the "batch" folder as described in the [[File paths]] page, and delete it.
## Find the "batch" folder as described in the [[File paths]] page, zip all of the files it contains if there are any, and then delete the folder.
## Now try starting RawTherapee again. If it works, then you know that one of the processing profiles of the photos you sent to the Queue is faulty. Finding which one would be a pain in the ass and I wouldn't bother, but if you really want to, then the next main point section "Nail it down" applies. If it doesn't work, then the problem is not a faulty photo or PP3, the problem lies elsewhere, outside the scope of this guide.
## Try starting RawTherapee again. If it works, then you know that one of the processing profiles of the photos you sent to the Queue is faulty. Include the zip archive in your [[How_to_write_useful_bug_reports|bug report]]. If it still crashes, proceed to the next step.
# Delete the <code>cache</code> folder:
# Delete the <code>cache</code> folder:
## Find the "cache" folder as described in the [[File paths]] page.
## Find the "cache" folder as described in the [[File paths]] page.
## Move (cut) the <code>cache</code> directory elsewhere, somewhere where RawTherapee will not look. Instead of moving it you can just delete this <code>cache</code> directory, but be warned: if you set RawTherapee to only store processing profiles (PP3) in the cache, then you will lose your tweaks. You will not lose any photos. If you do not know whether you did, then you did not, because by default RT stores processing profiles alongside the raw files, not in the cache.
## Delete the cache folder or rename it if you don't want to lose the contents (renaming it from "cache" to "cache2" is enough, RawTherapee will only look for "cache" and not find it). Note that by default RawTherapee stores processing profiles alongside the images they apply to so it is safe to delete the cache, but if you set RawTherapee to only store processing profiles in the cache and nowhere else then by deleting the cache you would lose your tweaks - in that case you may prefer renaming it instead of deleting it. Regardless of the PP3 setting, you will not lose any photos.
## Now try starting RawTherapee again. If it works, then you know that one of the processing profiles files in the cache is faulty. Finding which one would be a pain in the ass and I wouldn't bother, but if you really want to, then the next main point section "Nail it down" applies. If it doesn't work, then the problem is not a faulty photo or PP3, the problem lies elsewhere, outside the scope of this guide.
## Try starting RawTherapee again. If it works then you know that one of the processing profiles files in the cache is faulty. Finding which one requires considerable effort. If you really want to, and you haven't deleted the cache folder, then follow the "Nail it down" section. If RawTherapee still crashes on startup at the same point as before then the problem is not a faulty photo or PP3 file, the problem lies elsewhere, outside the scope of this guide.
# Nail it down
# Nail it down
#:You've established that either a processing profile or photo is to blame for the crash. It would be most helpful if you could nail the problem down to a specific file, so that we can analyze it and develop techniques for dealing with such an enemy. See the [[How_to_write_useful_bug_reports#When_RawTherapee_crashes_-_An_introduction_to_stack_backtraces|guide to stack-backtraces]]. If you can follow those instructions, a backtrace would be of great value, yet even a backtrace might not expose the problematic file, so read on. By now you should know which directory contains the faulty file(s) and you should have either set RawTherapee to start up using a different directory, or you have moved the cache out somewhere else. To make it clear, let us assume three things:
## A stack backtrace would most likely tell us everything we need to know, including the name of the faulty file and/or where to find the problem in the code. See the [[How_to_write_useful_bug_reports#When_RawTherapee_crashes_-_An_introduction_to_stack_backtraces|guide to stack-backtraces]]. The instructions may seem complicated but they are simple to follow and it would be of tremendous help if you did follow them. Sending us a stack backtrace in most cases is enough. However in some rare cases we may need you to find and send us the specific file which is causing the problem - if that's the case, read on.
#* That the directory which contains a file that crashes RawTherapee is <code>C:\photos\bugs</code> and that your options file had <code>StartupPath=C:\\photos\\bugs</code>
## You've established that a processing profile, a photo or some other file is to blame for the crash. The previous steps should reveal where this file is. You could just zip that whole folder and send us the zip archive, that would be easy for you. Sending the faulty file(s) to us is important so that we can analyze them and develop techniques for dealing with such files in the future. But if you send us a zip archive with a thousand files and the problem is caused by a single file, it would be very difficult for us to find the specific file - in that case it could be easier for you to find it. To make the procedure clear, let us assume three things:
#* That you changed <code>StartupPath=C:\\photos\\bugs</code> in the "options" file to the existing and empty <code>StartupPath=C:\\foo</code>
#* That the folder which contains the file which crashes RawTherapee is <code>C:\photos\paris</code> and that your options file had <code>StartupPath=C:\\photos\\paris</code>
#* That there are 100 photos in the faulty directory, <code>001.raw</code> - <code>100.raw</code>
#* That you changed <code>StartupPath=C:\\photos\\paris</code> in the "options" file to the existing and empty <code>StartupPath=C:\\test</code> folder.
#* That there are 100 photos in the faulty folder, <code>001.raw</code> - <code>100.raw</code>
#: Let's find the faulty file:
#: Let's find the faulty file:
## This is grunt work. I use raw files as examples, but in your case it might be the processing profiles, not the raw files. Or it might be JPEG files, PNG files, or any other file in the faulty dir. What we're going to do is to keep halving the pool of possibilities until we find the problem. This is the fastest way.
## This is grunt work. This guide assumes raw files as an example, but in your case it might be the processing profiles, downloaded images, printer ICC profiles, or other files. What you will now do is to keep halving the pool of possibilities until we find the problem. This is the fastest way.
## If RawTherapee is running, close it.
## If RawTherapee is running, close it.
## Move half of the files (<code>001.raw</code> - <code>050.raw</code>) from this problematic directory (<code>C:\photos\bugs</code>) back into a directory that RawTherapee reads (<code>C:\foo</code>)
## Move half of the files (<code>001.raw</code> - <code>050.raw</code>) from this problematic folder (<code>C:\photos\paris</code>) back into a folder that RawTherapee reads (<code>C:\test</code>)
## Start RawTherapee.
## Start RawTherapee.
## If it crashed, go to the next step. If it did not crash, then go back to step 4.3, but move the other half (<code>051.raw</code> - <code>100.raw</code>).
## If it crashed, go to the next step. If it did not crash, then go back to step 4.3, but move the other half (<code>051.raw</code> - <code>100.raw</code>).
## Move half of the files you just moved (<code>001.raw</code> - <code>025.raw</code> or <code>051.raw</code> - <code>075.raw</code>) out from <code>C:\foo</code> and back into the directory which RawTherapee doesn't read (<code>C:\photos\bugs</code>).
## Move half of the files you just moved (<code>001.raw</code> - <code>025.raw</code> or <code>051.raw</code> - <code>075.raw</code>) out from <code>C:\test</code> and back into the folder which RawTherapee doesn't read (<code>C:\photos\paris</code>).
## Jump back to step 4.4. Repeat until you find the faulty file.
## Jump back to step 4.4. Repeat until you find the faulty file.


Zip this faulty file (even if it's a text PP3 file, because zipping it will prevent any website from touching it and possibly removing the cause of the crash [it could be something you can't see]), upload it to [http://filebin.net/ FileBin] and link us to it in the [http://rawtherapee.com/forum/ Forum].
Zip this faulty file. Even if it's a plain-text PP3 file, you must zip it because often websites change uploaded files in ways you don't see, and we don't want a website touching this faulty file in any way as in doing so it might remove or obscure the problem. Zip files are safe containers. Upload the zip file using [http://filebin.net/ FileBin] and send us the link in your [[How_to_write_useful_bug_reports|bug report]] or in the [https://discuss.pixls.us/c/software/rawtherapee forum] (preferably a bug report), along with the stack backtrace and other required information described in the guide "[[How to write useful bug reports]]".

Revision as of 17:31, 5 January 2017

RawTherapee might crash immediately after starting for several reasons, the common ones being that it tries to open a file which looks like an image but is not an image, it tries to open a corrupt or unsupported image or it tries to load a problematic processing profile (PP3, they store all the tweaks you make in RawTherapee, one PP3 per photo). Even a normal photo could be problematic if it is corrupt or if it triggers a bug in RawTherapee or some aspect of it is unsupported, such as unusual character encoding of the metadata, multiple layers in an image, has four channels, etc.

RawTherapee supports images with either one channel (grayscale) or three channels (RGB or CMY). If you try opening a folder which contains images with four color channels (e.g. CMYK) RawTherapee show an error popup. Move these incompatible images out from the startup directory elsewhere, as described below. Of course it might be a valid RGB photo or processing profile which crashes RawTherapee, but first check for images with an unsupported number of channels.

To find the cause of the problem, we will begin with the least invasive and most informative steps, and escalate up to the most destructive steps if the informative ones do not help.

  1. First, try having RawTherapee use an empty startup folder:
    1. Create a new empty folder somewhere on your disk,
      Windows: C:\\test
      Linux: /home/you/test
    2. Find the "options" file as described in the File paths page.
    3. Open the "options" file in a text editor,
      find the StartupDirectory line and set it to StartupDirectory=last
      find the StartupPath line and set it to point to the empty folder you just created (it must be an existing, empty folder, and you have to type the whole, absolute path, no shortcuts, with double back-slashes if you use Windows) e.g.
      Windows: StartupPath=C:\\test
      Linux: StartupPath=/home/you/test
    4. Now try starting RawTherapee again. If it works, then you know that one of the photos, PP3 files or other files in the original StartupPath is faulty, so skip step 2 and jump straight to step 3. However, if RawTherapee still crashes right after starting, proceed to the next step.
  2. Delete the batch folder:
    1. Find the "batch" folder as described in the File paths page, zip all of the files it contains if there are any, and then delete the folder.
    2. Try starting RawTherapee again. If it works, then you know that one of the processing profiles of the photos you sent to the Queue is faulty. Include the zip archive in your bug report. If it still crashes, proceed to the next step.
  3. Delete the cache folder:
    1. Find the "cache" folder as described in the File paths page.
    2. Delete the cache folder or rename it if you don't want to lose the contents (renaming it from "cache" to "cache2" is enough, RawTherapee will only look for "cache" and not find it). Note that by default RawTherapee stores processing profiles alongside the images they apply to so it is safe to delete the cache, but if you set RawTherapee to only store processing profiles in the cache and nowhere else then by deleting the cache you would lose your tweaks - in that case you may prefer renaming it instead of deleting it. Regardless of the PP3 setting, you will not lose any photos.
    3. Try starting RawTherapee again. If it works then you know that one of the processing profiles files in the cache is faulty. Finding which one requires considerable effort. If you really want to, and you haven't deleted the cache folder, then follow the "Nail it down" section. If RawTherapee still crashes on startup at the same point as before then the problem is not a faulty photo or PP3 file, the problem lies elsewhere, outside the scope of this guide.
  4. Nail it down
    1. A stack backtrace would most likely tell us everything we need to know, including the name of the faulty file and/or where to find the problem in the code. See the guide to stack-backtraces. The instructions may seem complicated but they are simple to follow and it would be of tremendous help if you did follow them. Sending us a stack backtrace in most cases is enough. However in some rare cases we may need you to find and send us the specific file which is causing the problem - if that's the case, read on.
    2. You've established that a processing profile, a photo or some other file is to blame for the crash. The previous steps should reveal where this file is. You could just zip that whole folder and send us the zip archive, that would be easy for you. Sending the faulty file(s) to us is important so that we can analyze them and develop techniques for dealing with such files in the future. But if you send us a zip archive with a thousand files and the problem is caused by a single file, it would be very difficult for us to find the specific file - in that case it could be easier for you to find it. To make the procedure clear, let us assume three things:
    • That the folder which contains the file which crashes RawTherapee is C:\photos\paris and that your options file had StartupPath=C:\\photos\\paris
    • That you changed StartupPath=C:\\photos\\paris in the "options" file to the existing and empty StartupPath=C:\\test folder.
    • That there are 100 photos in the faulty folder, 001.raw - 100.raw
    Let's find the faulty file:
    1. This is grunt work. This guide assumes raw files as an example, but in your case it might be the processing profiles, downloaded images, printer ICC profiles, or other files. What you will now do is to keep halving the pool of possibilities until we find the problem. This is the fastest way.
    2. If RawTherapee is running, close it.
    3. Move half of the files (001.raw - 050.raw) from this problematic folder (C:\photos\paris) back into a folder that RawTherapee reads (C:\test)
    4. Start RawTherapee.
    5. If it crashed, go to the next step. If it did not crash, then go back to step 4.3, but move the other half (051.raw - 100.raw).
    6. Move half of the files you just moved (001.raw - 025.raw or 051.raw - 075.raw) out from C:\test and back into the folder which RawTherapee doesn't read (C:\photos\paris).
    7. Jump back to step 4.4. Repeat until you find the faulty file.

Zip this faulty file. Even if it's a plain-text PP3 file, you must zip it because often websites change uploaded files in ways you don't see, and we don't want a website touching this faulty file in any way as in doing so it might remove or obscure the problem. Zip files are safe containers. Upload the zip file using FileBin and send us the link in your bug report or in the forum (preferably a bug report), along with the stack backtrace and other required information described in the guide "How to write useful bug reports".