From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: xuchunyang Newsgroups: gmane.emacs.bugs Subject: bug#36279: 26.2.90; (process-attributes nonexistent-pid) segmentation fault Date: Tue, 18 Jun 2019 22:05:38 +0800 Message-ID: <42c23bd8-57e3-4503-a6cf-d38aec89edd0@www.fastmail.com> References: <87zhmfvx44.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253080"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Cyrus-JMAP/3.1.6-666-gb2312fa-fmstable-20190614v4 Cc: 36279@debbugs.gnu.org To: "Noam Postavsky" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 18 16:07:09 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hdElR-0013es-Ff for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 16:07:09 +0200 Original-Received: from localhost ([::1]:58356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdElP-0006hW-SP for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 Jun 2019 10:07:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58742) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdEkO-0006bh-H3 for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 10:06:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdEkM-0000Lv-WE for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 10:06:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdEkM-0000Jb-9e for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 10:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hdEkM-00015B-0P for bug-gnu-emacs@gnu.org; Tue, 18 Jun 2019 10:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: xuchunyang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jun 2019 14:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36279 X-GNU-PR-Package: emacs Original-Received: via spool by 36279-submit@debbugs.gnu.org id=B36279.15608667504134 (code B ref 36279); Tue, 18 Jun 2019 14:06:01 +0000 Original-Received: (at 36279) by debbugs.gnu.org; 18 Jun 2019 14:05:50 +0000 Original-Received: from localhost ([127.0.0.1]:45347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdEk8-00014W-NR for submit@debbugs.gnu.org; Tue, 18 Jun 2019 10:05:50 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:58217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hdEk6-00014A-9t for 36279@debbugs.gnu.org; Tue, 18 Jun 2019 10:05:47 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7EA316EE; Tue, 18 Jun 2019 10:05:40 -0400 (EDT) Original-Received: from imap8 ([10.202.2.58]) by compute6.internal (MEProxy); Tue, 18 Jun 2019 10:05:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xuchunyang.me; h=mime-version:message-id:in-reply-to:references:date:from:to :cc:subject:content-type; s=fm1; bh=n+Xdchmj79EY6VWJ1usCVstj8tPS 1BsUM3/3zyZJyGs=; b=Ie3BUey2mm1KsHTEnJ7b3U5BYfGIsBZUowvRQhVLDyYS lvF5nA//KQ2dT/a5U5YqKAAVkZN3V0f0MUfKe4GUR0CNroJk7aQJce3JL9DCKRp0 8rq+EPbVXRGYKQdxQUvIW7iv1ANZwhK72DncN03HcZ9akYPXObaegk95qNHJlR2+ ieTuAD7tMu3CLpoq5aPxy8qx2+kjUeNiRmTbWyDq8fJD92AvGJMm+t+1oUoTVrJW gcpDfbnai9uOSlVBDpdYxMPCmiV9YiTTKs1qoLMT2OCrlZwpUL+sVuDbII5xCIOv xF0pi95HILSR/5fU+7tTV3x6TerJP3WoTQIi/LR3XA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=n+Xdch mj79EY6VWJ1usCVstj8tPS1BsUM3/3zyZJyGs=; b=DyHJ8p34Gl9v+BsBIvrpiD +yJWpmL0mOOLSHFRBoAYjno/6OC6pKAMSxB4wVojhPW7DQbOENAPqGwG0QmrmnOc nKE3UM4n25EhbW5oKYZ020gQhHur6TONSDqvVbJMSCmF6xwkgVHKahS9oRSFBf35 VLmeI64irAl62tMmJf3w0KRo6tpGztT83yqmtTvDWXgzuvPTcu2CoPMJNhdPjykC Vm8VBpZvIShggGJnr0rqtdh6Acp9EXbDwU9lxmktZ3hnjj8IPAKf5GJUgMgAvuYf Y6nWUFE+ZmskmzzfpeegDy7MbIWWgEBr95MiuRIMl6nlgMMpIAcqs5spLHpuwWWw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderreejnecuhfhrohhmpeiguhgthhhu nhihrghnghcuoehmrghilhesgihutghhuhhnhigrnhhgrdhmvgeqnecurfgrrhgrmhepmh grihhlfhhrohhmpehmrghilhesgihutghhuhhnhigrnhhgrdhmvgenucevlhhushhtvghr ufhiiigvpedt X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id B3BB7520093; Tue, 18 Jun 2019 10:05:39 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <87zhmfvx44.fsf@gmail.com> 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: 209.51.188.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:160770 Archived-At: On Tue, Jun 18, 2019, at 9:31 PM, Noam Postavsky wrote: > Xu Chunyang writes: > > > Emacs crashes when I run the following (the PID 123456 doesn't exist) > > > > (process-attributes 123456) > > > > And I can reproduce it from Emacs -Q: > > > > ~ $ emacs -Q --batch --eval '(print (process-attributes 123456))' > > Fatal error 11: Segmentation faultzsh: segmentation fault emacs -Q --batch --eval '(print (process-attributes 123456))' > > ~ $ emacs --version | head -1 > > GNU Emacs 26.2.90 > > ~ $ > > > > > > In GNU Emacs 26.2.90 (build 1, x86_64-apple-darwin18.6.0, Carbon Version 158 AppKit 1671.5) > > Doesn't happen here[1], I just get nil. Can you show a backtrace with a > gdb (or lldb if that's not available)? (Not sure what am I doing, never used lldb) ~/src/emacs-mac/src $ lldb ./emacs (lldb) target create "./emacs" Current executable set to './emacs' (x86_64). (lldb) run -Q --batch --eval '(print (process-attributes 123456))' Process 18581 launched: '/Users/xcy/src/emacs-mac/src/emacs' (x86_64) emacs was compiled with optimization - stepping may behave oddly; variables may not be available. Process 18581 stopped * thread #2, name = 'org.gnu.Emacs.lisp-main', stop reason = EXC_BAD_ACCESS (code=1, address=0x41) frame #0: 0x00000001000dd9aa emacs`system_process_attributes(pid=) at sysdep.c:3872:39 [opt] 3869 rusage = proc.kp_proc.p_ru; 3870 if (rusage) 3871 { -> 3872 attrs = Fcons (Fcons (Qminflt, make_fixnum_or_float (rusage->ru_minflt)), 3873 attrs); 3874 attrs = Fcons (Fcons (Qmajflt, make_fixnum_or_float (rusage->ru_majflt)), 3875 attrs); Target 0: (emacs) stopped. (lldb) bt * thread #2, name = 'org.gnu.Emacs.lisp-main', stop reason = EXC_BAD_ACCESS (code=1, address=0x41) * frame #0: 0x00000001000dd9aa emacs`system_process_attributes(pid=) at sysdep.c:3872:39 [opt] frame #1: 0x000000010013e854 emacs`eval_sub(form=) at eval.c:2247:41 [opt] frame #2: 0x000000010013e7ea emacs`eval_sub(form=) at eval.c:2235:21 [opt] frame #3: 0x0000000100141f6b emacs`Feval(form=4370835043, lexical=) at eval.c:2067:28 [opt] frame #4: 0x0000000100143b27 emacs`__funcall_subr_block_invoke(.block_descriptor=) at eval.c:0:12 [opt] frame #5: 0x00000001001e1a4f emacs`mac_autorelease_loop(body=0x0000000100143a60) at macappkit.m:1040:13 [opt] frame #6: 0x0000000100142aff emacs`Ffuncall [inlined] funcall_subr(subr=, numargs=, args=) at eval.c:2909:3 [opt] frame #7: 0x0000000100142a99 emacs`Ffuncall(nargs=, args=) at eval.c:2782 [opt] frame #8: 0x0000000100186f3e emacs`exec_byte_code(bytestr=, vector=4298690456, maxdepth=, args_template=1030, nargs=1, args=) at bytecode.c:630:12 [opt] frame #9: 0x0000000100142a3d emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt] frame #10: 0x0000000100186f3e emacs`exec_byte_code(bytestr=, vector=4298667856, maxdepth=, args_template=2, nargs=0, args=) at bytecode.c:630:12 [opt] frame #11: 0x0000000100142a3d emacs`Ffuncall(nargs=, args=) at eval.c:0:4 [opt] frame #12: 0x0000000100186f3e emacs`exec_byte_code(bytestr=, vector=4298664256, maxdepth=, args_template=2, nargs=0, args=) at bytecode.c:630:12 [opt] frame #13: 0x0000000100142214 emacs`apply_lambda(fun=4298664181, args=, count=4) at eval.c:2948:9 [opt] frame #14: 0x000000010013e610 emacs`eval_sub(form=) at eval.c:0:11 [opt] frame #15: 0x0000000100141f6b emacs`Feval(form=4362606819, lexical=) at eval.c:2067:28 [opt] frame #16: 0x00000001001410dc emacs`internal_condition_case(bfun=(emacs`top_level_2 at keyboard.c:1118), handlers=22128, hfun=(emacs`cmd_error at keyboard.c:938)) at eval.c:1336:25 [opt] frame #17: 0x00000001000d102d emacs`top_level_1(ignore=) at keyboard.c:1127:5 [opt] frame #18: 0x00000001001406d0 emacs`internal_catch(tag=53568, func=(emacs`top_level_1 at keyboard.c:1124), arg=0) at eval.c:1101:25 [opt] frame #19: 0x00000001000c06ef emacs`command_loop at keyboard.c:1088:2 [opt] frame #20: 0x00000001000c060f emacs`recursive_edit_1 at keyboard.c:695:9 [opt] frame #21: 0x00000001000c08f6 emacs`Frecursive_edit at keyboard.c:766:3 [opt] frame #22: 0x00000001000bf209 emacs`emacs_main(argc=, argv=0x00007ffeefbff7c8) at emacs.c:1759:3 [opt] frame #23: 0x000000010020d534 emacs`mac_start_lisp_main(arg=0x00007ffeefbff7c8) at macappkit.m:16723:3 [opt] frame #24: 0x00007fff7a9e52eb libsystem_pthread.dylib`_pthread_body + 126 frame #25: 0x00007fff7a9e8249 libsystem_pthread.dylib`_pthread_start + 66 frame #26: 0x00007fff7a9e440d libsystem_pthread.dylib`thread_start + 13 (lldb) > [1]: In GNU Emacs 26.2.90 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw > scroll bars) > >