Ticket #2953 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

floating point exception with editor_tab_spacing=1

Reported by: Enlik Owned by: andrew_b
Priority: major Milestone: 4.8.8
Component: mcedit Version: 4.8.7
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

editor_tab_spacing=1 in mc.ini and executing something like:
mcedit filename

leads to SIGFPE.

The problem seems to be here (disclaimer: quick look):
./src/editor/edit.c:3261
this part:
edit->curs_col % (HALF_TAB_SIZE * space_width)

HALF_TAB_SIZE is defined as ((int) option_tab_spacing / 2), so when option_tab_spacing is 1, it leads to num % 0.

#0  0x080cd929 in edit_move_to_prev_col (edit=0x82080e0, p=0) at edit.c:3262----------------------------+ 
#1  0x080d02e6 in edit_load_position (edit=0x82080e0) at edit.c:518
#2  edit_init (edit=<optimized out>, y=1, x=0, lines=40, cols=146, filename_vpath=0x816a7d0, line=0) at edit.c:2306
#3  0x080dfda0 in edit_add_window (h=0x81f6528, y=1, x=0, lines=40, cols=146, f=0x816a7d0, fline=0) at editwidget.c:1218
#4  0x080dff18 in edit_files (files=0x8167dd0) at editwidget.c:1107
#5  0x0808d018 in mc_maybe_editor_or_viewer () at midnight.c:998
#6  do_nc () at midnight.c:1766
#7  0x08053b45 in main (argc=2, argv=0xbfffe7e4) at main.c:400

Change History

comment:1 Changed 11 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Branch state changed from no branch to on review
  • Milestone set to 4.8.8

Branch: 2953_editor_fpe (parent: master).
changeset:e553caecce3c5701439f1753e1273c040bda3fcb

Version 0, edited 11 years ago by andrew_b (next)

comment:2 Changed 11 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:3 Changed 11 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • Branch state changed from on review to approved

comment:4 Changed 11 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [c87e38c3c772d903b1a19fdd600c2ac61d396bec].

git log --pretty=oneline 0398c13..c87e38c

comment:5 Changed 11 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.