bugGNU TeXmacs - Bugs: bug #40676, Fatal error during automatic...


You are not allowed to post comments on this tracker with your current authentication level.

bug #40676: Fatal error during automatic generation of website

Submitted by:  Joris van der Hoeven <vdhoeven>
Submitted on:  Fri 22 Nov 2013 05:23:31 PM UTC  
Category:  Qt port Priority:  9 - Immediate
Item Group:  Error Status:  Ready For Test
Privacy:  Public Assigned to:  Miguel de Benito <mdbenito>
Originator Name:  Open/Closed:  Closed
Release:  Release:  None
Fixed Release:  None Fixed Release: 

( Jump to the original submission)

Tue 28 Feb 2017 08:38:19 PM UTC, comment #8:

this seems fixed, although it may be hard to understand why since there were so many changes. Closing, for clarity.

Philippe Joyez <pjoyez>
Project Member
Mon 23 Mar 2015 10:02:55 AM UTC, comment #7:

Now with attached files

(file #33428)

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon 23 Mar 2015 10:02:08 AM UTC, comment #6:

Using r9065 I undid the change to the DEC_COUNT_NULL macro in basic.cpp. Then, using the attached files I created a website with Tools->Create website. No crash.
I've also tried to crash TeXmacs with the procedure reported in


but haven't succeeded. A cursory scan of the log reveals that since this thread was started many changes have been made to the Qt code, including usage of QPointers for QActions, several leaks fixed, wrapping of some raw pointers and better deletion of objects.

I don't have the time to "bisect" the history to find out which commit fixed it, but it seems like this particular problem at least is solved. I will test further and report back again in a while.

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Fri 06 Dec 2013 06:14:54 PM UTC, comment #5:

The idea to set the rep field to NULL may temporarily hide the bug, but I doubt that it constitutes a genuine fix. We really need to understand what is going on. The change in the DEC_ macro also is not harmless to the execution speed and size of the produced binary.

Joris van der Hoeven <vdhoeven>
Project Administrator
Fri 06 Dec 2013 03:58:06 PM UTC, comment #4:

Ok, that previous comment ends up with some garbled stuff from previous versions (this tracker sucks...)

I meant to say that a quick and harmless (?) fix is to set the rep field to NULL in the DEC_* macros in basic.cpp. This is done in commit 8043 and fixes the previous problem. Now I really am unable to crash TeXmacs opening and closing buffers and windows.

However, I'd still like to know what was going on...

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Fri 06 Dec 2013 03:52:19 PM UTC, comment #3:

Sadly, there are still ways to crash texmacs which are related to this bug:

  • Open TeXmacs.
  • Open new window.
  • Create new buffer in window 2.
  • Close the new buffer.
  • Click the close button of window 2.
  • Dead.

The crash happens during deletion of QTMWidget, triggered by the deletion of the qt_window_widget inside kill_window(): QTMWidget's smartpointer to its owning qt_simple_widget_rep goes out of scope and tries to delete (again) this object. Either

  • we are directly deleting some editor_rep* somewhere before,
  • or we have a copy of the simple_widget_rep* (is this possible?)
  • or ?

A "solution" is to set the rep field to NULL after tm_delete() in the macros DEC_COUNT_NULL. I think this can do no harm, so

during execution of qt delayed commands in qt_gui. Some have a qt_simple_widget_rep* as payload in their blackboxes which has already been deleted by the time the command

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Wed 04 Dec 2013 07:22:16 PM UTC, comment #2:

I seem to have been wrong about sync errors. I have seen none after commit 7972. I've also recently uncommented the tm_delete<view> in Texmacs/Data/new_view.cpp and things work fine.

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Mon 02 Dec 2013 09:58:21 AM UTC, comment #1:

There's a fix for the crash in commit 7972: QWidgets were being deleted once manually and again via the layout (note: QLayout::removeWidget() does NOT alter ownership, one has to takeAt(), delete the widget and the QLayoutItem for that.)

However, "synchronization errors" still happen (quite) sporadically and are caught by the Pokemon catcher. I have seen no instability afterwards.

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Fri 22 Nov 2013 05:23:31 PM UTC, original submission:

Create a directory with two non trivial TeXmacs documents. Next convert the directory to Html using Tools -> Web -> Create web site. In the Qt version, this causes TeXmacs to crash. It seems that the crash is due to a change in revision 5549. I investigated a bit, but even the new exception handling mechanism is not able to catch this bug. So it seems that something is seriously out of sync at the Qt side.

Joris van der Hoeven <vdhoeven>
Project Administrator


Attached Files
file #33428:  test-bug40676.zip added by mdbenito (994B - application/zip)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by pjoyez (Posted a comment)
  • -email is unavailable- added by mdbenito (Posted a comment)
  • -email is unavailable- added by vdhoeven (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-28 pjoyez Open/ClosedOpen => Closed
    2015-03-23 mdbenito Attached File- => Added test-bug40676.zip, #33428
    2013-12-02 mdbenito StatusConfirmed => Ready For Test
    2013-11-22 vdhoeven Priority5 - Normal => 9 - Immediate

    Back to the top

    Powered by Savane 3.3