From: Denis Efremov <efremov@linux.com>
To: Julia Lawall <julia.lawall@inria.fr>
Cc: cocci@inria.fr
Subject: Re: [cocci] spatch 1.1.1 segmentation fault report
Date: Mon, 7 Feb 2022 16:01:27 +0300 [thread overview]
Message-ID: <98066af4-1d26-dead-4e85-71ef0ec45d47@linux.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2202071355350.52266@hadrien>
On 2/7/22 15:56, Julia Lawall wrote:
>
>
> On Mon, 7 Feb 2022, Denis Efremov wrote:
>
>>
>>
>> On 2/7/22 12:54, Julia Lawall wrote:
>>>
>>>
>>> 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 <corentin.de-souza@inria.fr>
>>>>>> 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=<optimized out>) 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.
>>
>> Installed with opam pyml.20211015
>> Line 247:
>> 244:static void pydecref( value v )
>> 245:{
>> 246: if (getcustom(v)) {
>> 247: Py_DECREF((PyObject *)getcustom(v));
>> 248: }
>> 249:}
>>
>> I uninstalled opam and rebuilded spatch with the bundled pyml on
>> latest commit: b2a4b9b77157 parsing_c: print correct attributes in pretty_print_c.ml
>>
>> Result is the same.
>>
>> #0 0x0000000000aa810e in pydecref ()
>> #1 0x0000000000ac512e in caml_empty_minor_heap () at minor_gc.c:409
>> #2 0x0000000000ac554c in caml_gc_dispatch () at minor_gc.c:475
>> #3 0x0000000000ac563e in caml_check_urgent_gc (extra_root=<optimized out>, extra_root@entry=1) at minor_gc.c:572
>> #4 0x0000000000ac56d3 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 0x0000000000ac6c71 in caml_alloc_small (wosize=wosize@entry=2, tag=tag@entry=0) at alloc.c:68
>> #6 0x0000000000accb2f in caml_ml_out_channels_list (unit=<optimized out>) at io.c:512
>> #7 0x0000000000a46645 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 0x0000000000adfca0 in caml_start_program ()
>> #11 0x0000000000ae0024 in caml_startup_common (argv=0x7ffcaf256848, pooling=<optimized out>, pooling@entry=0) at startup_nat.c:160
>> #12 0x0000000000ae009b in caml_startup_exn (argv=<optimized out>) at startup_nat.c:165
>> #13 caml_startup (argv=<optimized out>) at startup_nat.c:170
>> #14 caml_main (argv=<optimized out>) at startup_nat.c:177
>> #15 0x00000000005f3ddc in main (argc=<optimized out>, argv=<optimized out>) at main.c:44
>
> Thierry has found the problem. I will push the solution shortly to
> github. We can make a new release if you need that.
>
Thank you! I don't need a new release. But if there is a way to slightly change the pattern
to avoid the crash this will be useful to me.
Regards,
Denis
next prev parent reply other threads:[~2022-02-07 13:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-06 17:59 [cocci] spatch 1.1.1 segmentation fault report Denis Efremov
2022-02-06 18:14 ` Julia Lawall
2022-02-06 18:43 ` Julia Lawall
2022-02-06 19:04 ` Denis Efremov
2022-02-06 19:48 ` Julia Lawall
2022-02-06 20:38 ` Denis Efremov
2022-02-06 21:00 ` Julia Lawall
2022-02-06 22:53 ` Denis Efremov
2022-02-07 6:56 ` Julia Lawall
2022-02-07 7:17 ` Denis Efremov
2022-02-07 9:54 ` Julia Lawall
2022-02-07 12:45 ` Denis Efremov
2022-02-07 12:56 ` Julia Lawall
2022-02-07 13:01 ` Denis Efremov [this message]
2022-02-07 13:48 ` Julia Lawall
2022-02-07 14:15 ` Julia Lawall
2022-02-07 14:24 ` Denis Efremov
2022-02-07 12:06 ` Julia Lawall
2022-02-06 19:40 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=98066af4-1d26-dead-4e85-71ef0ec45d47@linux.com \
--to=efremov@linux.com \
--cc=cocci@inria.fr \
--cc=julia.lawall@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.