Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C97C9C433EF for ; Mon, 7 Feb 2022 09:54:22 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.88,349,1635199200"; d="scan'208";a="20032329" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 07 Feb 2022 10:54:21 +0100 Received: by sympa.inria.fr (Postfix, from userid 20132) id CDD8FE0384; Mon, 7 Feb 2022 10:54:20 +0100 (CET) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 25C09E037F for ; Mon, 7 Feb 2022 10:54:15 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.88,349,1635199200"; d="scan'208";a="5198559" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2022 10:54:15 +0100 Date: Mon, 7 Feb 2022 10:54:14 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Denis Efremov cc: cocci@inria.fr In-Reply-To: Message-ID: References: <412f6138-c5de-38f4-553b-6b34a0650005@linux.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [cocci] spatch 1.1.1 segmentation fault report Reply-To: Julia Lawall X-Loop: cocci@inria.fr X-Sequence: 133 Errors-To: cocci-owner@inria.fr Precedence: list Precedence: bulk Sender: cocci-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Mon, 7 Feb 2022, Denis Efremov wrote: > > > On 2/7/22 09:56, Julia Lawall wrote: > >> I checked that the problem persist on latest commit > >> b2a4b9b77157 parsing_c: print correct attributes in pretty_print_c.ml > >> > >> and bisected the crash to commit > >> 7b79a2415a8c6e8b1c39a8183bf732fdc6d00453 is the first bad commit > >> commit 7b79a2415a8c6e8b1c39a8183bf732fdc6d00453 > >> Author: Corentin De Souza > >> Date: Tue May 25 19:21:51 2021 +0200 > >> > >> parsing_c: detect macro iterators from their bodies > >> > >> This uses the same strategy as macro statements (see > >> https://gitlab.inria.fr/coccinelle/coccinelle/-/merge_requests/92). > >> The goal is to do fix https://gitlab.inria.fr/coccinelle/coccinelle/-/issues/24 > >> > >> The next commit will finally fix the assign_expr rule in the parser, removing > >> the conflicts it introduced while not breaking test > >> assign_deref_funcall_in_macro_it. > >> > >> parsing_c/cpp_token_c.ml | 39 ++++++++++++++++++++++++++++++--------- > >> parsing_c/parser_c.mly | 3 ++- > >> 2 files changed, 32 insertions(+), 10 deletions(-) > > > > Thanks for all of the investigation. I'll take a look at this commit, but > > from the subject it seems hard to imagine how it would affect python... > > > > Could you take a look at the core to see if indicates what function caused > > the problem? > > Core was generated by `spatch segfault.cocci empty_dir'. > Program terminated with signal SIGSEGV, Segmentation fault. > #0 0x0000000000aa8b7e in pydecref (v=) at pyml_stubs.c:247 > 247 pyml_stubs.c: Directory not empty. > (gdb) bt Does your pyml come from the bundle in Coccinelle or from opam? In my spatch 1.1.1 code, line 247 is just a variable declaration. julia > #0 0x0000000000aa8b7e in pydecref (v=) at pyml_stubs.c:247 > #1 0x0000000000ac5cee in caml_empty_minor_heap () at minor_gc.c:409 > #2 0x0000000000ac610c in caml_gc_dispatch () at minor_gc.c:475 > #3 0x0000000000ac61fe in caml_check_urgent_gc (extra_root=, extra_root@entry=1) at minor_gc.c:572 > #4 0x0000000000ac6293 in caml_alloc_small_dispatch (wosize=2, flags=flags@entry=1, nallocs=nallocs@entry=1, > encoded_alloc_lens=encoded_alloc_lens@entry=0x0) at minor_gc.c:516 > #5 0x0000000000ac7831 in caml_alloc_small (wosize=wosize@entry=2, tag=tag@entry=0) at alloc.c:68 > #6 0x0000000000acd6ef in caml_ml_out_channels_list (unit=) at io.c:512 > #7 0x0000000000a47005 in camlStdlib__flush_all_231 () at stdlib.ml:349 > #8 0x00000000005ffeaf in camlStd_exit__entry () at stdlib.ml:556 > #9 0x00000000005f5199 in caml_program () > #10 0x0000000000ae0860 in caml_start_program () > #11 0x0000000000ae0be4 in caml_startup_common (argv=0x7ffcf50f98c8, pooling=, pooling@entry=0) at startup_nat.c:160 > #12 0x0000000000ae0c5b in caml_startup_exn (argv=) at startup_nat.c:165 > #13 caml_startup (argv=) at startup_nat.c:170 > #14 caml_main (argv=) at startup_nat.c:177 > #15 0x00000000005f3ddc in main (argc=, argv=) at main.c:44 > > > > > > Do you have parmap installed on your machine or are you using the bundled > > version? > > I guess it's in my system: > > configure: configuring package parmap > checking for OCaml findlib package parmap... found > ... > cp /home/work/.opam/4.11.2/lib/parmap/parmap.cmi ocaml/parmap.cmi > if test -f /home/work/.opam/4.11.2/lib/parmap/parmap.cmx; then \ > cp /home/work/.opam/4.11.2/lib/parmap/parmap.cmx ocaml/parmap.cmx; \ > fi > > > > > Could use test with the bytecode version of Coccinelle? I think that > > would come without the --enable-opt option. > > > > When I build spatch with --disable-opt there is no crash. > >