#2203 closed defect (fixed)

edit command results in crash in shell after save and exit.

Reported by: Chris Johns Owned by: Chris Johns
Priority: highest Milestone: 4.11
Component: shell Version: 4.11
Severity: blocker Keywords: shell edit
Cc: Blocked By:
Blocking:

Description

To repeat run the fileio example in the SPARC simulator, select shell and log in as root. Then:

cd scripts
edit js

Move down a few lines and enter characters and lines then save and exit. At the shell promt enter 'ls' and you will get an unexpected trap.

Change History (5)

comment:1 Changed on Nov 30, 2014 at 10:35:02 PM by Chris Johns

Owner: set to Chris Johns
Status: newaccepted

comment:2 Changed on Nov 30, 2014 at 10:43:13 PM by Chris Johns

I have found the shell's command list is corrupted while editing a file. A bisect indicates the bug has been in the code from the start and I suspect a movement of code or data has made it appear.

The variable to watch is 'rtems_shell_first_cmd'. If you open the scripts/js file and use the arrow key and move to the bottom of the file then up arrow on the third press (I think) gdb shows in edit.c 'up' entry:

1: rtems_shell_first_cmd = (rtems_shell_cmd_t *) 0x209e388

and after running the up code it becomes:

1: rtems_shell_first_cmd = (rtems_shell_cmd_t *) 0x1b

This is in the SIS simulator. This bug also happens on a zynq. I have not been able to set a watch point on the write in gdb running the SIS and have it break. Things get a little weird with stdout/stdin when the watch point is active.

comment:3 Changed on Dec 1, 2014 at 2:33:36 PM by Gedare Bloom

When you say "from the start", do you mean since the initial shell code came in? If so the Version should be set back a bit further, and the milestone adjusted to 4.9.5

comment:4 Changed on Dec 1, 2014 at 9:14:58 PM by Chris Johns

I was meaning the commit that added the edit.c code.

comment:5 Changed on Dec 3, 2014 at 12:27:25 AM by Chris Johns

Resolution: fixed
Status: acceptedclosed

Fixed.

Note: See TracTickets for help on using tickets.