lyx assertion failed in QList<T>::at: when saving a file

Bug #197950 reported by Haggai Eran
16
Affects Status Importance Assigned to Milestone
lyx (Ubuntu)
Fix Released
Undecided
Unassigned
qt4-x11 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: lyx

Hi,

When I try to save a new file on my machine, lyx crashes with the error:
ASSERT failure in QList<T>::at: "index out of range", file ../../include/QtCore/../../src/corelib/tools/qlist.h, line 386
Aborted (core dumped)

To reproduce:
1. Create a new file.
2. Try to Save.

It crashes right after the dialog box opens.

Regards,
Haggai Eran

Revision history for this message
Bernhard Fisseni (bfisseni) wrote :

The same error (message) can be produced by using Open -> File (or Ctrl-O). Giving a file name at the command line works, though.

Revision history for this message
Guillaume M (diabo-bugreport) wrote :

I can confirm the bug, when opening a file or when saving a new file. This seems related to the QT4 file chooser dialog.

My error is:
"ASSERT failure in QList<T>::at: "index out of range", file ../../include/QtCore/../../src/corelib/tools/qlist.h, line 391
Abandon"

Here's how the bug came on my machine: I had lyx 1.5.1 from a third-party package installed on gutsy, and everything was working fine. Then I upgraded to hardy beta, and my lyx 1.5.1 still didn't have the bug. I did not try lyx 1.5.3 from the repos at that time.
Then I upgraded to hardy final, and then my lyx 1.5.1 crashed on the open file dialog. Then I tried 1.5.3 from the repos and experienced the same crash.
This suggests that it is a QT bug that came between hardy beta and hardy final.

Hope this helps.

Revision history for this message
Guillaume M (diabo-bugreport) wrote :

More on this bug: the file chooser does not always crash -- it only does so when trying to display ~/ (and other dirs, like ~/Desktop on my machine).

Steps to reproduce this behavior:
1. mkdir ~/new
2. cd new
3. lyx foo.lyx
4. trigger the "open file" dialog. At this points, lyx should not crash since the above manipulation should cause the file chooser to start in the ~/new/ directory.
5. go to ~/ with the file chooser. This should cause lyx to crash.

please confirm.

Revision history for this message
Guillaume M (diabo-bugreport) wrote :

This is definitely a qt4 bug as at least one other qt4 application has this bug.

Example: launch qtconfig-qt4. Go to Printers -> Browse...
then the application crashes.

Revision history for this message
Guillaume M (diabo-bugreport) wrote :

Ok, here's a solution for you people. The bug vanished here after removing ~/.config/Trolltech.conf . Hence this seems to be related to a corrupted config file (mayber the file format has changed over time).

Re-creating the file with qtconfig-qt4 and setting everything exactly as it used to be did not cause the bug to reappear.

Please confirm.

Unfortunately, I have deleted my old Trolltech.conf. May somebody do a diff between the corrupted version of Trolltech.conf and a clean version of it, so that we can locate the bug?

Maybe related to bug #161891 .

Revision history for this message
Bernhard Fisseni (bfisseni) wrote :

Confirmed: removing ~/.config/Trolltech.conf helps. Thank you very much!

Revision history for this message
Guillaume M (diabo-bugreport) wrote :

Bad news: the bug just reappeared on my machine. Deleting Trolltech.conf solved the bug again.

qt4 modifies Trolltech.conf when lyx is running, and hence can cause the bug to reappear. Probably a qt4 bug, but this might still be due to an improper use of qt4 by Lyx.

So the bug is NOT solved and only a patch will stop the annoyance.

I've attached the result of $ diff Trolltech.conf.good Trolltech.conf.bad

Revision history for this message
Tritonio (tritonio) wrote :

The very same problem appears when trying to save a gpx file with Qlandkarte. Renaming Trolltech.conf solved the problem. Thank you VERY MUCH for the workaround. :-) It must be a Qt bug because Qlandkarte uses Qt too. Never had this bug with Qlandkarte on ubuntu gutsy. It first appeared on Hardy for me.

Revision history for this message
manuel fernandez (mfg) wrote :

problem with qt4 in several programs. Lyx in particular is no longer working, see:

lyx/+bug/228067

http://bugzilla.lyx.org/show_bug.cgi?id=4835

Revision history for this message
Guillaume M (diabo-bugreport) wrote :

Manuel, I first thought your comment was out of place, but then I realized an update broke my lyx yesterday just like in bug #228067 (see my comment on this bug for more details).

Then I tried my above workaround once again (getting rid of Trolltech.conf) and once again it solved the problems, hence bugs #197950 and #228067 might be related.

However we still need some confirmation, the clues are not clear, all the more as I was working on a self-compiled lyx 1.5.4 and not Ubuntu's.

Revision history for this message
Philip Peitsch (philip-peitsch) wrote :

I can confirm similar behaviour to gadm. Im from bug #228067 . Following these instructions and removing Trolltech.conf caused it to start normally again, but then it starts crashing again as soon as the Trolltech.conf file gets restored.

I'm trying another hack now where I have created an empty Trolltech.conf, but removed write-access to it for everyone. I'll let you know how it went in 10mins or so...

Revision history for this message
manuel fernandez (mfg) wrote :

Gadm, thank you for mentioning that 1.5.4 still has the problem for I was thinking of upgrading to that version.
As I mentioned in bug #228067 renaming /.config/Trolltech.conf does not solve the problem for me

Revision history for this message
Dara Adib (daradib) wrote :

Does the problem still exist with LyX 1.5.5-1 (and updated qt4)?

Changed in lyx:
status: New → Incomplete
Revision history for this message
Tritonio (tritonio) wrote :

@Dara Adib: I used to do the trick with trolltech.conf every time that the problem appeared. In fact I had made a shell script that deleted it every time I ran QLandKarte. The problem did appear really often! Now I tried running QLandKarte several times directly and nothing bad happened when saving and loading files. So it COULD be gone.

Revision history for this message
Tritonio (tritonio) wrote :

Sorry for reposting! I just noticed that the script I wrote for QlandKarte for my Hardy installation DOESN'T contain the deletion command (it merely executes QLandKarte with gksudo)! So actually I haven't deleted trolltech.conf for some months and everything is fine! Which means that the chances are high that the problem is solved!

Revision history for this message
Dara Adib (daradib) wrote :

This bug report is being closed due to your last comment regarding this being currently fixed. Thank you again for taking the time to report this bug and helping to make Ubuntu better. Feel free to submit any future bugs you may find

If you discover that this bug was not fixed, please feel free to set the status of the bug to New.

Changed in lyx:
status: Incomplete → Fix Released
Changed in qt4-x11:
status: New → 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.