bugGNU Octave - Bugs: bug #44015, GUI crashes after clear all in...

 
 

bug #44015: GUI crashes after clear all in right click menu

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Thu 15 Jan 2015 10:06:01 PM UTC  
 
Category:  GUI Severity:  4 - Important
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  John W. Eaton <jwe>
Originator Name:  Avinoam Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Tue 17 Feb 2015 02:43:31 AM UTC, comment #19: 

I applied the patch to change the text to "Clear Window" here (http://hg.savannah.gnu.org/hgweb/octave/rev/94cc1bdaf884).

Rik <rik5>
Project Administrator
Sat 14 Feb 2015 07:35:23 PM UTC, comment #18: 

Attached (trivial) changeset to change "Clear All" to "Clear Window"

(file #33076)

Avinoam Kalma <avinoam>
Project Member
Fri 13 Feb 2015 07:42:36 PM UTC, comment #17: 

Both are good, and better than "clear all", that can be misleading.

Avinoam Kalma <avinoam>
Project Member
Fri 13 Feb 2015 05:43:27 PM UTC, comment #16: 

What would be better for the context menu to say, "clear window" or "clear screen"?  It's simple enough to fix.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Fri 13 Feb 2015 05:11:25 PM UTC, comment #15: 

@Avinoam: That is the intended behavior. The action is in the Edit menu as "Clear Command Window" and in the command window context menu as "Clear All". If the wording of the menu item is unclear, that should be a separate bug report.

@jwe: Works perfectly for me.

Mike Miller <mtmiller>
Project Administrator
Fri 13 Feb 2015 05:04:12 PM UTC, comment #14: 

There is still a (minor) problem. The bottom is marked as "clear all", but it acts as "clc" and not as "clear all",

Avinoam Kalma <avinoam>
Project Member
Thu 12 Feb 2015 07:37:32 PM UTC, comment #13: 

I checked in two changesets.  One to avoid having command_editor::interrupt result in an EOF for the parser and another to kill any pending input line when the screen is cleared with the GUI "clear command window" action.

http://hg.savannah.gnu.org/hgweb/octave/rev/f4af02a9a6fc
http://hg.savannah.gnu.org/hgweb/octave/rev/c048358da712

Closing report again as I think this is fixed.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Thu 12 Feb 2015 05:18:36 PM UTC, comment #12: 

Using rl_kill_full_line (0, 0) before the call to command_editor::clear_screen works for me.  Fow now, I'll fix it by wrapping this function in the command_editor class but I still think it would be good to have command_editor::interrupt work properly so that it doesn't result in the parser seeing EOF.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Thu 12 Feb 2015 03:56:59 PM UTC, comment #11: 

Ok, I see. Keeping the current input line made more sense to me, but if it's Matlab compatible to clear it, so be it.

FWIW, I think rl_kill_text might be the right way to do it, but it's not wrapped by command_editor yet.

Mike Miller <mtmiller>
Project Administrator
Thu 12 Feb 2015 11:49:22 AM UTC, comment #10: 

The reason I used command_editor::interrupt was because Matlab apparently clears pending command input as well so that the command window is completely cleared except for the prompt and someone who was paying asked me to make Octave do the same.  I know this feature worked at one time, and so if it is not crashing, I suspect the problem is that now when readline returns in this case, Octave sees it at EOF instead of "no command here, move along..."

Also, this shouldn't be the only place where we would have this trouble since I think command_editor::interrupt is also used in other callback functions.

I'll take a look at fixing this problem.

John W. Eaton <jwe>
Project AdministratorIn charge of this item.
Thu 12 Feb 2015 07:06:26 AM UTC, comment #9: 

Instead of trying to figure out why this sequence was causing the interpreter to exit, I fixed the callback to clear the command window using (I think) the proper readline function:

http://hg.savannah.gnu.org/hgweb/octave/rev/2e9f17872f36

Mike Miller <mtmiller>
Project Administrator
Sat 17 Jan 2015 11:21:16 PM UTC, comment #8: 

I can confirm that

parser.lexer.end_of_input

is somehow being set to true, which means end-of-input to Octave and causes it to exit normally.

Mike Miller <mtmiller>
Project Administrator
Fri 16 Jan 2015 10:42:12 PM UTC, comment #7: 

Debugging is proving difficult because of the way Octave forks at the start and then also does an exec call in the child process.  Maybe jwe needs to take a look at this.  I did diff the file cmd-edit.cc between 3.8.2 and the development branch and I don't see anything that would obviously explain this.

Rik <rik5>
Project Administrator
Fri 16 Jan 2015 09:43:52 PM UTC, comment #6: 

If I set the argument to command_editor::interrupt to false then the program does not crash.  But it does wait for at least one character to be typed before the octave prompt is shown.  The character doesn't need to be a <RETURN>.  Any character will do.

Rik <rik5>
Project Administrator
Fri 16 Jan 2015 09:38:29 PM UTC, comment #5: 

I just ran Octave under gdb and the sequence causes Octave to exit normally.  I think that instead of interrupting Octave we are somehow giving it the command to terminate normally.

Rik <rik5>
Project Administrator
Fri 16 Jan 2015 09:07:52 PM UTC, comment #4: 

In version 3.8.2 "clear all" in right click menu works well.
What has been changed?

Avinoam Kalma <avinoam>
Project Member
Fri 16 Jan 2015 08:54:38 PM UTC, comment #3: 

The GUI already calls the equivalent for clc (main-window.cc:1985):

void
main_window::clear_command_window_callback (void)
{
  Fclc ();
  command_editor::interrupt (true);
}

When commenting out the line "command_editor::interrupt (true);", the program does not crash but a prompt is not showing up before the user hits "return". Any ideas what might happen here?

Torsten Lilge <ttl>
Project Member
Fri 16 Jan 2015 04:58:11 AM UTC, comment #2: 

This bug happens on the gui-release and development branches and on Linux as well as MXE-Octave.  Changing title to reflect that

Rik <rik5>
Project Administrator
Fri 16 Jan 2015 01:21:02 AM UTC, comment #1: 

Confirmed.

The GUI should be executing the equivalent of 'clc' to clear the screen and put the cursor in the home position.

Rik <rik5>
Project Administrator
Thu 15 Jan 2015 10:06:01 PM UTC, original submission:  

When I use the mouse right click menu (copy/paste/sellect all/clear all), in MXE version, the "clear all" cause Octave to crash

Avinoam Kalma <avinoam>
Project Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #33076:  Clear_Window.patch added by avinoam (711B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Potential parser related problem, only jwe has expertise with parser)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by avinoam (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 project members can vote.

     

     

     

    Follow 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-02-14 avinoam Attached File- => Added Clear_Window.patch, #33076
    2015-02-12 jwe Open/ClosedOpen => Closed
    2015-02-12 jwe Item GroupSegfault, Bus Error, etc. => Incorrect Result
        Assigned toNone => jwe
        Open/ClosedClosed => Open
    2015-02-12 mtmiller StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2015-01-30 mtmiller Severity3 - Normal => 4 - Important
    2015-01-18 rik5 Carbon-Copy- => Added jwe@octave.org
    2015-01-16 rik5 Operating SystemMicrosoft Windows => Any
        SummaryMXE-octave 4.1.0+ crashes after clear all in right click menu => GUI crashes after clear all in right click menu
    2015-01-16 rik5 StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.5