Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

floating point exception with editor_tab_spacing=1 #2953

Closed
mc-butler opened this issue Jan 22, 2013 · 5 comments
Closed

floating point exception with editor_tab_spacing=1 #2953

mc-butler opened this issue Jan 22, 2013 · 5 comments
Assignees
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress ver: 4.8.7 Reproducible in version 4.8.7
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2953
Reporter Enlik (poczta-sn@….pl)

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
@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 23, 2013 at 6:58 UTC (comment 1)

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

Branch: 2953_editor_fpe (parent: master).
Initial [e553cae]

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Jan 23, 2013 at 8:09 UTC (comment 2)

  • Votes set to slavazanko

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 24, 2013 at 5:27 UTC (comment 3)

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 24, 2013 at 6:12 UTC (comment 4)

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

Merged to master: [c87e38c].

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Jan 24, 2013 at 6:14 UTC (comment 5)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress ver: 4.8.7 Reproducible in version 4.8.7
Development

No branches or pull requests

2 participants