From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: hx Newsgroups: gmane.emacs.devel Subject: Re: changed dlopen flags in dynlib.c, gccemacs crash Date: Sat, 11 Dec 2021 10:29:33 +0800 Message-ID: References: <83tufjw848.fsf@gnu.org> <83lf0uuqaq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d0866405d2d59cde" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35320"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel , Andrea Corallo To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 11 03:30:47 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvs9v-00090e-2G for ged-emacs-devel@m.gmane-mx.org; Sat, 11 Dec 2021 03:30:47 +0100 Original-Received: from localhost ([::1]:40096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvs9t-0003iZ-3c for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Dec 2021 21:30:45 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvs90-0002z8-Bc for emacs-devel@gnu.org; Fri, 10 Dec 2021 21:29:50 -0500 Original-Received: from [2607:f8b0:4864:20::f2f] (port=46673 helo=mail-qv1-xf2f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvs8w-0006Gf-KD; Fri, 10 Dec 2021 21:29:50 -0500 Original-Received: by mail-qv1-xf2f.google.com with SMTP id jo22so9626758qvb.13; Fri, 10 Dec 2021 18:29:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qYqZ2ma0RYK+QDRRYhoxXlooSclMk5Yozi4bd//sJN0=; b=ax/Zu1uHJtXL7upvwaBtBMRi46MfmQgvnez9HYjyimV65M/5jZpewk6SScpdWUPyzV 7iwEVBxj54ugAdf1tmRFRUVMTVI1Fdp9FM7m+JeCYPedbLGBHy3GozYcZoItRsczLqSj NVQ5WdTrB9aJU7xKL8mntQkO/RRK5p42lfgrzAslnRMTd4rIQ1FdnQUiibBny9Cj7w4z bz9p1M3UEm59DszMXWGxUjRxD37A+1Hx1gRsCrNlqoC2YZ8+EZl4NtMlb/hdEURdk3Id 4O/RE4KNcBdbkRUDAt0ApsfMUe2Ntl/OQBJFwJciWF22U2pv9WD167rCnWaeVHUymfbF 3aIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qYqZ2ma0RYK+QDRRYhoxXlooSclMk5Yozi4bd//sJN0=; b=x+C43f02h90wQ3dneaY++4hGDAxTfO/GWPmiznfNDdfc8hqc8IfXQcj9hU3/R6sOuf bpTAX2w1jeukyhsVXjZxoEgXwhLb8QCR4+kfNdSF/51122f9Z3CF0BJqoMpJRN6ndh8/ n99a1/puPp7gIYvMBXJe4DPVWZ0B7mhWMxh1YrwnA+YhrjdM6C7AYuSMAFT93mjWADZ4 unXMKvfAhb7E9ntXvUae0hYpzUPDtBWLKGNPIRFqpx2mUGqkSn67Mq/ScfwROzHZRFHN 8l8M8YiFCqlCXqt6w8LQ2ZQbP4UfM4rx8zxbRMTDzih8ZYR2sUHCuuG20yHyxW12Z3u0 7HGw== X-Gm-Message-State: AOAM530QrGe0cEbHVP7ewHsWuXVoA8wyWV2QKJFwVjy5af3K7hbcoYiT 3ENZ64BwVIs1N0gWjtg/FsJLSo7RPTq6qYwzstu2KYcu1h4= X-Google-Smtp-Source: ABdhPJxs7x86ibXah0ZIYch/6tQJmgfwiCI2BG4MbjXFoXF96DGkhSXOZxv3cz3xUaahyLV1izEDv9vxc0EW9v9WLlM= X-Received: by 2002:ad4:5e8c:: with SMTP id jl12mr30503162qvb.58.1639189784330; Fri, 10 Dec 2021 18:29:44 -0800 (PST) In-Reply-To: <83lf0uuqaq.fsf@gnu.org> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::f2f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::f2f; envelope-from=silent2600@gmail.com; helo=mail-qv1-xf2f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281636 Archived-At: --000000000000d0866405d2d59cde Content-Type: text/plain; charset="UTF-8" git diff diff --git a/src/comp.c b/src/comp.c index 43feac6..2941f84 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5191,6 +5191,8 @@ DEFUN ("comp--register-lambda", Fcomp__register_lambda, Scomp__register_lambda, Lisp_Object maxarg, Lisp_Object type, Lisp_Object rest, Lisp_Object comp_u) { + CHECK_CONS(rest); + Lisp_Object doc_idx = FIRST (rest); Lisp_Object intspec = SECOND (rest); struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (comp_u); diff --git a/src/dynlib.c b/src/dynlib.c index a8c8843..362530b 100644 --- a/src/dynlib.c +++ b/src/dynlib.c @@ -270,7 +270,8 @@ dynlib_close (dynlib_handle_ptr h) dynlib_handle_ptr dynlib_open (const char *path) { - return dlopen (path, RTLD_LAZY); + // return dlopen (path, RTLD_LAZY); + return dlopen (path, RTLD_LAZY|RTLD_GLOBAL); } delete the eln-cache, execute with -nw -q in gdb, wait a few seconds: (gdb) bt #0 _dl_lookup_symbol_x (undef_name=0x555555e3814300 , undef_map=0x555556059380, ref=0x7fffffffc1b8, symbol_scope=0x555556059718, version=0x0, type_class=0, flags=2, skip_map=0x0) at dl-lookup.c:842 #1 0x00007ffff4082b74 in do_sym (handle=, name=0x555555e3814300 , who=0x55555580b073 , vers=vers@entry=0x0, flags=flags@entry=2) at dl-sym.c:165 #2 0x00007ffff408305d in _dl_sym (handle=, name=, who=) at dl-sym.c:274 #3 0x00007ffff5bdf3b4 in dlsym_doit (a=a@entry=0x7fffffffc3f0) at dlsym.c:50 #4 0x00007ffff4083260 in __GI__dl_catch_exception (exception=exception@entry=0x7fffffffc390, operate=0x7ffff5bdf3a0 , args=0x7fffffffc3f0) at dl-error-skeleton.c:208 #5 0x00007ffff408331f in __GI__dl_catch_error (objname=0x555555dab830, errstring=0x555555dab838, mallocedp=0x555555dab828, operate=, args=) at dl-error-skeleton.c:227 #6 0x00007ffff5bdfa65 in _dlerror_run (operate=operate@entry=0x7ffff5bdf3a0 , args=args@entry=0x7fffffffc3f0) at dlerror.c:170 #7 0x00007ffff5bdf41c in __dlsym (handle=, name=) at dlsym.c:70 #8 0x000055555580b073 in dynlib_sym (h=0x555556059380, sym=0x555555e3814300 ) at dynlib.c:280 #9 0x0000555555809f63 in make_subr (symbol_name=0x555555e38153, minarg=0x16, maxarg=0x16, c_name=0x555555e38153, type=0xfc30, doc_idx=0xba, intspec=0x0, comp_u=0x555555df6d1d) at comp.c:5147 #10 0x000055555580a156 in Fcomp__register_lambda (reloc_idx=0xa, c_name=0x555555e38153, minarg=0x16, maxarg=0x16, type=0xfc30, rest=0x555555e17c03, comp_u=0x555555df6d1d) at comp.c:5203 #11 0x00007fffef0eed34 in late_top_level_run () at /home/silent/.emacs.d/eln-cache/28.0.90-8dcada16/cconv-3b1f1f98-cca24f72.eln #12 0x0000555555809d51 in load_comp_unit (comp_u=0x555555df6d18, loading_dump=false, late_load=true) at comp.c:5093 #13 0x000055555580a875 in Fnative_elisp_load (filename=0x555556058174, late_load=0x30) at comp.c:5318 #14 0x00005555557af101 in funcall_subr (subr=0x555555c6aaa0 , numargs=2, args=0x7fffffffc848) at eval.c:3100 #15 0x00005555557aecde in Ffuncall (nargs=3, args=0x7fffffffc840) at eval.c:3023 #16 0x00005555557fb3e2 in exec_byte_code (bytestr=0x55555600ac44, vector=0x555555f472bd, maxdepth=0x1e, args_template=0x80a, nargs=2, args=0x7fffffffcd38) at bytecode.c:632 #17 0x00005555557af38d in fetch_and_exec_byte_code (fun=0x555555ee0ce5, syms_left=0x80a, nargs=2, args=0x7fffffffcd28) at eval.c:3147 #18 0x00005555557af71a in funcall_lambda (fun=0x555555ee0ce5, nargs=2, arg_vector=0x7fffffffcd28) at eval.c:3228 #19 0x00005555557aed32 in Ffuncall (nargs=3, args=0x7fffffffcd20) at eval.c:3027 #20 0x00005555557adfe8 in Fapply (nargs=2, args=0x7fffffffcde0) at eval.c:2653 #21 0x00005555557ae552 in apply1 (fn=0x555555ee0ce5, arg=0x555555f0eb43) at eval.c:2869 #22 0x0000555555818f75 in read_process_output_call (fun_and_args=0x555555f0eaf3) at process.c:5971 #23 0x00005555557ab197 in internal_condition_case_1 (bfun=0x555555818f47 , arg=0x555555f0eaf3, handlers=0x90, hfun=0x55555581bee7 ) at eval.c:1474 #24 0x000055555581c103 in exec_sentinel (proc=0x555555e1699d, reason=0x55555605a154) at process.c:7457 #25 0x000055555581c338 in status_notify (deleting_process=0x0, wait_proc=0x0) at process.c:7549 #26 0x0000555555817885 in wait_reading_process_output (time_limit=0, nsecs=0, read_kbd=-1, do_display=true, wait_for_cell=0x0, wait_proc=0x0, just_wait_proc=0) at process.c:5374 #27 0x00005555556facff in kbd_buffer_get_event (kbp=0x7fffffffd488, used_mouse_menu=0x7fffffffdacf, end_time=0x0) at keyboard.c:3926 #28 0x00005555556f6fbd in read_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffffd860, used_mouse_menu=0x7fffffffdacf) at keyboard.c:2198 #29 0x00005555556f7254 in read_decoded_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffffd860, prev_event=0x0, used_mouse_menu=0x7fffffffdacf) at keyboard.c:2262 #30 0x00005555556f88cf in read_char (commandflag=1, map=0x5555560ae943, prev_event=0x0, used_mouse_menu=0x7fffffffdacf, end_time=0x0) at keyboard.c:2892 #31 0x0000555555706f8f in read_key_sequence (keybuf=0x7fffffffdcd0, prompt=0x0, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9635 #32 0x00005555556f4d5d in command_loop_1 () at keyboard.c:1392 #33 0x00005555557ab0f0 in internal_condition_case (bfun=0x5555556f4917 , handlers=0x90, hfun=0x5555556f3f73 ) at eval.c:1450 #34 0x00005555556f45df in command_loop_2 (handlers=0x90) at keyboard.c:1133 #35 0x00005555557aa822 in internal_catch (tag=0xe7f0, func=0x5555556f45b8 , arg=0x90) at eval.c:1181 #36 0x00005555556f4584 in command_loop () at keyboard.c:1111 #37 0x00005555556f3b28 in recursive_edit_1 () at keyboard.c:720 #38 0x00005555556f3cc7 in Frecursive_edit () at keyboard.c:803 #39 0x00005555556f0717 in main (argc=3, argv=0x7fffffffe1b8) at emacs.c:2354 (gdb) ~/.emacs.d/eln-cache$ ls 28.0.90-8dcada16/ bytecomp-12882072-29d9ad62.eln cconv-3b1f1f98-cca24f72.eln xterm-6ea901d1-05e64e57.eln execute it again, emacs display message in minibuffer: Wrong type argument: consp, "F787465726d2d7472616e736c6174652d666f6375732d696e_xterm_translate_focus_in_0" *Messages* buffer: cl--generic-get-dispatcher: Wrong type argument: consp, "F787465726d2d7472616e736c6174652d666f6375732d696e_xterm_translate_focus_in_0" then I open my init.el, execute (package-initialize) c-x c-e, segfault: (gdb) bt #0 Fcomp__register_lambda (reloc_idx=0x1a, c_name=0x555555e79234, minarg=0x2, maxarg=0x2, type=0x0, rest=0x555555e5bb73, comp_u=0x555555eade25) at comp.c:5197 #1 0x00007fffef10c886 in top_level_run () at /home/silent/.emacs.d/eln-cache/28.0.90-8dcada16/bytecomp-12882072-29d9ad62.eln #2 0x0000555555809d51 in load_comp_unit (comp_u=0x555555eade20, loading_dump=false, late_load=false) at comp.c:5093 #3 0x000055555580a875 in Fnative_elisp_load (filename=0x555555e3b0a4, late_load=0x0) at comp.c:5318 #4 0x00005555557e1d36 in Fload (file=0x7ffff03a682c, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1565 #5 0x00005555557e207e in save_match_data_load (file=0x7ffff03a682c, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1629 #6 0x00005555557bdf33 in Frequire (feature=0x2aaa9a6cb638, filename=0x0, noerror=0x0) at fns.c:3184 #7 0x00005555557af134 in funcall_subr (subr=0x555555c67ce0 , numargs=1, args=0x7fffffffa9b0) at eval.c:3103 #8 0x00005555557aecde in Ffuncall (nargs=2, args=0x7fffffffa9a8) at eval.c:3023 #9 0x00005555557fb3e2 in exec_byte_code (bytestr=0x555555e4ea34, vector=0x555555dd07a5, maxdepth=0x2a, args_template=0x0, nargs=0, args=0x0) at bytecode.c:632 #10 0x00005555557fa8de in Fbyte_code (bytestr=0x555555e4ea34, vector=0x555555dd07a5, maxdepth=0x2a) at bytecode.c:334 #11 0x00005555557ad73c in eval_sub (form=0x555555eb2773) at eval.c:2504 #12 0x00005555557e40d4 in readevalloop (readcharfun=0x7830, infile0=0x7fffffffb240, sourcename=0x555555e4e074, printflag=false, unibyte=0x0, readfun=0x0, start=0x0, end=0x0) at lread.c:2326 #13 0x00005555557e1df8 in Fload (file=0x7ffff04df174, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1579 #14 0x00005555557e207e in save_match_data_load (file=0x7ffff04df174, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1629 #15 0x00005555557bdf33 in Frequire (feature=0x4680, filename=0x0, noerror=0x0) at fns.c:3184 #16 0x000055555580936f in maybe_defer_native_compilation (function_name=0x17dbf0, definition=0x555555de50fd) at comp.c:4870 #17 0x000055555578d8d1 in Fdefalias (symbol=0x555555e5bb73, definition=0x555555de50fd, docstring=0x0) at data.c:830 #18 0x00005555557ad73c in eval_sub (form=0x555555eb2923) at eval.c:2504 #19 0x00005555557e40d4 in readevalloop (readcharfun=0x7830, infile0=0x7fffffffb850, sourcename=0x555555ddcac4, printflag=false, unibyte=0x0, readfun=0x0, start=0x0, end=0x0) at lread.c:2326 #20 0x00005555557e1df8 in Fload (file=0x7ffff02b12fc, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1579 #21 0x00005555557e207e in save_match_data_load (file=0x7ffff02b12fc, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1629 #22 0x00005555557bdf33 in Frequire (feature=0x2aaa9a5d6108, filename=0x0, noerror=0x0) at fns.c:3184 #23 0x00005555557af134 in funcall_subr (subr=0x555555c67ce0 , numargs=1, args=0x7fffffffbb50) at eval.c:3103 #24 0x00005555557aecde in Ffuncall (nargs=2, args=0x7fffffffbb48) at eval.c:3023 #25 0x00005555557fb3e2 in exec_byte_code (bytestr=0x555555e07694, vector=0x555555e2c4c5, maxdepth=0x32, args_template=0x0, nargs=0, args=0x0) at bytecode.c:632 #26 0x00005555557fa8de in Fbyte_code (bytestr=0x555555e07694, vector=0x555555e2c4c5, maxdepth=0x32) at bytecode.c:334 #27 0x00005555557ad73c in eval_sub (form=0x555555eb3db3) at eval.c:2504 #28 0x00005555557e40d4 in readevalloop (readcharfun=0x7830, infile0=0x7fffffffc370, sourcename=0x555555e07c94, printflag=false, unibyte=0x0, readfun=0x0, start=0x0, end=0x0) at lread.c:2326 #29 0x00005555557e1df8 in Fload (file=0x7ffff01f3474, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1579 #30 0x00005555557e207e in save_match_data_load (file=0x7ffff01f3474, noerror=0x0, nomessage=0x30, nosuffix=0x0, must_suffix=0x30) at lread.c:1629 #31 0x00005555557acc82 in Fautoload_do_load (fundef=0x7ffff07c8973, funname=0x2aaa9aaed780, macro_only=0x0) at eval.c:2295 #32 0x00005555557ad9f2 in eval_sub (form=0x555555eb3e83) at eval.c:2557 #33 0x00005555557ace05 in Feval (form=0x555555eb3e83, lexical=0x0) at eval.c:2327 #34 0x00005555557af101 in funcall_subr (subr=0x555555c654c0 , numargs=2, args=0x7fffffffc7d8) at eval.c:3100 #35 0x00005555557aecde in Ffuncall (nargs=3, args=0x7fffffffc7d0) at eval.c:3023 #36 0x00005555557fb3e2 in exec_byte_code (bytestr=0x7ffff039cf54, vector=0x7ffff039c5f5, maxdepth=0x3e, args_template=0x406, nargs=1, args=0x7fffffffcd00) at bytecode.c:632 #37 0x00005555557af38d in fetch_and_exec_byte_code (fun=0x7ffff039c5c5, syms_left=0x406, nargs=1, args=0x7fffffffccf8) at eval.c:3147 #38 0x00005555557af71a in funcall_lambda (fun=0x7ffff039c5c5, nargs=1, arg_vector=0x7fffffffccf8) at eval.c:3228 #39 0x00005555557aed32 in Ffuncall (nargs=2, args=0x7fffffffccf0) at eval.c:3027 #40 0x00005555557fb3e2 in exec_byte_code (bytestr=0x7ffff039d154, vector=0x7ffff039c565, maxdepth=0x12, args_template=0x406, nargs=1, args=0x7fffffffd2f8) at bytecode.c:632 #41 0x00005555557af38d in fetch_and_exec_byte_code (fun=0x7ffff039c52d, syms_left=0x406, nargs=1, args=0x7fffffffd2f0) at eval.c:3147 #42 0x00005555557af71a in funcall_lambda (fun=0x7ffff039c52d, nargs=1, arg_vector=0x7fffffffd2f0) at eval.c:3228 #43 0x00005555557aed32 in Ffuncall (nargs=2, args=0x7fffffffd2e8) at eval.c:3027 #44 0x00005555557a5579 in Ffuncall_interactively (nargs=2, args=0x7fffffffd2e8) at callint.c:260 #45 0x00005555557af000 in funcall_subr (subr=0x555555c64920 , numargs=2, args=0x7fffffffd2e8) at eval.c:3078 #46 0x00005555557aecde in Ffuncall (nargs=3, args=0x7fffffffd2e0) at eval.c:3023 #47 0x00005555557a792c in Fcall_interactively (function=0x2aaa9a6c1338, record_flag=0x0, keys=0x555555dd112d) at callint.c:798 #48 0x00005555557af134 in funcall_subr (subr=0x555555c64980 , numargs=3, args=0x7fffffffd720) at eval.c:3103 #49 0x00005555557aecde in Ffuncall (nargs=4, args=0x7fffffffd718) at eval.c:3023 #50 0x00005555557fb3e2 in exec_byte_code (bytestr=0x7ffff02aa224, vector=0x7ffff02a9e8d, maxdepth=0x36, args_template=0x1006, nargs=1, args=0x7fffffffdca0) at bytecode.c:632 #51 0x00005555557af38d in fetch_and_exec_byte_code (fun=0x7ffff02a9e5d, syms_left=0x1006, nargs=1, args=0x7fffffffdc98) at eval.c:3147 #52 0x00005555557af71a in funcall_lambda (fun=0x7ffff02a9e5d, nargs=1, arg_vector=0x7fffffffdc98) at eval.c:3228 #53 0x00005555557aed32 in Ffuncall (nargs=2, args=0x7fffffffdc90) at eval.c:3027 #54 0x00005555557ae5a4 in call1 (fn=0x4590, arg1=0x2aaa9a6c1338) at eval.c:2883 #55 0x00005555556f5100 in command_loop_1 () at keyboard.c:1505 #56 0x00005555557ab0f0 in internal_condition_case (bfun=0x5555556f4917 , handlers=0x90, hfun=0x5555556f3f73 ) at eval.c:1450 #57 0x00005555556f45df in command_loop_2 (handlers=0x90) at keyboard.c:1133 #58 0x00005555557aa822 in internal_catch (tag=0xe7f0, func=0x5555556f45b8 , arg=0x90) at eval.c:1181 #59 0x00005555556f4584 in command_loop () at keyboard.c:1111 #60 0x00005555556f3b28 in recursive_edit_1 () at keyboard.c:720 #61 0x00005555556f3cc7 in Frecursive_edit () at keyboard.c:803 #62 0x00005555556f0717 in main (argc=3, argv=0x7fffffffe1b8) at emacs.c:2354 I realized I should not change dynlib.c but src/emacs-module.c: emacs-module.c: handle = dynlib_open (SSDATA (file)); On Thu, Dec 9, 2021 at 4:38 PM Eli Zaretskii wrote: > > From: hx > > Date: Thu, 9 Dec 2021 08:51:03 +0800 > > Cc: emacs-devel > > > > remove the directory (28.0.90-xxx) from ~/.emacs.d/eln-cache/, > > start emacs with -nw -q, it will crash after a few seconds without any > operation. > > after that, it will crash immediately when I start it with the same > parameters. > > It doesn't crash when I try reproducing it, so something is missing > from the recipe. Is this with an unmodified Emacs 28.0.90, or is it > with your change in dynlib.c? > > Anyway, does the patch below help? > > Andrea, any better ideas? I don't understand the reason for the > crash, as we seem to have defenses against this in Fnative_elisp_load, > so I'm probably missing something. > > diff --git a/src/comp.c b/src/comp.c > index 43feac6..42eb0af 100644 > --- a/src/comp.c > +++ b/src/comp.c > @@ -5191,6 +5191,8 @@ DEFUN ("comp--register-lambda", > Fcomp__register_lambda, Scomp__register_lambda, > Lisp_Object maxarg, Lisp_Object type, Lisp_Object rest, > Lisp_Object comp_u) > { > + CHECK_CONS (rest); > + > Lisp_Object doc_idx = FIRST (rest); > Lisp_Object intspec = SECOND (rest); > struct Lisp_Native_Comp_Unit *cu = XNATIVE_COMP_UNIT (comp_u); > --000000000000d0866405d2d59cde Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
git diff
diff --git a/src/comp.c b/src/comp.c
index = 43feac6..2941f84 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5191= ,6 +5191,8 @@ DEFUN ("comp--register-lambda", Fcomp__register_lam= bda, Scomp__register_lambda,
=C2=A0 =C2=A0 Lisp_Object maxarg, Lisp_Obje= ct type, Lisp_Object rest,
=C2=A0 =C2=A0 Lisp_Object comp_u)
=C2=A0{<= br>+ =C2=A0CHECK_CONS(rest);
+
=C2=A0 =C2=A0Lisp_Object doc_idx =3D F= IRST (rest);
=C2=A0 =C2=A0Lisp_Object intspec =3D SECOND (rest);
=C2= =A0 =C2=A0struct Lisp_Native_Comp_Unit *cu =3D XNATIVE_COMP_UNIT (comp_u);<= br>diff --git a/src/dynlib.c b/src/dynlib.c
index a8c8843..362530b 10064= 4
--- a/src/dynlib.c
+++ b/src/dynlib.c
@@ -270,7 +270,8 @@ dynlib= _close (dynlib_handle_ptr h)
=C2=A0dynlib_handle_ptr
=C2=A0dynlib_ope= n (const char *path)
=C2=A0{
- =C2=A0return dlopen (path, RTLD_LAZY);=
+ =C2=A0// return dlopen (path, RTLD_LAZY);
+ =C2=A0return dlopen (p= ath, RTLD_LAZY|RTLD_GLOBAL);
=C2=A0}
=C2=A0

de= lete the eln-cache, execute with -nw -q in gdb, wait a few seconds:
(gdb) bt
#0 =C2=A0_dl_lookup_symbol_x (undef_name=3D0x555555e3814300 = <error: Cannot access memory at address 0x555555e3814300>, undef_map= =3D0x555556059380, ref=3D0x7fffffffc1b8, symbol_scope=3D0x555556059718, ver= sion=3D0x0, type_class=3D0, flags=3D2, skip_map=3D0x0) at dl-lookup.c:842#1 =C2=A00x00007ffff4082b74 in do_sym (handle=3D<optimized out>, na= me=3D0x555555e3814300 <error: Cannot access memory at address 0x555555e3= 814300>, who=3D0x55555580b073 <dynlib_sym+35>, vers=3Dvers@entry= =3D0x0, flags=3Dflags@entry=3D2) at dl-sym.c:165
#2 =C2=A00x00007ffff408= 305d in _dl_sym (handle=3D<optimized out>, name=3D<optimized out&g= t;, who=3D<optimized out>) at dl-sym.c:274
#3 =C2=A00x00007ffff5bd= f3b4 in dlsym_doit (a=3Da@entry=3D0x7fffffffc3f0) at dlsym.c:50
#4 =C2= =A00x00007ffff4083260 in __GI__dl_catch_exception (exception=3Dexception@en= try=3D0x7fffffffc390, operate=3D0x7ffff5bdf3a0 <dlsym_doit>, args=3D0= x7fffffffc3f0) at dl-error-skeleton.c:208
#5 =C2=A00x00007ffff408331f in= __GI__dl_catch_error (objname=3D0x555555dab830, errstring=3D0x555555dab838= , mallocedp=3D0x555555dab828, operate=3D<optimized out>, args=3D<o= ptimized out>) at dl-error-skeleton.c:227
#6 =C2=A00x00007ffff5bdfa65= in _dlerror_run (operate=3Doperate@entry=3D0x7ffff5bdf3a0 <dlsym_doit&g= t;, args=3Dargs@entry=3D0x7fffffffc3f0) at dlerror.c:170
#7 =C2=A00x0000= 7ffff5bdf41c in __dlsym (handle=3D<optimized out>, name=3D<optimiz= ed out>) at dlsym.c:70
#8 =C2=A00x000055555580b073 in dynlib_sym (h= =3D0x555556059380, sym=3D0x555555e3814300 <error: Cannot access memory a= t address 0x555555e3814300>) at dynlib.c:280
#9 =C2=A00x0000555555809= f63 in make_subr (symbol_name=3D0x555555e38153, minarg=3D0x16, maxarg=3D0x1= 6, c_name=3D0x555555e38153, type=3D0xfc30, doc_idx=3D0xba, intspec=3D0x0, c= omp_u=3D0x555555df6d1d) at comp.c:5147
#10 0x000055555580a156 in Fcomp__= register_lambda (reloc_idx=3D0xa, c_name=3D0x555555e38153, minarg=3D0x16, m= axarg=3D0x16, type=3D0xfc30, rest=3D0x555555e17c03, comp_u=3D0x555555df6d1d= ) at comp.c:5203
#11 0x00007fffef0eed34 in late_top_level_run () at /hom= e/silent/.emacs.d/eln-cache/28.0.90-8dcada16/cconv-3b1f1f98-cca24f72.eln#12 0x0000555555809d51 in load_comp_unit (comp_u=3D0x555555df6d18, loading= _dump=3Dfalse, late_load=3Dtrue) at comp.c:5093
#13 0x000055555580a875 i= n Fnative_elisp_load (filename=3D0x555556058174, late_load=3D0x30) at comp.= c:5318
#14 0x00005555557af101 in funcall_subr (subr=3D0x555555c6aaa0 <= ;Snative_elisp_load>, numargs=3D2, args=3D0x7fffffffc848) at eval.c:3100=
#15 0x00005555557aecde in Ffuncall (nargs=3D3, args=3D0x7fffffffc840) a= t eval.c:3023
#16 0x00005555557fb3e2 in exec_byte_code (bytestr=3D0x5555= 5600ac44, vector=3D0x555555f472bd, maxdepth=3D0x1e, args_template=3D0x80a, = nargs=3D2, args=3D0x7fffffffcd38) at bytecode.c:632
#17 0x00005555557af3= 8d in fetch_and_exec_byte_code (fun=3D0x555555ee0ce5, syms_left=3D0x80a, na= rgs=3D2, args=3D0x7fffffffcd28) at eval.c:3147
#18 0x00005555557af71a in= funcall_lambda (fun=3D0x555555ee0ce5, nargs=3D2, arg_vector=3D0x7fffffffcd= 28) at eval.c:3228
#19 0x00005555557aed32 in Ffuncall (nargs=3D3, args= =3D0x7fffffffcd20) at eval.c:3027
#20 0x00005555557adfe8 in Fapply (narg= s=3D2, args=3D0x7fffffffcde0) at eval.c:2653
#21 0x00005555557ae552 in a= pply1 (fn=3D0x555555ee0ce5, arg=3D0x555555f0eb43) at eval.c:2869
#22 0x0= 000555555818f75 in read_process_output_call (fun_and_args=3D0x555555f0eaf3)= at process.c:5971
#23 0x00005555557ab197 in internal_condition_case_1 (= bfun=3D0x555555818f47 <read_process_output_call>, arg=3D0x555555f0eaf= 3, handlers=3D0x90, hfun=3D0x55555581bee7 <exec_sentinel_error_handler&g= t;) at eval.c:1474
#24 0x000055555581c103 in exec_sentinel (proc=3D0x555= 555e1699d, reason=3D0x55555605a154) at process.c:7457
#25 0x000055555581= c338 in status_notify (deleting_process=3D0x0, wait_proc=3D0x0) at process.= c:7549
#26 0x0000555555817885 in wait_reading_process_output (time_limit= =3D0, nsecs=3D0, read_kbd=3D-1, do_display=3Dtrue, wait_for_cell=3D0x0, wai= t_proc=3D0x0, just_wait_proc=3D0) at process.c:5374
#27 0x00005555556fac= ff in kbd_buffer_get_event (kbp=3D0x7fffffffd488, used_mouse_menu=3D0x7ffff= fffdacf, end_time=3D0x0) at keyboard.c:3926
#28 0x00005555556f6fbd in re= ad_event_from_main_queue (end_time=3D0x0, local_getcjmp=3D0x7fffffffd860, u= sed_mouse_menu=3D0x7fffffffdacf) at keyboard.c:2198
#29 0x00005555556f72= 54 in read_decoded_event_from_main_queue (end_time=3D0x0, local_getcjmp=3D0= x7fffffffd860, prev_event=3D0x0, used_mouse_menu=3D0x7fffffffdacf) at keybo= ard.c:2262
#30 0x00005555556f88cf in read_char (commandflag=3D1, map=3D0= x5555560ae943, prev_event=3D0x0, used_mouse_menu=3D0x7fffffffdacf, end_time= =3D0x0) at keyboard.c:2892
#31 0x0000555555706f8f in read_key_sequence (= keybuf=3D0x7fffffffdcd0, prompt=3D0x0, dont_downcase_last=3Dfalse, can_retu= rn_switch_frame=3Dtrue, fix_current_buffer=3Dtrue, prevent_redisplay=3Dfals= e) at keyboard.c:9635
#32 0x00005555556f4d5d in command_loop_1 () at key= board.c:1392
#33 0x00005555557ab0f0 in internal_condition_case (bfun=3D0= x5555556f4917 <command_loop_1>, handlers=3D0x90, hfun=3D0x5555556f3f7= 3 <cmd_error>) at eval.c:1450
#34 0x00005555556f45df in command_lo= op_2 (handlers=3D0x90) at keyboard.c:1133
#35 0x00005555557aa822 in inte= rnal_catch (tag=3D0xe7f0, func=3D0x5555556f45b8 <command_loop_2>, arg= =3D0x90) at eval.c:1181
#36 0x00005555556f4584 in command_loop () at key= board.c:1111
#37 0x00005555556f3b28 in recursive_edit_1 () at keyboard.c= :720
#38 0x00005555556f3cc7 in Frecursive_edit () at keyboard.c:803
#= 39 0x00005555556f0717 in main (argc=3D3, argv=3D0x7fffffffe1b8) at emacs.c:= 2354
(gdb)

~/.emacs.d/eln-cache$ ls 28.0.90-8dcada16= /
bytecomp-12882072-29d9ad62.eln =C2=A0cconv-3b1f1f98-cca24f72.eln =C2= =A0xterm-6ea901d1-05e64e57.eln

=C2=A0execute it agai= n, emacs display message in minibuffer:=C2=A0Wrong type argument: consp, &q= uot;F787465726d2d7472616e736c6174652d666f6375732d696e_xterm_translate_focus= _in_0"
*Messages* buffer:=C2=A0cl--generic-get-dispatche= r: Wrong type argument: consp, "F787465726d2d7472616e736c6174652d666f6= 375732d696e_xterm_translate_focus_in_0"

then = I open my init.el, execute (package-initialize)=C2=A0 c-x c-e, segfault:(gdb) bt
#0 =C2=A0Fcomp__register_lambda (reloc_idx=3D0x1a, c_name=3D0x= 555555e79234, minarg=3D0x2, maxarg=3D0x2, type=3D0x0, rest=3D0x555555e5bb73= , comp_u=3D0x555555eade25) at comp.c:5197
#1 =C2=A00x00007fffef10c886 in= top_level_run () at /home/silent/.emacs.d/eln-cache/28.0.90-8dcada16/bytec= omp-12882072-29d9ad62.eln
#2 =C2=A00x0000555555809d51 in load_comp_unit = (comp_u=3D0x555555eade20, loading_dump=3Dfalse, late_load=3Dfalse) at comp.= c:5093
#3 =C2=A00x000055555580a875 in Fnative_elisp_load (filename=3D0x5= 55555e3b0a4, late_load=3D0x0) at comp.c:5318
#4 =C2=A00x00005555557e1d36= in Fload (file=3D0x7ffff03a682c, noerror=3D0x0, nomessage=3D0x30, nosuffix= =3D0x0, must_suffix=3D0x30) at lread.c:1565
#5 =C2=A00x00005555557e207e = in save_match_data_load (file=3D0x7ffff03a682c, noerror=3D0x0, nomessage=3D= 0x30, nosuffix=3D0x0, must_suffix=3D0x30) at lread.c:1629
#6 =C2=A00x000= 05555557bdf33 in Frequire (feature=3D0x2aaa9a6cb638, filename=3D0x0, noerro= r=3D0x0) at fns.c:3184
#7 =C2=A00x00005555557af134 in funcall_subr (subr= =3D0x555555c67ce0 <Srequire>, numargs=3D1, args=3D0x7fffffffa9b0) at = eval.c:3103
#8 =C2=A00x00005555557aecde in Ffuncall (nargs=3D2, args=3D0= x7fffffffa9a8) at eval.c:3023
#9 =C2=A00x00005555557fb3e2 in exec_byte_c= ode (bytestr=3D0x555555e4ea34, vector=3D0x555555dd07a5, maxdepth=3D0x2a, ar= gs_template=3D0x0, nargs=3D0, args=3D0x0) at bytecode.c:632
#10 0x000055= 55557fa8de in Fbyte_code (bytestr=3D0x555555e4ea34, vector=3D0x555555dd07a5= , maxdepth=3D0x2a) at bytecode.c:334
#11 0x00005555557ad73c in eval_sub = (form=3D0x555555eb2773) at eval.c:2504
#12 0x00005555557e40d4 in readeva= lloop (readcharfun=3D0x7830, infile0=3D0x7fffffffb240, sourcename=3D0x55555= 5e4e074, printflag=3Dfalse, unibyte=3D0x0, readfun=3D0x0, start=3D0x0, end= =3D0x0) at lread.c:2326
#13 0x00005555557e1df8 in Fload (file=3D0x7ffff0= 4df174, noerror=3D0x0, nomessage=3D0x30, nosuffix=3D0x0, must_suffix=3D0x30= ) at lread.c:1579
#14 0x00005555557e207e in save_match_data_load (file= =3D0x7ffff04df174, noerror=3D0x0, nomessage=3D0x30, nosuffix=3D0x0, must_su= ffix=3D0x30) at lread.c:1629
#15 0x00005555557bdf33 in Frequire (feature= =3D0x4680, filename=3D0x0, noerror=3D0x0) at fns.c:3184
#16 0x0000555555= 80936f in maybe_defer_native_compilation (function_name=3D0x17dbf0, definit= ion=3D0x555555de50fd) at comp.c:4870
#17 0x000055555578d8d1 in Fdefalias= (symbol=3D0x555555e5bb73, definition=3D0x555555de50fd, docstring=3D0x0) at= data.c:830
#18 0x00005555557ad73c in eval_sub (form=3D0x555555eb2923) a= t eval.c:2504
#19 0x00005555557e40d4 in readevalloop (readcharfun=3D0x78= 30, infile0=3D0x7fffffffb850, sourcename=3D0x555555ddcac4, printflag=3Dfals= e, unibyte=3D0x0, readfun=3D0x0, start=3D0x0, end=3D0x0) at lread.c:2326#20 0x00005555557e1df8 in Fload (file=3D0x7ffff02b12fc, noerror=3D0x0, nom= essage=3D0x30, nosuffix=3D0x0, must_suffix=3D0x30) at lread.c:1579
#21 0= x00005555557e207e in save_match_data_load (file=3D0x7ffff02b12fc, noerror= =3D0x0, nomessage=3D0x30, nosuffix=3D0x0, must_suffix=3D0x30) at lread.c:16= 29
#22 0x00005555557bdf33 in Frequire (feature=3D0x2aaa9a5d6108, filenam= e=3D0x0, noerror=3D0x0) at fns.c:3184
#23 0x00005555557af134 in funcall_= subr (subr=3D0x555555c67ce0 <Srequire>, numargs=3D1, args=3D0x7ffffff= fbb50) at eval.c:3103
#24 0x00005555557aecde in Ffuncall (nargs=3D2, arg= s=3D0x7fffffffbb48) at eval.c:3023
#25 0x00005555557fb3e2 in exec_byte_c= ode (bytestr=3D0x555555e07694, vector=3D0x555555e2c4c5, maxdepth=3D0x32, ar= gs_template=3D0x0, nargs=3D0, args=3D0x0) at bytecode.c:632
#26 0x000055= 55557fa8de in Fbyte_code (bytestr=3D0x555555e07694, vector=3D0x555555e2c4c5= , maxdepth=3D0x32) at bytecode.c:334
#27 0x00005555557ad73c in eval_sub = (form=3D0x555555eb3db3) at eval.c:2504
#28 0x00005555557e40d4 in readeva= lloop (readcharfun=3D0x7830, infile0=3D0x7fffffffc370, sourcename=3D0x55555= 5e07c94, printflag=3Dfalse, unibyte=3D0x0, readfun=3D0x0, start=3D0x0, end= =3D0x0) at lread.c:2326
#29 0x00005555557e1df8 in Fload (file=3D0x7ffff0= 1f3474, noerror=3D0x0, nomessage=3D0x30, nosuffix=3D0x0, must_suffix=3D0x30= ) at lread.c:1579
#30 0x00005555557e207e in save_match_data_load (file= =3D0x7ffff01f3474, noerror=3D0x0, nomessage=3D0x30, nosuffix=3D0x0, must_su= ffix=3D0x30) at lread.c:1629
#31 0x00005555557acc82 in Fautoload_do_load= (fundef=3D0x7ffff07c8973, funname=3D0x2aaa9aaed780, macro_only=3D0x0) at e= val.c:2295
#32 0x00005555557ad9f2 in eval_sub (form=3D0x555555eb3e83) at= eval.c:2557
#33 0x00005555557ace05 in Feval (form=3D0x555555eb3e83, lex= ical=3D0x0) at eval.c:2327
#34 0x00005555557af101 in funcall_subr (subr= =3D0x555555c654c0 <Seval>, numargs=3D2, args=3D0x7fffffffc7d8) at eva= l.c:3100
#35 0x00005555557aecde in Ffuncall (nargs=3D3, args=3D0x7ffffff= fc7d0) at eval.c:3023
#36 0x00005555557fb3e2 in exec_byte_code (bytestr= =3D0x7ffff039cf54, vector=3D0x7ffff039c5f5, maxdepth=3D0x3e, args_template= =3D0x406, nargs=3D1, args=3D0x7fffffffcd00) at bytecode.c:632
#37 0x0000= 5555557af38d in fetch_and_exec_byte_code (fun=3D0x7ffff039c5c5, syms_left= =3D0x406, nargs=3D1, args=3D0x7fffffffccf8) at eval.c:3147
#38 0x0000555= 5557af71a in funcall_lambda (fun=3D0x7ffff039c5c5, nargs=3D1, arg_vector=3D= 0x7fffffffccf8) at eval.c:3228
#39 0x00005555557aed32 in Ffuncall (nargs= =3D2, args=3D0x7fffffffccf0) at eval.c:3027
#40 0x00005555557fb3e2 in ex= ec_byte_code (bytestr=3D0x7ffff039d154, vector=3D0x7ffff039c565, maxdepth= =3D0x12, args_template=3D0x406, nargs=3D1, args=3D0x7fffffffd2f8) at byteco= de.c:632
#41 0x00005555557af38d in fetch_and_exec_byte_code (fun=3D0x7ff= ff039c52d, syms_left=3D0x406, nargs=3D1, args=3D0x7fffffffd2f0) at eval.c:3= 147
#42 0x00005555557af71a in funcall_lambda (fun=3D0x7ffff039c52d, narg= s=3D1, arg_vector=3D0x7fffffffd2f0) at eval.c:3228
#43 0x00005555557aed3= 2 in Ffuncall (nargs=3D2, args=3D0x7fffffffd2e8) at eval.c:3027
#44 0x00= 005555557a5579 in Ffuncall_interactively (nargs=3D2, args=3D0x7fffffffd2e8)= at callint.c:260
#45 0x00005555557af000 in funcall_subr (subr=3D0x55555= 5c64920 <Sfuncall_interactively>, numargs=3D2, args=3D0x7fffffffd2e8)= at eval.c:3078
#46 0x00005555557aecde in Ffuncall (nargs=3D3, args=3D0x= 7fffffffd2e0) at eval.c:3023
#47 0x00005555557a792c in Fcall_interactive= ly (function=3D0x2aaa9a6c1338, record_flag=3D0x0, keys=3D0x555555dd112d) at= callint.c:798
#48 0x00005555557af134 in funcall_subr (subr=3D0x555555c6= 4980 <Scall_interactively>, numargs=3D3, args=3D0x7fffffffd720) at ev= al.c:3103
#49 0x00005555557aecde in Ffuncall (nargs=3D4, args=3D0x7fffff= ffd718) at eval.c:3023
#50 0x00005555557fb3e2 in exec_byte_code (bytestr= =3D0x7ffff02aa224, vector=3D0x7ffff02a9e8d, maxdepth=3D0x36, args_template= =3D0x1006, nargs=3D1, args=3D0x7fffffffdca0) at bytecode.c:632
#51 0x000= 05555557af38d in fetch_and_exec_byte_code (fun=3D0x7ffff02a9e5d, syms_left= =3D0x1006, nargs=3D1, args=3D0x7fffffffdc98) at eval.c:3147
#52 0x000055= 55557af71a in funcall_lambda (fun=3D0x7ffff02a9e5d, nargs=3D1, arg_vector= =3D0x7fffffffdc98) at eval.c:3228
#53 0x00005555557aed32 in Ffuncall (na= rgs=3D2, args=3D0x7fffffffdc90) at eval.c:3027
#54 0x00005555557ae5a4 in= call1 (fn=3D0x4590, arg1=3D0x2aaa9a6c1338) at eval.c:2883
#55 0x0000555= 5556f5100 in command_loop_1 () at keyboard.c:1505
#56 0x00005555557ab0f0= in internal_condition_case (bfun=3D0x5555556f4917 <command_loop_1>, = handlers=3D0x90, hfun=3D0x5555556f3f73 <cmd_error>) at eval.c:1450#57 0x00005555556f45df in command_loop_2 (handlers=3D0x90) at keyboard.c:1= 133
#58 0x00005555557aa822 in internal_catch (tag=3D0xe7f0, func=3D0x555= 5556f45b8 <command_loop_2>, arg=3D0x90) at eval.c:1181
#59 0x00005= 555556f4584 in command_loop () at keyboard.c:1111
#60 0x00005555556f3b28= in recursive_edit_1 () at keyboard.c:720
#61 0x00005555556f3cc7 in Frec= ursive_edit () at keyboard.c:803
#62 0x00005555556f0717 in main (argc=3D= 3, argv=3D0x7fffffffe1b8) at emacs.c:2354

I re= alized I should not change=C2=A0dynlib.c but=C2=A0src/emacs-module.c:=C2=A0= emacs-module.c: =C2=A0handle =3D dynlib_open (SSDATA (file));


On Thu, Dec 9, 2021 at 4:38 PM Eli Zaretskii <eliz@gnu.org> wrote:
> From: hx <silent2600@gmail.com>
> Date: Thu, 9 Dec 2021 08:51:03 +0800
> Cc: emacs-devel <emacs-devel@gnu.org>
>
> remove the directory (28.0.90-xxx) from ~/.emacs.d/eln-cache/,
> start emacs with -nw -q, it will crash after a few seconds without any= operation.
> after that, it will crash immediately when I start it with the same pa= rameters.

It doesn't crash when I try reproducing it, so something is missing
from the recipe.=C2=A0 Is this with an unmodified Emacs 28.0.90, or is it with your change in dynlib.c?

Anyway, does the patch below help?

Andrea, any better ideas?=C2=A0 I don't understand the reason for the crash, as we seem to have defenses against this in Fnative_elisp_load,
so I'm probably missing something.

diff --git a/src/comp.c b/src/comp.c
index 43feac6..42eb0af 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -5191,6 +5191,8 @@ DEFUN ("comp--register-lambda", Fcomp__regi= ster_lambda, Scomp__register_lambda,
=C2=A0 =C2=A0 Lisp_Object maxarg, Lisp_Object type, Lisp_Object rest,
=C2=A0 =C2=A0 Lisp_Object comp_u)
=C2=A0{
+=C2=A0 CHECK_CONS (rest);
+
=C2=A0 =C2=A0Lisp_Object doc_idx =3D FIRST (rest);
=C2=A0 =C2=A0Lisp_Object intspec =3D SECOND (rest);
=C2=A0 =C2=A0struct Lisp_Native_Comp_Unit *cu =3D XNATIVE_COMP_UNIT (comp_u= );
--000000000000d0866405d2d59cde--