amagnasco / xwpe

Upload of an abandoned ncurses-based programming environment
http://www.identicalsoftware.com/xwpe/
GNU General Public License v2.0
29 stars 6 forks source link

F1 / Info menuoptions sometimes cause unexpected signal 11. #6

Open gbonnema opened 7 years ago

gbonnema commented 7 years ago

F1 sometimes causes unexpected signal 11.

Steps to repeat:

  1. Start program and escape file-manager
  2. do Alt-F and scroll to the right to Help
  3. Choose the option info and press Enter
  4. (Window opens with help info)
  5. Press F1.

This results in a signal 11.

Another combi that results in signal 11:

  1. Start program and escape file-manager
  2. (cursor is on "#") scroll to the left once (get Help)
  3. Choose Info and press enter
  4. (window on Info opens) press F1

This also results in signal 11.

If you do Alt-H (for Help directly), open Info and then do F1, everything is fine. If you then open info: signal 11.

Most works the same for wpe and for xwpe. I tested wpe on a PTY (ctrl-alt-F3).

gbonnema commented 7 years ago

To keep you posted on progress. I have isolated the code where the segment fault occurs. When running with cgdb without breakpoints I got:

Program received signal SIGSEGV, Segmentation fault. 0x000000000041ca8d in e_help_loc (f=0x6c8950, sw=0) at we_fl_fkt.c:1351 (gdb)

The code around we_fl_fkt.c:1351 reads:

1347 if (sw) 1348 e_read_info(NULL, f->ed->f[f->ed->mxedt], NULL); 1349 else 1350 e_read_help(tmp, f->ed->f[f->ed->mxedt], 0); 1351 e_schirm(f->ed->f[f->ed->mxedt], 1); 1352 return(0); 1353 }

After that I set a breakpoint at we_fl_fkt.c:1351 and got the following output:

`$1 = 1 (gdb) p f->ed->f[f->ed->mxedt] $2 = (FENSTER ) 0x6c8950 (gdb) p f->ed->f[f->ed->mxedt] $3 = {a = {x = 0, y = 1}, e = {x = 79, y = 41}, sa = {x = 119539488, y = 119539488}, se = {x = 119539488, y = 119539488}, zoom = 0 '\000', fb = 0x6ba0f0, pic = 0x6cf190, dirct = 0x6c8d90 "/home/data/gbonnema/pr ojects/c/xwpe/", datnam = 0x6c8930 "Help", winnum = 1, ins = 8 '\b', dtmd = 104 'h', save = 0, hlp_str = 0x6ba620 "", blst = 0x684160 , nblst = 7, filemode = 436, flg = 0, c_sw = 0x0, c_st = 0x0, ed = 0x697010, b = 0x6c8b00, s = 0x6c84e0, fd = {search = " \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a", replace = " \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a \a", '\000' <repeats 11 tim es>, file = '\000' <repeats 79 times>, dirct = 0x0, sn = 0, rn = 0, sw = 0}} (gdb) c Continuing.

Breakpoint 1, e_help_loc (f=0x6c8950, sw=0) at we_fl_fkt.c:1351 (gdb) p f->ed->f[f->ed->mxedt] Cannot access memory at address 0xb5 (gdb) p sw $4 = 0 (gdb) c Continuing.

Program received signal SIGSEGV, Segmentation fault. 0x000000000041ca8d in e_help_loc (f=0x6c8950, sw=0) at we_fl_fkt.c:1351 (gdb) Quit (gdb) `

So apparantly the memory that should contain the help information is now not defined.

I will let you know if I find out some more.

Kind regards, Guus.

gbonnema commented 7 years ago

After many tests I must conclude that this abort is unreliable. Both inside the debugger and out. It sometimes refuses to abort, and then suddenly does. I really don't know what is going on.

What I did see is that when it aborts either f->ed->f or f->ed->mxedt are non readable in memory.

P.S. I believe f is short for FENSTER or window. The mxedt is an index into the array of f->ed->f.

amagnasco commented 7 years ago

Was able to reproduce on Guake terminal v0.8.8.

Steps to reproduce:

  1. Call wpe from console
  2. Exit file manager with ESC-F3
  3. Press "H" for help menu
  4. Press "I" for "info" option
  5. Press F1

Expected result: Access help page for main-menu.

Actual result: Program crashes and prints "Error-Exit! Code: 1!" on console.

Other notes: Was unable to reproduce on xwpe, xwe, or we. Normal operation. Was unable to reproduce on xfce4-terminal. "F1" is keybound to xfce help page.