From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#18851: 24.4; emacs cannot be started if the current directory has been removed Date: Fri, 12 Jun 2015 21:29:05 -0400 Message-ID: References: <87h9ypiqmm.fsf@xvii.vinc17.org> <8k61f398u4.fsf@fencepost.gnu.org> <20141029012802.GS4400@xvii.vinc17.org> <83y4rz1qmj.fsf@gnu.org> <20141029080939.GT4400@xvii.vinc17.org> <83r3xr0x4u.fsf@gnu.org> <20141029153959.GM5545@ypig.lip.ens-lyon.fr> <83zj45qs5a.fsf@gnu.org> <83mw04raei.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1434159036 27584 80.91.229.3 (13 Jun 2015 01:30:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Jun 2015 01:30:36 +0000 (UTC) Cc: vincent@vinc17.net, 18851@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 13 03:30:28 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z3aH8-0005xt-Qx for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Jun 2015 03:30:23 +0200 Original-Received: from localhost ([::1]:54504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3aH8-0003DQ-2u for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jun 2015 21:30:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3aH2-0003D9-PE for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 21:30:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3aH0-0002IA-JB for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 21:30:16 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3aH0-0002I2-E2 for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 21:30:14 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z3aGy-000648-IQ for bug-gnu-emacs@gnu.org; Fri, 12 Jun 2015 21:30:12 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jun 2015 01:30:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18851 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18851-submit@debbugs.gnu.org id=B18851.143415897523183 (code B ref 18851); Sat, 13 Jun 2015 01:30:09 +0000 Original-Received: (at 18851) by debbugs.gnu.org; 13 Jun 2015 01:29:35 +0000 Original-Received: from localhost ([127.0.0.1]:52202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z3aGL-00061o-8n for submit@debbugs.gnu.org; Fri, 12 Jun 2015 21:29:34 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58046) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z3aGI-000619-Gh for 18851@debbugs.gnu.org; Fri, 12 Jun 2015 21:29:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z3aGA-0001vz-Oc for 18851@debbugs.gnu.org; Fri, 12 Jun 2015 21:29:25 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z3aFu-0001qr-Oi; Fri, 12 Jun 2015 21:29:06 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1Z3aFt-00044t-PA; Fri, 12 Jun 2015 21:29:05 -0400 X-Spook: dedicated denial of service 64 Vauxhall Cross TTP Abu X-Ran: uY(I,=\{/O]q.Kku>6/*5Pm:O!9qpE?|;q?vm:[kws?sDcFwBW@_.Cb'431bqu[$yjIq(- X-Hue: blue X-Attribution: GM In-Reply-To: <83mw04raei.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jun 2015 22:31:33 +0300") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103877 Archived-At: Eli Zaretskii wrote: > Maybe SMC cannot work with current directory removed? It looks that way, though xsmfns.c already seems to take the necessary precautions for that case, and a super-quick look at the libSM source didn't show any obvious issue. The only solution I can think of is to disable session-management in such a case: --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -28,6 +28,7 @@ along with GNU Emacs. If not, see . */ #include #include +#include #include #include "lisp.h" @@ -402,6 +403,14 @@ x_session_initialize (struct x_display_info *dpyinfo) SmcCallbacks callbacks; ptrdiff_t name_len = 0; + /* libSM seems to crash if pwd is missing - see bug#18851. */ + if (! get_current_dir_name ()) + { + fprintf (stderr, "Disabling session management due to pwd error: %s\n", + emacs_strerror (errno)); + return; + } + ice_fd = -1; doing_interact = false; For completeness, here's a backtrace with debug libSM and libICE included. (What about the address-out-of-bounds in #3?) bt: #0 0x00007ffff12e5640 in __memcpy_ssse3_back () from /lib64/libc.so.6 #1 0x00007ffff69df80d in memcpy (__len=, __src=, __dest=0x15b675c) at /usr/include/bits/string3.h:51 #2 SmcSetProperties (smcConn=, numProps=4, props=0x7fffffff28e0) at sm_client.c:379 #3 0x0000000000536f5b in smc_save_yourself_CB (smcConn=0xea0370, clientData=0x0, saveType=1, shutdown=0, interactStyle=0, fast=0) at xsmfns.c:262 #4 0x00007ffff69e1c5d in _SmcProcessMessage (iceConn=0xea0f90, clientData=0xea0370, opcode=, length=, swap=0, replyWait=, replyReadyRet=0x7fffffff2a00) at sm_process.c:241 #5 0x00007ffff67d1b97 in IceProcessMessages (iceConn=0xea0f90, replyWait=0x0, replyReadyRet=0x0) at process.c:386 #6 0x00000000005367d5 in x_session_check_input (fd=11, data=0x0) at xsmfns.c:110 #7 0x0000000000637484 in wait_reading_process_output (time_limit=0, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=..., wait_proc=0x0, just_wait_proc=0) at process.c:5081 #8 0x000000000054e66b in kbd_buffer_get_event (kbp=0x7fffffff2ff8, used_mouse_menu=0x7fffffff395f, end_time=0x0) at keyboard.c:3927 #9 0x000000000054ac3e in read_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffff3510, used_mouse_menu=0x7fffffff395f) at keyboard.c:2200 #10 0x000000000054aea3 in read_decoded_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffff3510, prev_event=..., used_mouse_menu=0x7fffffff395f) at keyboard.c:2265 #11 0x000000000054c421 in read_char (commandflag=1, map=..., prev_event=..., used_mouse_menu=0x7fffffff395f, end_time=0x0) at keyboard.c:2875 #12 0x0000000000558b68 in read_key_sequence (keybuf=0x7fffffff3b30, bufsize=30, prompt=..., dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9159 #13 0x0000000000548d11 in command_loop_1 () at keyboard.c:1407 #14 0x00000000005e229a in internal_condition_case ( bfun=0x5488f2 , handlers=..., hfun=0x5480d7 ) at eval.c:1348 #15 0x00000000005485fa in command_loop_2 (ignore=...) at keyboard.c:1139 #16 0x00000000005e1a2d in internal_catch (tag=..., func=0x5485d1 , arg=...) at eval.c:1108 #17 0x000000000054859a in command_loop () at keyboard.c:1118 #18 0x0000000000547cb2 in recursive_edit_1 () at keyboard.c:728 #19 0x0000000000547e3c in Frecursive_edit () at keyboard.c:799 #20 0x0000000000545c0f in main (argc=2, argv=0x7fffffff3ff8) at emacs.c:1626 #0 0x00007ffff12e5640 in __memcpy_ssse3_back () from /lib64/libc.so.6 bt full: #1 0x00007ffff69df80d in memcpy (__len=, __src=, __dest=0x15b675c) at /usr/include/bits/string3.h:51 No locals. #2 SmcSetProperties (smcConn=, numProps=4, props=0x7fffffff28e0) at sm_client.c:379 _i = _j = 4 iceConn = 0xea0f90 pMsg = pBuf = 0x15b675c "" pStart = 0x15b65d0 "\004" bytes = 400 #3 0x0000000000536f5b in smc_save_yourself_CB (smcConn=0xea0370, clientData=0x0, saveType=1, shutdown=0, interactStyle=0, fast=0) at xsmfns.c:262 props = {0x7fffffff2840, 0x7fffffff2860, 0x7fffffff2880, 0x7fffffff28a0, 0xea0a00} prop_ptr = {{ name = 0xd887e0 "CloneCommand", type = 0xda4930 "LISTofARRAY8", num_vals = 1, vals = 0x7fffffff2700 }, { name = 0xe733b0 "Program", type = 0xea0ba0 "ARRAY8", num_vals = 1, vals = 0x7fffffff2710 }, { name = 0xf533a0 "UserID", type = 0xf54070 "ARRAY8", num_vals = 1, vals = 0x7fffffff2720 }, { name = 0xf54150 "RestartCommand", type = 0xf54230 "LISTofARRAY8", num_vals = 5, vals = 0x1008d10 }, { name = 0x7fffffff28d0 "\020$|\366\377\177", type = 0x712665236f658c00
, num_vals = -159636464, vals = 0x7ffff7fc6000 }} values = {{ length = 45, value = 0xea1460 }, { length = 5, value = 0xe64690 }, { length = 7, value = 0xe61810 }, { length = 20421677, value = 0x1 }, { length = 500000000, value = 0x7ffff7de44c9 }, { length = 0, value = 0x7ffff67c16a8 }, { length = 10, value = 0x5b }, { length = -456570963, value = 0x7ffff7de4ccb }, { length = 499925475, value = 0x7fffffff27c0 }, { length = -159640236, value = 0x7ffff67c2410 }, { length = -55088, value = 0x7fffffff28c0 }, { length = 45, value = 0x1231d }, { length = 0, value = 0x0 }, { length = -134455296, value = 0x406e31 }, { length = -159634424, value = 0x403e10 }, { length = 0, value = 0x10000008f }, { length = 17519331, value = 0x7fffffff2988 }, { length = -54944, value = 0x1 }, { length = 16, value = 0x7fffffff2920 }, { length = -55232, value = 0x712665236f658c00 }} vp = 0x1008d10 val_idx = 3 vp_idx = 4 props_idx = 4 i = 2 smid_opt = 0xf2c690 "--smid=26667490d-357a-48ea-b51a-9851440ed37c" chdir_opt = 0x0 user_login_name = { i = 18634644 } cwd = 0x0 #4 0x00007ffff69e1c5d in _SmcProcessMessage (iceConn=0xea0f90, clientData=0xea0370, opcode=, length=, swap=0, replyWait=, replyReadyRet=0x7fffffff2a00) at sm_process.c:241 pMsg = 0xea4910 errVal = 0 '\000' errOffset = -1 smcConn = #5 0x00007ffff67d1b97 in IceProcessMessages (iceConn=0xea0f90, replyWait=0x0, replyReadyRet=0x0) at process.c:386 processProc = processMsgInfo = header = 0xea4910 replyReady = 0 useThisReplyWait = 0x0 retStatus = IceProcessMessagesSuccess #6 0x00000000005367d5 in x_session_check_input (fd=11, data=0x0) at xsmfns.c:110 ret = 11 #7 0x0000000000637484 in wait_reading_process_output (time_limit=0, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=..., wait_proc=0x0, just_wait_proc=0) at process.c:5081 d = 0xc5cde8 timeout_reduced_for_timers = true channel = 11 nfds = 1 Available = { fds_bits = {2048, 0 } } Writeok = { fds_bits = {0 } } check_write = true check_delay = 0 no_avail = false xerrno = 11 proc = { i = 0 } timeout = { tv_sec = 0, tv_nsec = 499969517 } end_time = { tv_sec = 5506081, tv_nsec = 0 } got_some_input = -1 count = 2 #8 0x000000000054e66b in kbd_buffer_get_event (kbp=0x7fffffff2ff8, used_mouse_menu=0x7fffffff395f, end_time=0x0) at keyboard.c:3927 do_display = true obj = { i = 0 } #9 0x000000000054ac3e in read_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffff3510, used_mouse_menu=0x7fffffff395f) at keyboard.c:2200 c = { i = 0 } save_jump = {{ __jmpbuf = {0, 0, 0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, __saved_mask = { __val = {0 } } }} kb = 0x1dcd6500 #10 0x000000000054aea3 in read_decoded_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffff3510, prev_event=..., used_mouse_menu=0x7fffffff395f) at keyboard.c:2265 nextevt = { i = 13589501 } frame = 0x7fffffff3270 terminal = 0xcf5bfd events = {{ i = 13076624 }, { i = 0 }, { i = 0 }, { i = 140737488302576 }, { i = 5506081 }, { i = 499988655 }, { i = 140737488302640 }, { i = 5560959 }, { i = 13076624 }, { i = 4294967296 }, { i = 0 }, { i = 140737488302640 }, { i = 5506081 }, { i = 0 }, { i = 140737488302688 }, { i = 5587002 }} n = 0 #11 0x000000000054c421 in read_char (commandflag=1, map=..., prev_event=..., used_mouse_menu=0x7fffffff395f, end_time=0x0) at keyboard.c:2875 c = { i = 0 } jmpcount = 2 local_getcjmp = {{ __jmpbuf = {0, -2368210174059533009, 17161965, 43008, 0, 0, -2368210174200042193, 2368209730108206383}, __mask_was_saved = 0, __saved_mask = { __val = {140737488303472, 5506081, 0, 140737488303760, 5643396, 0, 0, 43008, 0, 566608, 0, 0, 0, 12476142, 9644764, 12476117} } }} save_jump = {{ __jmpbuf = {16844352, 18467472, 5390848, 13627136, 20960179, 16844352, 13076624, 0}, __mask_was_saved = 5390848, __saved_mask = { __val = {140737488303264, 13076624, 0, 140737488303472, 140737488303296, 5506081, 0, 140737488303472, 6187899, 0, 2, 0, 6600973, 0, 5506321, 5390848} } }} tem = { i = 774368 } save = { i = 0 } previous_echo_area_message = { i = 0 } also_record = { i = 0 } reread = false gcpro1 = { next = 0x7fffffff3400, var = 0x540614 , nvars = 21474836480 } gcpro2 = { next = 0xc78890 , var = 0x7fffffff33e0, nvars = 5506081 } polling_stopped_here = true orig_kboard = 0xe9ab20 #12 0x0000000000558b68 in read_key_sequence (keybuf=0x7fffffff3b30, bufsize=30, prompt=..., dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9159 interrupted_kboard = 0xe9ab20 interrupted_frame = 0x12d3c50 key = { i = 140737488304592 } used_mouse_menu = false echo_local_start = 0 last_real_key_start = 0 keys_local_start = 0 new_binding = { i = 5510211 } count = 2 t = 0 echo_start = 0 keys_start = 0 current_binding = { i = 17524643 } first_event = { i = 0 } first_unbound = 31 mock_input = 0 fkey = { parent = { i = 17364467 }, map = { i = 17364467 }, start = 0, end = 0 } keytran = { parent = { i = 13581891 }, map = { i = 13581891 }, start = 0, end = 0 } indec = { parent = { i = 17364547 }, map = { i = 17364547 }, start = 0, end = 0 } shift_translated = false delayed_switch_frame = { i = 0 } original_uppercase = { i = 13076624 } original_uppercase_position = -1 dummyflag = false starting_buffer = 0xcfef40 fake_prefixed_keys = { i = 0 } gcpro1 = { next = 0x0, var = 0x54a6a4 , nvars = 26832 } #13 0x0000000000548d11 in command_loop_1 () at keyboard.c:1407 cmd = { i = 140737488305264 } keybuf = {{ i = 0 }, { i = 4274848 }, { i = 13076624 }, { i = 0 }, { i = 0 }, { i = 140737488305008 }, { i = 5506081 }, { i = 0 }, { i = 140737488305184 }, { i = 6187899 }, { i = 16933475 }, { i = 2 }, { i = 0 }, { i = 12914144 }, { i = 8354000 }, { i = 0 }, { i = 16933475 }, { i = 13104320 }, { i = 10674493 }, { i = 21808368 }, { i = 140737488305184 }, { i = 6186898 }, { i = 3 }, { i = 140737488305152 }, { i = 27696 }, { i = 27696 }, { i = 0 }, { i = 13104320 }, { i = 4274848 }, { i = 0 }} i = 0 prev_modiff = 0 prev_buffer = 0x0 already_adjusted = false #14 0x00000000005e229a in internal_condition_case ( bfun=0x5488f2 , handlers=..., hfun=0x5480d7 ) at eval.c:1348 val = { i = 16933475 } c = 0xe6b410 #15 0x00000000005485fa in command_loop_2 (ignore=...) at keyboard.c:1139 val = { i = 15119072 } #16 0x00000000005e1a2d in internal_catch (tag=..., func=0x5485d1 , arg=...) at eval.c:1108 val = { i = 0 } c = 0xe6b2e0 #17 0x000000000054859a in command_loop () at keyboard.c:1118 No locals. #18 0x0000000000547cb2 in recursive_edit_1 () at keyboard.c:728 count = 1 val = { i = 140737488305616 } #19 0x0000000000547e3c in Frecursive_edit () at keyboard.c:799 count = 0 buffer = { i = 0 } #20 0x0000000000545c0f in main (argc=2, argv=0x7fffffff3ff8) at emacs.c:1626 dummy = { i = 80 } stack_bottom_variable = 0 '\000' do_initial_setlocale = true dumping = false skip_args = 0 rlim = { rlim_cur = 33554432, rlim_max = 18446744073709551615 } no_loadup = false junk = 0x0 dname_arg = 0x0 ch_to_dir = 0x0 original_pwd = 0x0 A debugging session is active. Inferior 1 [process 3610] will be killed. Quit anyway? (y or n)