From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30626: 26.0.91; Crash when traversing a `stream-of-directory-files' Date: Sun, 11 Mar 2018 14:52:22 -0400 Message-ID: <87bmfuzbq1.fsf@gmail.com> References: <87inaiss6l.fsf@web.de> <6FCF6ACA-4F29-4B6B-BE9D-D7130C6E9495@gnu.org> <87fu5moe4c.fsf@web.de> <877eqyocro.fsf@web.de> <83zi3uz4nb.fsf@gnu.org> <87lgfd52by.fsf@gmail.com> <87bmg91ity.fsf@web.de> <83h8q1yuin.fsf@gnu.org> <87po4pnl0a.fsf@web.de> <837eqxyqoe.fsf@gnu.org> <87lgfdnf86.fsf@web.de> <87muzs11hk.fsf@web.de> <87606e4lel.fsf@gmail.com> <87lgf83gun.fsf@gmail.com> <87fu5f3kcr.fsf@gmail.com> <83lgf7u644.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1520794272 8513 195.159.176.226 (11 Mar 2018 18:51:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Mar 2018 18:51:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: michael_heerdegen@web.de, john.b.mastro@gmail.com, nicolas@petton.fr, 30626@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 11 19:51:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ev63m-00023T-9q for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Mar 2018 19:51:06 +0100 Original-Received: from localhost ([::1]:55322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev65p-0001SQ-2L for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Mar 2018 14:53:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49223) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev65h-0001SD-IP for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 14:53:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev65e-00061w-Er for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 14:53:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ev65e-00061k-9T for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 14:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ev65d-0003PJ-TD for bug-gnu-emacs@gnu.org; Sun, 11 Mar 2018 14:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Mar 2018 18:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30626 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30626-submit@debbugs.gnu.org id=B30626.152079435313051 (code B ref 30626); Sun, 11 Mar 2018 18:53:01 +0000 Original-Received: (at 30626) by debbugs.gnu.org; 11 Mar 2018 18:52:33 +0000 Original-Received: from localhost ([127.0.0.1]:55687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ev65A-0003OR-Sk for submit@debbugs.gnu.org; Sun, 11 Mar 2018 14:52:33 -0400 Original-Received: from mail-io0-f171.google.com ([209.85.223.171]:37087) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ev659-0003OA-DY for 30626@debbugs.gnu.org; Sun, 11 Mar 2018 14:52:31 -0400 Original-Received: by mail-io0-f171.google.com with SMTP id d71so8913980iog.4 for <30626@debbugs.gnu.org>; Sun, 11 Mar 2018 11:52:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jAwd9ts5z2FRPNc1JrEUPpVJo8HaPiVEH4B2S67eGN0=; b=LfYcUkA2Y1p8uK1yn9zqhTP4ft5H3h/rd6giROraU3+DQsdSGlpvmOoW7PkIDE7aRA r64OmDJZ964yfnQl92mV5yqXDAeJHIzoYWmNeGCIqjJo6skzsP5Yd/arJishRznc+pZM cgaJChrdJFwCtwLyZTcUqIgqzV4ZuiKyne8ixzrWj6ngijfv/Xc8fKnVd/xbCc67YhdR WfB0IbS6xtSA849b3EkCO1YHvTxI5sruALeCjZrmGcix3kjLseQk06bfOVEr2cZQjkg1 4Tw0ZgAmPaT3C1shi3at1houKhyhdZPzyRO4Q0TnkiWvywph2Fa7fZI18YPwZ3mllNWl 6M7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=jAwd9ts5z2FRPNc1JrEUPpVJo8HaPiVEH4B2S67eGN0=; b=MeILTuYLrzAYwmxvj1jH4AUAZNHaN+bOS9ZSu+jQqfVi5AXPo+SGmxKxAuu0jSkNXl 3QoWHPbr1UK0RO79TfFVkao8nfVzrEE5DRCnujck53Ji1cuOkGQG606e78zz5au1Fmhe UaR/cMxYDLJ5/IjqVQIM16MspUrYNMxViP8gaPZW4NSKoIE426xadnwTC683zj/1jI2I r9DAzubX2QIE7e9oJHieuUg2KEbtQ/V6ArQADoXq73NzlPsTI5IgQqEmxRU+BO9HIUKJ p2VxfjHBUad8ytb2llnFcaKJJwtsYTnw15osgpWbdkNtPdv1flrmtuFm00eIBAAtwsgE WE5A== X-Gm-Message-State: AElRT7ER1XjPGLd4w4FC4675LM1D6X87mPHn7GD50U7LmvO69wPm7ds7 mxvyLe4TcuE7+c+/hB4cw3scww== X-Google-Smtp-Source: AG47ELvXdKheNs94mALmGXvph4HZGY/Z7q7nzN29tWCrM6/x33eM4CEC8GHX2f442ILeV+rPZUpN/g== X-Received: by 10.107.183.65 with SMTP id h62mr6214180iof.278.1520794345456; Sun, 11 Mar 2018 11:52:25 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id q21sm2195593itb.2.2018.03.11.11.52.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Mar 2018 11:52:24 -0700 (PDT) In-Reply-To: <83lgf7u644.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 04 Mar 2018 19:02:03 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:144134 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> also crashes, due to the head of the stream being referenced from the C >> stack somewhere (I can get the address from gdb, but I can't figure out >> how to get to the corresponding C variable from there). > > Did you try "info symbol ADDRESS"? (I'm not sure this will work for > automatic variables, though.) Doesn't seem to work. I guess it wouldn't work if the address was in the middle of an array either. > You could also try "info locals" after "set print address on" and/or > "set print symbol on". Those settings don't seem to help. I first guessed that the problem is due to saving function arguments during funcall, so I tried the following to check it: --- i/src/bytecode.c +++ w/src/bytecode.c @@ -387,7 +387,10 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, make_number (nargs))); ptrdiff_t pushedargs = min (nonrest, nargs); for (ptrdiff_t i = 0; i < pushedargs; i++, args++) - PUSH (*args); + { + PUSH (*args); + *args = Qnil; + } if (nonrest < nargs) PUSH (Flist (nargs - nonrest, args)); else This did change the backtrace (from starting with mark_specpdl to mark_stack), meaning I did find one reference, but it still crashes, so there must be more. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=stream-crash.gdb.log Content-Description: gdb log excerpts No stack. Starting program: /home/npostavs/src/emacs/emacs-26/lucid/src/emacs -Q -batch -l elpa/packages/stream/stream.elc -l bug-30626-stream-crash/test5.elc [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x000000000060e9b5 in live_cons_holding (m=0x2f6e290, p=0x2f77620) at ../../src/alloc.c:4613 4613 return make_lisp_ptr (s, Lisp_Cons); #0 0x000000000060e9b5 in live_cons_holding (m=0x2f6e290, p=0x2f77620) at ../../src/alloc.c:4613 #1 0x000000000060e9ec in live_cons_p (m=0x2f6e290, p=0x2f77620) at ../../src/alloc.c:4622 #2 0x0000000000612f94 in mark_object (arg=XIL(0x2f77623)) at ../../src/alloc.c:6717 #3 0x0000000000611d4f in mark_vectorlike (ptr=0x2f78b50) at ../../src/alloc.c:6227 [...] #4850 0x0000000000612b42 in mark_object (arg=XIL(0x2efcb83)) at ../../src/alloc.c:6624 #4851 0x0000000000611d4f in mark_vectorlike (ptr=0x2e64c90) at ../../src/alloc.c:6227 #4852 0x0000000000612b42 in mark_object (arg=XIL(0x2e64c95)) at ../../src/alloc.c:6624 #4853 0x000000000060f3ce in mark_maybe_pointer (p=0x2e64c90) at ../../src/alloc.c:4936 #4854 0x000000000060f452 in mark_memory (start=0x7fffffffa520, end=0x7fffffffe868) at ../../src/alloc.c:4985 #4855 0x000000000060f493 in mark_stack (bottom=0x7fffffffe868 "a\036h\364\377\177", end=0x7fffffffa520 "0\245\377\377\377\177") at ../../src/alloc.c:5193 #4856 0x00000000006cdd75 in mark_one_thread (thread=0xe103e0 ) at ../../src/thread.c:616 #4857 0x00000000006cdf0a in mark_threads_callback (ignore=0x0) at ../../src/thread.c:649 #4858 0x000000000060f4da in flush_stack_call_func (func=0x6cde77 , arg=0x0) at ../../src/alloc.c:5220 #4859 0x00000000006cdf3c in mark_threads () at ../../src/thread.c:656 #4860 0x00000000006114a7 in garbage_collect_1 (end=0x7fffffffa700) at ../../src/alloc.c:5997 #4861 0x0000000000611b94 in Fgarbage_collect () at ../../src/alloc.c:6168 #4862 0x000000000057999d in maybe_gc () at ../../src/lisp.h:4749 #4863 0x000000000063c2cb in Ffuncall (nargs=6, args=0x7fffffffa7f8) at ../../src/eval.c:2751 #4864 0x000000000068d950 in exec_byte_code (bytestr=XIL(0x2e7aad4), vector=XIL(0x2e72715), maxdepth=make_number(18), args_template=make_number(768), nargs=3, args=0x7fffffffad20) at ../../src/bytecode.c:632 #4865 0x000000000063cfef in funcall_lambda (fun=XIL(0x1450e45), nargs=3, arg_vector=0x7fffffffad08) at ../../src/eval.c:2970 #4866 0x000000000063c402 in Ffuncall (nargs=4, args=0x7fffffffad00) at ../../src/eval.c:2771 #4867 0x000000000068d950 in exec_byte_code (bytestr=XIL(0x2e7b2d4), vector=XIL(0x2fe2945), maxdepth=make_number(7), args_template=make_number(256), nargs=0, args=0x7fffffffb1d8) at ../../src/bytecode.c:632 #4868 0x000000000063cfef in funcall_lambda (fun=XIL(0x2fe2985), nargs=0, arg_vector=0x7fffffffb1d8) at ../../src/eval.c:2970 #4869 0x000000000063c402 in Ffuncall (nargs=1, args=0x7fffffffb1d0) at ../../src/eval.c:2771 #4870 0x000000000068d950 in exec_byte_code (bytestr=XIL(0x2e769d4), vector=XIL(0x9d00a5), maxdepth=make_number(2), args_template=make_number(257), nargs=1, args=0x7fffffffb670) at ../../src/bytecode.c:632 #4871 0x000000000063cfef in funcall_lambda (fun=XIL(0x1626f05), nargs=1, arg_vector=0x7fffffffb668) at ../../src/eval.c:2970 #4872 0x000000000063c402 in Ffuncall (nargs=2, args=0x7fffffffb660) at ../../src/eval.c:2771 #4873 0x000000000068d950 in exec_byte_code (bytestr=XIL(0x2e7f7b4), vector=XIL(0x1622fe5), maxdepth=make_number(3), args_template=make_number(257), nargs=1, args=0x7fffffffbb10) at ../../src/bytecode.c:632 #4874 0x000000000063cfef in funcall_lambda (fun=XIL(0x1450f35), nargs=1, arg_vector=0x7fffffffbb08) at ../../src/eval.c:2970 #4875 0x000000000063c402 in Ffuncall (nargs=2, args=0x7fffffffbb00) at ../../src/eval.c:2771 #4876 0x000000000068d950 in exec_byte_code (bytestr=XIL(0x2ee3c94), vector=XIL(0x2e664f5), maxdepth=make_number(3), args_template=make_number(257), nargs=1, args=0x7fffffffbfa8) at ../../src/bytecode.c:632 #4877 0x000000000063cfef in funcall_lambda (fun=XIL(0x2e66515), nargs=1, arg_vector=0x7fffffffbfa0) at ../../src/eval.c:2970 #4878 0x000000000063c402 in Ffuncall (nargs=2, args=0x7fffffffbf98) at ../../src/eval.c:2771 #4879 0x000000000068d950 in exec_byte_code (bytestr=XIL(0x2e91054), vector=XIL(0x1699ef5), maxdepth=make_number(4), args_template=XIL(0), nargs=0, args=0x0) at ../../src/bytecode.c:632 #4880 0x000000000068cb20 in Fbyte_code (bytestr=XIL(0x2e91054), vector=XIL(0x1699ef5), maxdepth=make_number(4)) at ../../src/bytecode.c:321 #4881 0x000000000063ac83 in eval_sub (form=XIL(0x2eeb413)) at ../../src/eval.c:2240 #4882 0x0000000000672b34 in readevalloop (readcharfun=XIL(0x68a0), infile0=0x7fffffffc6b0, sourcename=XIL(0x2e90f94), printflag=false, unibyte=XIL(0), readfun=XIL(0), start=XIL(0), end=XIL(0)) at ../../src/lread.c:2038 #4883 0x0000000000670e85 in Fload (file=XIL(0x2e8d884), noerror=XIL(0), nomessage=XIL(0xc090), nosuffix=XIL(0), must_suffix=XIL(0)) at ../../src/lread.c:1425 #4884 0x000000000063c945 in funcall_subr (subr=0xd7a420 , numargs=3, args=0x7fffffffc8e8) at ../../src/eval.c:2856 #4885 0x000000000063c3be in Ffuncall (nargs=4, args=0x7fffffffc8e0) at ../../src/eval.c:2769 #4886 0x000000000068d950 in exec_byte_code (bytestr=XIL(0xadcc2c), vector=XIL(0xadcc4d), maxdepth=make_number(23), args_template=make_number(257), nargs=1, args=0x7fffffffd248) at ../../src/bytecode.c:632 #4887 0x000000000063cfef in funcall_lambda (fun=XIL(0xadcbfd), nargs=1, arg_vector=0x7fffffffd240) at ../../src/eval.c:2970 #4888 0x000000000063c402 in Ffuncall (nargs=2, args=0x7fffffffd238) at ../../src/eval.c:2771 #4889 0x000000000068d950 in exec_byte_code (bytestr=XIL(0xad7424), vector=XIL(0xad7445), maxdepth=make_number(21), args_template=make_number(0), nargs=0, args=0x7fffffffde58) at ../../src/bytecode.c:632 #4890 0x000000000063cfef in funcall_lambda (fun=XIL(0xad73f5), nargs=0, arg_vector=0x7fffffffde58) at ../../src/eval.c:2970 #4891 0x000000000063c402 in Ffuncall (nargs=1, args=0x7fffffffde50) at ../../src/eval.c:2771 #4892 0x000000000068d950 in exec_byte_code (bytestr=XIL(0xad6614), vector=XIL(0xad6635), maxdepth=make_number(12), args_template=make_number(0), nargs=0, args=0x7fffffffe480) at ../../src/bytecode.c:632 #4893 0x000000000063cfef in funcall_lambda (fun=XIL(0xad65e5), nargs=0, arg_vector=0x7fffffffe480) at ../../src/eval.c:2970 #4894 0x000000000063cc29 in apply_lambda (fun=XIL(0xad65e5), args=XIL(0), count=4) at ../../src/eval.c:2906 #4895 0x000000000063ae2a in eval_sub (form=XIL(0x149a8e3)) at ../../src/eval.c:2279 #4896 0x000000000063a19f in Feval (form=XIL(0x149a8e3), lexical=XIL(0)) at ../../src/eval.c:2054 #4897 0x000000000058150f in top_level_2 () at ../../src/keyboard.c:1119 #4898 0x00000000006384ce in internal_condition_case (bfun=0x5814ec , handlers=XIL(0x5250), hfun=0x580ef1 ) at ../../src/eval.c:1332 #4899 0x0000000000581554 in top_level_1 (ignore=XIL(0)) at ../../src/keyboard.c:1127 #4900 0x00000000006379d7 in internal_catch (tag=XIL(0xc6f0), func=0x581511 , arg=XIL(0)) at ../../src/eval.c:1097 #4901 0x000000000058143e in command_loop () at ../../src/keyboard.c:1088 #4902 0x00000000005809db in recursive_edit_1 () at ../../src/keyboard.c:695 #4903 0x0000000000580bd0 in Frecursive_edit () at ../../src/keyboard.c:766 #4904 0x000000000057e76b in main (argc=7, argv=0x7fffffffe9e8) at ../../src/emacs.c:1713 Cannot access memory at address 0x7ffffff7ef7f (gdb) frame 4854 #4854 0x000000000060f452 in mark_memory (start=0x7fffffffa520, end=0x7fffffffe868) at ../../src/alloc.c:4985 4985 mark_maybe_pointer (*(void **) pp); (gdb) info locals pp = 0x7fffffffa968 "\220L\346\002" (gdb) info symbol 0x7fffffffa968 No symbol matches 0x7fffffffa968. --=-=-=--