bugGNU TeXmacs - Bugs: bug #44106, Endless loop in...

 
 

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

bug #44106: Endless loop in edit_cursor_rep::make_cursor_accessible

Submitter:  Francois Poulain <fpoulain>
Submitted:  Wed 28 Jan 2015 04:25:26 PM UTC
   
 
Category:  Editor Priority:  9 - Immediate
Item Group:  Error Status:  Fixed
Privacy:  Public Assigned to:  vdhoeven
Originator Name:  Open/Closed:  Closed
Release:  None Release: 
Fixed Release:  None Fixed Release: 
Keywords: 

Sun 19 Mar 2017 09:34:46 AM UTC, comment #2: 

With the current svn version (~10600) and using François' file, I cannot reproduce the problem he describes: It seems it was fixed.
=> closing

Philippe Joyez <pjoyez>
Group Member
Sat 07 Mar 2015 10:04:08 PM UTC, comment #1: 

Confirmed. I've been using the following ugly hack for a while now to work around the problem and be able to do my presentations.


Index: Edit/Interface/edit_cursor.cpp
===================================================================
--- Edit/Interface/edit_cursor.cpp        (revision 8733)
+++ Edit/Interface/edit_cursor.cpp        (working copy)
@@ -42,7 +42,10 @@
   int old_mode= get_access_mode ();
   if (get_init_string (MODE) == "src")
     set_access_mode (DRD_ACCESS_SOURCE);
+ int c=0;
   while (!is_accessible_cursor (et, p) && !in_source ()) {
+    if (++c > 1<<10)  //HACK!!!
+      break;
     path pp;
     ASSERT (rp <= p, "path outside document");
     p= rp * closest_inside (subtree (et, rp), p / rp);


Miguel de Benito <mdbenito>
Group Member
Wed 28 Jan 2015 04:25:26 PM UTC, original submission:  

The function make_cursor_accessible may fall in an infinite loop due to "badly formed" strings when a call to tm_char_forwards is done via the call to closest_inside which return a "non accessible" path.

This can appear e.g. closest_inside is called on something like <image|<tuple|<#__raw_data__>> ... >

I played a bit with it but I am not convinced at which level this should be corrected: in the source or in drds. A dead loop detection could be added in the loop of make_cursor_accessible, but I guess it is not the root of the bug. Maybe the call to next_valid is false due to bad drd…

Also, I guess that serious performances issues are involved by this bug, since tm_char_forwards can be called unnecessarily on quite big strings (usually Mbytes) in raw-data tags.

Here is an example of TeXmacs file which fall into a loop (try to move between screens, then move up and down the cursor).

Francois Poulain <fpoulain>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #32922:  test_inserted_image.tm added by fpoulain (5KiB - text/texmacs)

 

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 fpoulain (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-03-19 pjoyez StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2015-03-22 mdbenito Priority8 - Very high 9 - Immediate
    2015-03-07 mdbenito Priority5 - Normal 8 - Very high
        Item GroupNone Error
        StatusNone Confirmed
    2015-01-28 fpoulain Attached File- Added test_inserted_image.tm, #32922

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code