2.0 installs but crashes on startup

Bug #1360200 reported by Dan Tong
84
This bug affects 11 people
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

Prior version 1.42 worked fine, installed 2.0 without errors, but crashes on startup, no error message except

"The main calibre program has encountered a problem and needs to close. We are sorry for the inconvenience."

I'm running 32 bit version on Windows XP 64 bit. All prior versions worked fine.

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

Similiar issue, but running Kubuntu 14.04.1, get initializing interface and the book shelf splash then it dies. One time I was able to get to see my library but under a minute later it died. As above report, all other versions worked fine.

I will check later or email me and I will run or debug as requested for test and information.

Revision history for this message
Kovid Goyal (kovid) wrote :

Open a command prompt, run the following command and post any output you see:

calibre-debug -g

Changed in calibre:
status: New → Incomplete
Revision history for this message
Max (maxnerwus) wrote :

The same problem: system Windows XP, processor AMD Sempron 2800+, 1GB RAM
Crash, when trying to run new version Calibre, maybe because QT5 and SSE2 instructions?
when trying command calibre-debug -g
not working, similiar screen like in other apps that requires SSE2 processor...

Revision history for this message
Kovid Goyal (kovid) wrote :

Then I suggest you stay with calibre 1.48 as there is nothing I can do about Qt 5 requiring SSE2. Old versions of calibre are available from: http://download.calibre-ebook.com/

Revision history for this message
Kovid Goyal (kovid) wrote :

From the duplicate bug reports, it seems like calibre is crashing on a few linux and a few windows xp systems.

Windows XP: From the crash reports I've seen on windows XP, there doesn't seem to be very much I can do about it as it seems to come from Qt 5. Given that Windows XP is officially unsupported by Microsoft, I suggest you stay with calibre 1.48 on Windows XP if calibre 2.0 is crashing for you, until such time as you decide to update your windows.

Linux: It would help you run calibre in a terminal as

calibre-debug -g

and post the output. Also state what distro of linux you are running on.

Revision history for this message
Kovid Goyal (kovid) wrote :

And note that if you are on linux or windows, you can always go back to the previous calibre release (1.48) instructions for doing that or the windows and linux calibre download pages.

Revision history for this message
Dan Tong (drdancm) wrote :

I ran the debug command and here is the output:
(Calibre 2 32bit run on Windows XP 64 bit)

I don't know how to find out what Linux distribution I'm running, or if the comment applies to me at all.

Revision history for this message
Dan Tong (drdancm) wrote :

I don't know how to collect the output of the debug results, so I just used screen capture to upload the output, but can't seem to view the jpg. If that is no good, how do I "pipe" the output into a text file so I can upload it ?

In the meantime I will go back to v 1.48. Should I uninstall v 2 prior to installing older version ?

Thanks,

Dan

Revision history for this message
Hiro5 (hiro5) wrote :

I have similar problem

Windows XP 32 bit
Install OK
I run calibre, starts the wizard
Language and folder selected, so Next

Then this is where it crashes, I select de Amazon Kindle Touch/1-4 (I have Kindle 3 keyboard, I think that's the device)
and when i do "Next", it crashes

But, if I restart, and re-do the same, but select the default device (generic e-ink device) , it starts OK.

Maybe something is wrong with the detection of the device, I don't know.

Revision history for this message
Kovid Goyal (kovid) wrote :

You collect debug output like this:

calibre-debug -g 1> log.txt 2>&1

And as noted above, you can always re-install 1.48 if you wish. Simply uninstall 2.0 and follow the link on the download page to get the older version's installer.

Revision history for this message
Dan Tong (drdancm) wrote :

Here is the debug output text.

Thanks,

Dan

Revision history for this message
Kovid Goyal (kovid) wrote :

Hmm, nothing suspicious in that log, the errors are simply from third party calibre plugins that have not yet been updated for calibre 2.0

I suspect this is just some fundamental incompatibility between Qt 5 and some windows XP machines. I do have Windows XP running in a virtual machine myself, in which calibre works fine, so it is a little hard for me to be more specific. I suggest you stay with calibre 1.48 until you decide to upgrade your windows. Unfortunately, since Microsoft has dropped support for Windows XP, it is becoming harder to get modern software running on it.

Revision history for this message
Walter de Wilde (wdewilde-1) wrote :

For my Linux Mint system I have solved the problem. My current launcher tried to start Calibre with: "calibte --detach %F".
This leads to Calibre crashing after the splash-screen.
When I change this to "calibre %F" everything works like it should.
Maybe something connected to "--detach"?

Revision history for this message
Kovid Goyal (kovid) wrote :

I'm glad you fixed the problem, but I dont really see what in detach could be causing the issue all detach does is fork(), redirect stdout and stderr to null and call setsid() See https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/__init__.py#L877

If you are willing to do some debugging, let me know and I will give you some debug commands to try to narrow down the problem.

Revision history for this message
Walter de Wilde (wdewilde-1) wrote :

Kovid,

I will be happy to to some debugging.

Kind regards,

Walter

On 08/23/2014 03:24 PM, Kovid Goyal wrote:
> I'm glad you fixed the problem, but I dont really see what in detach
> could be causing the issue all detach does is fork(), redirect stdout
> and stderr to null and call setsid() See
> https://github.com/kovidgoyal/calibre/blob/master/src/calibre/gui2/__init__.py#L877
>
> If you are willing to do some debugging, let me know and I will give you
> some debug commands to try to narrow down the problem.
>

Revision history for this message
Kovid Goyal (kovid) wrote :

Ok first step is to run:

1) calibre-debug -c "from calibre.gui2 import detach_gui; detach_gui(); from calibre.gui2.main import main; main()"

This should crash in exactly the same way as calibre --detach

2) Then run

calibre-debug -c "import os; os.fork() != 0 and sys.exit(0); os.setsid(); from calibre.gui2.main import main; main()"

This does exactly the same thing as detach, except it does not redirect stdout and stderr. Does it crash? And if so, what is the output in the terminal?

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

This is interesting, adding the output below but if I run calibre from the command line, no problems. Just when I run it from an icon, like Cairo-Dock or from the application menu in KDE. So I tinkered a bit, and found the application was being launched with command calibre --detach %F, I removed the %F and still crashed. Removed the --detach and it worked. Running it from command line with the --detach argument also fails to work.

In my case I have a work around, though obviously something is not working 100%.

I have yet to find a way to add it to Cairo again, I get an error about unable to find description file.

calibre 2.0 isfrozen: True is64bit: True
Linux-3.13.0-34-generic-x86_64-with-debian-jessie-sid Linux ('64bit', 'ELF')
('Linux', '3.13.0-34-generic', '#60-Ubuntu SMP Wed Aug 13 15:45:27 UTC 2014')
Python 2.7.8
Linux: ('debian', 'jessie/sid', '')
Starting up...
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Started up in 1.06 seconds with 652 books

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

Kovid, sorry did not notice you working on the detach issue. I tried those commands and it launched fine. See the command and command line output below. Same issue for me, if I use --detach it fails.

bpeckin@Midenheim:~$ calibre-debug -c "from calibre.gui2 import detach_gui; detach_gui(); from calibre.gui2.main import main; main()"
Starting up...
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Started up in 1.10 seconds with 652 books
bpeckin@Midenheim:~$ calibre-debug -c "import os; os.fork() != 0 and sys.exit(0); os.setsid(); from calibre.gui2.main import main; main()"
bpeckin@Midenheim:~$ Starting up...
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Started up in 1.11 seconds with 652 books

Revision history for this message
Kovid Goyal (kovid) wrote :

To confirm,

calibre-debug -c "from calibre.gui2 import detach_gui; detach_gui(); from calibre.gui2.main import main; main()"

does not crash?

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

That is correct, it did not crash. Just ran it again to be sure.

Revision history for this message
Kovid Goyal (kovid) wrote :

OK, try the build I have uploaded here:

http://download.calibre-ebook.com/betas/

To install them download the appropriate tarball (32 or 64 bit) then, assuming you installed calibre in /opt/calibre, run the following command:

    sudo rm -rf /opt/calibre/* && sudo tar xvf /path/to/downloaded/calibre-tarball.txz -C /opt/calibre

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

Ran the install command after downloading the 64 bit version. Same behavior, --detach it shows the shelf then crashes. But with out the --detach it runs normal from what I can tell.

Revision history for this message
Michael Hart (w27pl24) wrote :

Posting here in case this is related. I'm experiencing total system freeze with 2.0 on OSX 10.9.4. Happens right after the splash comes onscreen and nothing but a hard reset gets out. All I see in Console as it launches are some sandbox failure errors. I have third-party apps allowed though and the 1.4 branch runs fine.

Tried wiping all Calibre prefs and folders, and when launching I got prompted to choose my Calibre folder, but after I did so and the splash came up, it locked the machine hard again.

Also tried launching with calibre-debug -g as suggested above, and that displayed no issues other than something to do with a missing or incorrect sRGB profile for a PNG, then the splash came up and system froze again. Tried again but redirecting output to a file on my desktop, system froze again, and the log file was gone after I rebooted.

Not sure what else I can do to isolate the issue.

If you think this is unrelated to the other experiences here, I can open a separate ticket.

Revision history for this message
Kovid Goyal (kovid) wrote :

@Michael Hart: Hmm, I'm somewhat at a loss. calibre is purely user mode, I dont see how it could possibly be causing a complete system crash. One thing I can think of is that in the past people on OS X have had trouble with assistive technology and Qt, try disabling any assistive tech in the system settings, like VoiceOver.

Revision history for this message
Kovid Goyal (kovid) wrote :

@Brett: OK, next debug command:

calibre-debug -c "from calibre.gui2.main import main; import os, sys; os.fork() != 0 and sys.exit(0); os.setsid(); main()"

Revision history for this message
Michael Hart (w27pl24) wrote :

@Kovid: That was it, thank you! I had a screen zoom hotkey enabled without realizing it. Bit of a nasty and unexpected incompatibility there, I hope the QT team figure out a fix for that. Now to enjoy checking out the new release. Thanks again.

Revision history for this message
Walter de Wilde (wdewilde-1) wrote :

Both do not crash.

On 08/23/2014 06:03 PM, Kovid Goyal wrote:
> Ok first step is to run:
>
> 1) calibre-debug -c "from calibre.gui2 import detach_gui; detach_gui();
> from calibre.gui2.main import main; main()"
>
> This should crash in exactly the same way as calibre --detach
>
> 2) Then run
>
> calibre-debug -c "import os; os.fork() != 0 and sys.exit(0);
> os.setsid(); from calibre.gui2.main import main; main()"
>
> This does exactly the same thing as detach, except it does not redirect
> stdout and stderr. Does it crash? And if so, what is the output in the
> terminal?
>

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

@Kovid Think we hit pay dirt, that one is acting similar. Also I get an error on the command line.

Starting up...
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
*** Error in `/opt/calibre/bin/calibre-debug': double free or corruption (fasttop): 0x00007f00700008c0 ***

Revision history for this message
Kovid Goyal (kovid) wrote :

OK so apparently fork() followed by setsid() is causing Qt to die.

Let's see if it is only one of them or both

1) Without fork()

calibre-debug -c "from calibre.gui2.main import main; import os, sys; os.setsid(); main()"

2) Without setsid()

calibre-debug -c "from calibre.gui2.main import main; import os, sys; os.fork() != 0 and sys.exit(0); main()"

Do either of these two crash?

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

@Kovid

1) Without fork(): No crash, no start at all. A few command line errors with it.

calibre-debug -c "from calibre.gui2.main import main; import os, sys; os.setsid(); main()"
Traceback (most recent call last):
  File "site.py", line 51, in main
  File "site-packages/calibre/debug.py", line 228, in main
  File "<string>", line 1, in <module>
OSError: [Errno 1] Operation not permitted

2) Without setsid(), this one crashed. Showed the splash screen and initializing interface and died.

Starting up...
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
*** Error in `/opt/calibre/bin/calibre-debug': double free or corruption (fasttop): 0x00007f71ec0008c0 ***

Revision history for this message
Kovid Goyal (kovid) wrote :

Hmm, it looks like Qt cannot handle a fork() after it is loaded on your machines. I have created a build that forks before loading any qt modules, hopefully that will fix it.

As before, the builds are at http://download.calibre-ebook.com/betas/

To install them download the appropriate tarball (32 or 64 bit) then, assuming you installed calibre in /opt/calibre, run the following command:

    sudo rm -rf /opt/calibre/* && sudo tar xvf /path/to/downloaded/calibre-tarball.txz -C /opt/calibre

Revision history for this message
Brett Peckinpaugh (bp10) wrote :

Now that worked with --detach, so tried it with %F as well. Both worked no crashes yet.

Revision history for this message
Kovid Goyal (kovid) wrote :

Glad to hear it, I am closing this bug report.

Summary:

For linux users experiencing crashes:

In the short term run calibre from a terminal as calibre (without --detach) and the crashes will not occur. The proper fix will be in the next release.

For windows xp users experiencing crashes:

I'm afraid you will have to stay with calibre 1.48 until you are ready to upgrade your windows. I simply cannot get Qt 5 to work well on windows xp, sorry.

Changed in calibre:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.