Ticket #2008 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

[patch] mc coredumps on exit

Reported by: fjoe Owned by: andrew_b
Priority: major Milestone: 4.7.1
Component: mc-core Version: 4.7.0.2
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master committed-stable

Description

When exiting mc crashes with following message:

read (subshell_pty ...): Bad address (14)

Subshell should be enabled and panels should be on (visible) to reproduce this bug.

Stack trace is:

(gdb) bt
#0 0x000000080118fa3c in kill () from /lib/libc.so.7
#1 0x000000080118e83b in abort () from /lib/libc.so.7
#2 0x0000000000451a72 in feed_subshell (how=0, fail_on_error=0) at subshell.c:1006
#3 0x00000000004515dc in do_subshell_chdir (directory=0x8026c1060 "/usr/home/fjoe/Downloads", do_update=0,

reset_prompt=1) at subshell.c:844

#4 0x000000000044b042 in get_parent_dir_name (cwd=0x7fffffffe340 "\220����\177",

lwd=0x472e3e "��L\211���\213��������n���fff\220fff\220ff\220ff\220H\211
$�H\211l$�H\203�\030H\205�t-�����H\211�H\211��M���H\211�H\211��~\213��H\211�H\213l$\020H\213
$\bH\203�\030�H\215=��\004") at main.c:440

#5 0x000000000041603d in panel_callback (w=0x8026c1000, msg=WIDGET_FOCUS, parm=0) at screen.c:2842
#6 0x000000000040d686 in dlg_focus (h=0x8026c1000) at dialog.c:403
#7 0x000000000040d6f0 in dlg_focus () at dialog.c:409
#8 0x000000000040d9f4 in do_select_widget (h=0x8026982b0, w=0x80267d280, dir=SELECT_EXACT) at dialog.c:521
#9 0x000000000040de71 in dlg_key_event (h=0x8026982b0, d_key=274) at dialog.c:701
#10 0x000000000040df0e in dlg_key_event (h=0x8026982b0, d_key=274) at dialog.c:723
#11 0x000000000040e34f in frontend_run_dlg (h=0x40e34f) at dialog.c:842
#12 0x000000000040e435 in run_dlg (h=0x112026982b0) at dialog.c:871
#13 0x000000000040e49e in destroy_dlg (h=0x40e49e) at dialog.c:883
#14 0x000000000044e031 in prepend_cwd_on_local (filename=0x8026982b0 "") at main.c:1806
#15 0x000000000044e3bd in OS_Setup () at main.c:1911
#16 0x000000000044ec33 in main (argc=1, argv=0x7fffffffe688) at main.c:2240

The reason is that pty_buffer becomes NULL when event is processed (when exit_subshell() is called), but after event is processed panel_callback is called with msg=WIDGET_FOCUS which in turns leads to feed_subshell being called.

Quick workaround attached.

Attachments

patch-src-subshell.c (338 bytes) - added by fjoe 9 years ago.
0001-Ticket-2008-reimplemented-pty_buffer-as-static-buf.patch (2.9 KB) - added by andrew_b 9 years ago.

Change History

Changed 9 years ago by fjoe

comment:1 in reply to: ↑ description Changed 9 years ago by andrew_b

Replying to fjoe:

The reason is that pty_buffer becomes NULL when event is processed (when exit_subshell() is called), but after event is processed panel_callback is called with msg=WIDGET_FOCUS which in turns leads to feed_subshell being called.

Quick workaround attached.

I have never seen this crash. Would you try my alternative patch 0001-Ticket-2008-reimplemented-pty_buffer-as-static-buf.patch?

comment:2 Changed 9 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • severity changed from no branch to on review

Created 2008_pty_buffer branch. Parent branch is master.
changeset:06ed7da041cee4584f0315be85d9cb55834aeffb

comment:3 Changed 9 years ago by andrew_b

  • Milestone changed from 4.7 to 4.7.1

comment:4 Changed 9 years ago by angel_il

  • Votes for changeset set to angel_il

comment:5 Changed 9 years ago by slavazanko

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

comment:6 Changed 9 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from angel_il slavazanko to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:7 Changed 9 years ago by andrew_b

  • Status changed from testing to closed
  • Votes for changeset changed from commited-master to commited-master commited-stable
Note: See TracTickets for help on using tickets.