bugGNU TeXmacs - Bugs: bug #35691, Texmacs segfaults when inserting...

 
 

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

bug #35691: Texmacs segfaults when inserting empty delimiter

Submitted by:  Francois Poulain <fpoulain>
Submitted on:  Fri 02 Mar 2012 12:02:53 PM UTC  
 
Category: TypesetterPriority: 7 - High
Item Group: ErrorStatus: Fixed
Privacy: PublicAssigned to: None
Originator Name: Open/Closed: Closed
Release: Release: None
Fixed Release: NoneFixed Release: 
Keywords: segfault around delimiter

(Jump to the original submission Jump to the original submission)

Tue 06 Mar 2012 02:39:43 PM UTC, comment #6:

The <nobracket>'s seem the intended behaviour, so I close the bug.

Miguel de Benito <mdbenito>
Project Member
Mon 05 Mar 2012 01:29:59 PM UTC, comment #5:

That button in the delimiter menu causes two <nobracket>'s in red to surround the text I input. Do you think it's best to have this behaviour or the same as <around> which outputs nothing? For now, I've uploaded your fix to the svn together with the case N(s)==0 setting s="<nobracket>" as done elsewhere in the code. So the result is those <nobracket> things appearing

Miguel de Benito <mdbenito>
Project Member
Mon 05 Mar 2012 12:42:14 PM UTC, comment #4:

> It's however questionable whether this is desirable.


In fact, I discovered the bug when I tried to reproduce (via latex command) the empty delimiter provided by the GUI (last icon in the delimiter menu of the math mode toolbar). So, I suppose that this was considered desirable at one moment.

Francois Poulain <fpoulain>
Project Member
Mon 05 Mar 2012 11:13:47 AM UTC, comment #3:

François' patch does prevent the crash and seems reasonable enough: the missing delimiters are ignored, which is the behaviour for <around> tags. It's however questionable whether this is desirable. Wouldn't it make more sense to have some visual marker telling you that the delimiters are missing? Consider this patch (same place)

if (N(s) == 0) s = " ";
else if (N(s) > 1 && s[0] != '<') s= "<" * s * ">";

Now two red underlined blanks surround the text you input.

Miguel de Benito <mdbenito>
Project Member
Sat 03 Mar 2012 03:08:53 PM UTC, comment #2:

The provided patch avoid crashing.

Anyway, the case "N(s) == 0" is no more considered in the algorithm. This should be reviewed by someone witch understand this part of the code. I didn't took time for this.

(file #25256)

Francois Poulain <fpoulain>
Project Member
Sat 03 Mar 2012 12:13:21 PM UTC, comment #1:

Ubuntu 11.04 x86_64

Confirmed on XTeXmacs svn:4697 (>1.0.7.14)
TeXmacs] Fatal error, segmentation fault
TeXmacs] Fatal unrecoverable error, invalid cursor

and under QTeXmacs svn:4862 (>1.0.7.14)

Alvaro Tejero Cantero <alv>
Project Member
Fri 02 Mar 2012 12:02:53 PM UTC, original submission:

Texmacs segfaults when inserting empty delimiter

Steps to reproduce :

  • Open a new document ;
  • Enter in math mode ;
  • Enter the tag <around*> with empty delimiter.

See the capture provided.

---------------------------------------------------------
Backtrace
---------------------------------------------------------
(gdb) bt
#0 0x00000000004d7fd1 in concater_rep::handle_matching (this=0x1cf0560, start=11, end=13) at ./Typeset/Concat/concat_post.cpp:236
#1 0x00000000004d87ff in concater_rep::handle_brackets (this=0x1cf0560) at ./Typeset/Concat/concat_post.cpp:276
#2 0x00000000004d8e6a in concater_rep::finish (this=0x1cf0560) at ./Typeset/Concat/concat_post.cpp:326
#3 0x00000000004ea623 in typeset_concat (env=..., t=..., ip=...) at ./Typeset/Concat/concater.cpp:745
#4 0x00000000006c8aac in typeset_concat_or_table (env=..., t=..., ip=...) at ./Typeset/Line/lazy_paragraph.cpp:493
#5 0x00000000006c8c24 in typeset_stack (env=..., t=..., ip=..., a=..., b=..., sb=...) at ./Typeset/Line/lazy_paragraph.cpp:503
#6 0x0000000000888a88 in typesetter_rep::insert_paragraph (this=0xe9b1a0, t=..., ip=...) at ./Typeset/Bridge/typesetter.cpp:55
#7 0x000000000046996e in bridge_rep::my_typeset (this=0x16e4d78, desired_status=1) at ./Typeset/Bridge/bridge.cpp:248
#8 0x000000000046a17f in bridge_rep::typeset (this=0x16e4d78, desired_status=1) at ./Typeset/Bridge/bridge.cpp:308
#9 0x000000000046df1e in bridge_argument_rep::my_typeset (this=0x22ea568, desired_status=1) at ./Typeset/Bridge/bridge_argument.cpp:171
#10 0x000000000046a17f in bridge_rep::typeset (this=0x22ea568, desired_status=1) at ./Typeset/Bridge/bridge.cpp:308
#11 0x000000000048bb89 in bridge_with_rep::my_typeset (this=0x16e4cb0, desired_status=1) at ./Typeset/Bridge/bridge_with.cpp:185
#12 0x000000000046a17f in bridge_rep::typeset (this=0x16e4cb0, desired_status=1) at ./Typeset/Bridge/bridge.cpp:308
#13 0x000000000047513c in bridge_compound_rep::my_typeset (this=0x2168eb0, desired_status=1) at ./Typeset/Bridge/bridge_compound.cpp:220
#14 0x000000000046a17f in bridge_rep::typeset (this=0x2168eb0, desired_status=1) at ./Typeset/Bridge/bridge.cpp:308
#15 0x000000000047b767 in bridge_document_rep::my_typeset (this=0x16e5200, desired_status=1) at ./Typeset/Bridge/bridge_document.cpp:209
#16 0x000000000046a17f in bridge_rep::typeset (this=0x16e5200, desired_status=1) at ./Typeset/Bridge/bridge.cpp:308
#17 0x000000000088a08d in typesetter_rep::typeset (this=0xe9b1a0) at ./Typeset/Bridge/typesetter.cpp:161
#18 0x000000000088a22b in typesetter_rep::typeset (this=0xe9b1a0, x1b=@0x7fffffffc5ec, y1b=@0x7fffffffc5e8, x2b=@0x7fffffffc5e4, y2b=@0x7fffffffc5e0)
at ./Typeset/Bridge/typesetter.cpp:174
#19 0x000000000088b137 in typeset (ttt=0xe9b1a0, x1=@0x7fffffffc5ec, y1=@0x7fffffffc5e8, x2=@0x7fffffffc5e4, y2=@0x7fffffffc5e0) at ./Typeset/Bridge/typesetter.cpp:262
#20 0x00000000005d5e90 in edit_typeset_rep::typeset (this=0x1310ec8, x1=@0x7fffffffc5ec, y1=@0x7fffffffc5e8, x2=@0x7fffffffc5e4, y2=@0x7fffffffc5e0)
at ./Edit/Editor/edit_typeset.cpp:561
#21 0x000000000056e163 in edit_interface_rep::apply_changes (this=0x1310d18) at ./Edit/Interface/edit_interface.cpp:485
#22 0x000000000083394b in tm_server_rep::interpose_handler (this=0xf36228) at ./Texmacs/Server/tm_server.cpp:328
#23 0x00000000008307ac in texmacs_interpose_handler () at ./Texmacs/Server/tm_server.cpp:46
#24 0x00000000007a097c in qt_gui_rep::update (this=0xf2bc10) at ./Plugins/Qt/qt_gui.cpp:925
#25 0x0000000000709cdc in QTMGuiHelper::qt_metacall (this=0xf47a00, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7fffffffcf40) at Plugins/Qt/moc_QTMGuiHelper.cpp:86
#26 0x00007ffff6dfb2e6 in QMetaObject::activate(QObject, QMetaObject const, int, void**) () from /usr/lib/libQtCore.so.4
#27 0x00007ffff6df7b43 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#28 0x00007ffff72f832c in QApplicationPrivate::notify_helper(QObject, QEvent) () from /usr/lib/libQtGui.so.4
#29 0x00007ffff72fe80b in QApplication::notify(QObject, QEvent) () from /usr/lib/libQtGui.so.4
#30 0x00007ffff6de809c in QCoreApplication::notifyInternal(QObject, QEvent) () from /usr/lib/libQtCore.so.4
#31 0x00007ffff6e14e72 in ?? () from /usr/lib/libQtCore.so.4
#32 0x00007ffff6e119c4 in ?? () from /usr/lib/libQtCore.so.4
#33 0x00007ffff481f6f2 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#34 0x00007ffff4823568 in ?? () from /lib/libglib-2.0.so.0
#35 0x00007ffff482371c in g_main_context_iteration () from /lib/libglib-2.0.so.0
#36 0x00007ffff6e116b3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#37 0x00007ffff73a819e in ?? () from /usr/lib/libQtGui.so.4
#38 0x00007ffff6de69c2 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#39 0x00007ffff6de6d9c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#40 0x00007ffff6deba2b in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#41 0x0000000000804dc4 in TeXmacs_main (argc=1, argv=0x7fffffffe2f8) at ./Texmacs/Texmacs/texmacs.cpp:368
#42 0x000000000061da60 in new_call_back (closure=0x0, argc=1, argv=0x7fffffffe2f8) at ./Guile/Scheme/evaluate.cpp:34
#43 0x00007ffff67c4dff in ?? () from /usr/lib/libguile.so.17
#44 0x00007ffff679b93a in ?? () from /usr/lib/libguile.so.17
#45 0x00007ffff6800c9f in scm_c_catch () from /usr/lib/libguile.so.17
#46 0x00007ffff679bdab in scm_i_with_continuation_barrier () from /usr/lib/libguile.so.17
#47 0x00007ffff679be40 in scm_c_with_continuation_barrier () from /usr/lib/libguile.so.17
#48 0x00007ffff67ffd04 in scm_i_with_guile_and_parent () from /usr/lib/libguile.so.17
#49 0x00007ffff67c4db5 in scm_boot_guile () from /usr/lib/libguile.so.17
#50 0x000000000061da9c in start_guile (argc=1, argv=0x7fffffffe2f8, call_back=0x802c16 <TeXmacs_main(int, char**)>) at ./Guile/Scheme/evaluate.cpp:42
#51 0x00000000008059ad in main (argc=1, argv=0x7fffffffe2f8) at ./Texmacs/Texmacs/texmacs.cpp:466

Francois Poulain <fpoulain>
Project Member

 

Attached Files
file #25256:  bug_35691.diff added by fpoulain (659B - text/x-patch)
file #25242:  Capture.png added by fpoulain (82KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mdbenito (Posted a comment)
  • -unavailable- added by alv (Posted a comment)
  • -unavailable- added by fpoulain (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 06 Mar 2012 02:39:43 PM UTCmdbenitoOpen/ClosedOpen=>Closed
    Mon 05 Mar 2012 01:29:59 PM UTCmdbenitoStatusReady For Test=>Fixed
    Mon 05 Mar 2012 11:13:47 AM UTCmdbenitoCategoryNone=>Typesetter
    Sat 03 Mar 2012 03:08:53 PM UTCfpoulainAttached File-=>Added bug_35691.diff, #25256
      Priority5 - Normal=>7 - High
      StatusNone=>Ready For Test
    Fri 02 Mar 2012 12:02:53 PM UTCfpoulainAttached File-=>Added Capture.png, #25242

    Back to the top


    Powered by Savane 3.1-cleanup1