Ticket #1864 (new defect) — at Initial Version
4.7.0-pre4 editor crashes in color terminals
Reported by: | yury_t | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 4.7.0.1 |
Component: | mcedit | Version: | master |
Keywords: | syntax, crash | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: |
Description
Internal editor crashes MC when running on color terminals. Monochrome terminals (mc -b) work fine. Patch from ticket #1857 was no help.
System is basicly Slackware 12.2. Following are the stack traces of MC 4.7.0-pre4 modified with pacth #1857.
This is stack trace of starting new file (Shift+F4), then saving:
#0 0xb7c39c66 in raise () from /lib/libc.so.6
#1 0xb7c3b571 in abort () from /lib/libc.so.6
#2 0xb7c7260b in libc_message () from /lib/libc.so.6
#3 0xb7c7a564 in _int_free () from /lib/libc.so.6
#4 0xb7c7e010 in free () from /lib/libc.so.6
#5 0xb7d9a046 in g_free () from /usr/lib/libglib-2.0.so.0
#6 0x080a22d5 in edit_read_syntax_file (edit=0x81c4e58, pnames=0x0,
syntax_file=<value optimized out>, editor_file=0x81c2d48 "222",
first_line=0x812d6c0 "222", type=0x0) at syntax.c:748
#7 0x080a3266 in edit_load_syntax (edit=0x81c4e58, pnames=0x0, type=0x0) at syntax.c:1198
#8 0x0809c2be in edit_save_as_cmd (edit=0x81c4e58) at editcmd.c:618
#9 0x0809c3e9 in edit_save_cmd (edit=0x81c4e58) at editcmd.c:866
#10 0x0809623c in edit_execute_cmd (edit=0x81c4e58, command=101, char_for_insertion=-1)
at edit.c:3028
#11 0x08096b70 in edit_execute_key_command (edit=0x81c4e58, command=101, char_for_insertion=-1)
at edit.c:2551
#12 0x0809d6ad in edit_callback (w=0x81c4e58, msg=WIDGET_KEY, parm=1002) at editwidget.c:377
#13 0x0809cf64 in cmd_F2 (edit=0x81c4e58) at ../src/tty/../../src/dialog.h:237
#14 0x08059d1a in buttonbar_call (bb=<value optimized out>, i=<value optimized out>)
at widget.c:2687
#15 0x0805a4b9 in buttonbar_callback (w=0x81bd388, msg=WIDGET_HOTKEY, parm=1002)
at widget.c:2715
#16 0x08050ecb in dlg_process_event (h=0x81a9e00, key=1002, event=0xbff50144)
at ../src/tty/../../src/dialog.h:237
#17 0x08051171 in run_dlg (h=0x81a9e00) at dialog.c:858
#18 0x0809d0d6 in edit_file (_file=0x0, line=0) at editwidget.c:239
#19 0x08072aba in do_edit_at_line (what=0x0, start_line=0) at cmd.c:305
#20 0x08072afe in do_edit (what=0x0) at cmd.c:323
#21 0x080576a4 in panel_key (panel=0x81b3bc8, key=1014) at screen.c:2636
#22 0x08050cb5 in dlg_process_event (h=0x81abf08, key=1014, event=0xbff512c4)
at ../src/tty/../../src/dialog.h:237
#23 0x08051171 in run_dlg (h=0x81abf08) at dialog.c:858
#24 0x0808a071 in do_nc () at main.c:1805
#25 0x0808a789 in main (argc=Cannot access memory at address 0x1
) at main.c:2234
This is stack trace of opening simple (non-syntax-colored) file, then immediately closing it:
#0 0xb7c06c66 in raise () from /lib/libc.so.6
#1 0xb7c08571 in abort () from /lib/libc.so.6
#2 0xb7c3f60b in libc_message () from /lib/libc.so.6
#3 0xb7c47564 in _int_free () from /lib/libc.so.6
#4 0xb7c4b010 in free () from /lib/libc.so.6
#5 0xb7d67046 in g_free () from /usr/lib/libglib-2.0.so.0
#6 0x080a1dcb in edit_free_syntax_rules (edit=0xb7d23ff4) at syntax.c:1005
#7 0x08092880 in edit_clean (edit=0x81c8328) at edit.c:870
#8 0x0809d6cb in edit_callback (w=0x81c8328, msg=WIDGET_INIT, parm=0) at editwidget.c:394
#9 0x0805051d in dlg_broadcast_msg_to (h=<value optimized out>, message=WIDGET_DESTROY,
reverse=0, flags=0) at ../src/tty/../../src/dialog.h:237
#10 0x08050bd6 in destroy_dlg (h=0x81afd50) at dialog.c:884
#11 0x0809d0de in edit_file (_file=0x81a5d30 "222", line=0) at editwidget.c:241
#12 0x08072aba in do_edit_at_line (what=0x81a5d30 "222", start_line=0) at cmd.c:305
#13 0x08072afe in do_edit (what=0x0) at cmd.c:323
#14 0x08059d03 in buttonbar_call (bb=<value optimized out>, i=<value optimized out>)
at widget.c:2684
#15 0x0805a4b9 in buttonbar_callback (w=0x81ad070, msg=WIDGET_HOTKEY, parm=1004)
at widget.c:2715
#16 0x08050ecb in dlg_process_event (h=0x81abf08, key=1004, event=0xbfd20094)
at ../src/tty/../../src/dialog.h:237
#17 0x08051171 in run_dlg (h=0x81abf08) at dialog.c:858
#18 0x0808a071 in do_nc () at main.c:1805
#19 0x0808a789 in main (argc=Cannot access memory at address 0x1
) at main.c:2234
This is output.........
Program received signal SIGSEGV, Segmentation fault.
compare_word_to_right (edit=0x81c8328, i=287,
text=0x69633d01 <Address 0x69633d01 out of bounds>,
whole_left=0x6f6f6f6f <Address 0x6f6f6f6f out of bounds>,
whole_right=0x6f6f6f6f <Address 0x6f6f6f6f out of bounds>, line_start=577728367)
at syntax.c:185
185 if (!*text)
...........and stack trace of opening the file which requires syntax-coloring:
#0 compare_word_to_right (edit=0x81c8328, i=287,
text=0x69633d01 <Address 0x69633d01 out of bounds>,
whole_left=0x6f6f6f6f <Address 0x6f6f6f6f out of bounds>,
whole_right=0x6f6f6f6f <Address 0x6f6f6f6f out of bounds>, line_start=577728367)
at syntax.c:185
#1 0x080a167b in apply_rules_going_right (edit=0x81c8328, i=287, rule=
{keyword = 0, end = 29 '\035', context = 0 '\0', _context = 30 '\036', border = 0 '\0'})
at syntax.c:364
#2 0x080a1b1d in edit_get_rule (edit=0x81c8328, byte_index=287) at syntax.c:457
#3 0x080a33df in edit_get_syntax_color (edit=0x81c8328, byte_index=287, color=0xbfdbf71c)
at syntax.c:505
#4 0x0809df5b in edit_draw_this_line (edit=0x81c8328, b=251, row=8, start_col=0, end_col=95)
at editdraw.c:454
#5 0x0809e614 in edit_render_keypress (edit=0x81c8328) at editdraw.c:640
#6 0x0809d4fd in edit_callback (w=0x81c8328, msg=WIDGET_FOCUS, parm=0) at editwidget.c:368
#7 0x0805057a in dlg_focus (h=0x81a6428) at ../src/tty/../../src/dialog.h:237
#8 0x08050946 in init_dlg (h=0x81a6428) at dialog.c:795
#9 0x080510d1 in run_dlg (h=0x81a6428) at dialog.c:872
#10 0x0809d0d6 in edit_file (_file=0x81ad6c8 "opera6.html", line=0) at editwidget.c:239
#11 0x08072aba in do_edit_at_line (what=0x81ad6c8 "opera6.html", start_line=136086312)
at cmd.c:305
#12 0x08072afe in do_edit (what=0x81c8328 "") at cmd.c:323
#13 0x08059d03 in buttonbar_call (bb=<value optimized out>, i=<value optimized out>)
at widget.c:2684
#14 0x0805a4b9 in buttonbar_callback (w=0x81ad070, msg=WIDGET_HOTKEY, parm=1004)
at widget.c:2715
#15 0x08050ecb in dlg_process_event (h=0x81abf08, key=1004, event=0xbfdbf934)
at ../src/tty/../../src/dialog.h:237
#16 0x08051171 in run_dlg (h=0x81abf08) at dialog.c:858
#17 0x0808a071 in do_nc () at main.c:1805
#18 0x0808a789 in main (argc=Cannot access memory at address 0x1
) at main.c:2234