id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
2008	[patch] mc coredumps on exit	fjoe	andrew_b	"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."	defect	closed	major	4.7.1	mc-core	4.7.0.2	fixed						committed-master committed-stable
