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: Sun, 6 Feb 2022 22:04:03 +0300 [thread overview]
Message-ID: <f07ed61b-96e5-d99f-dc0f-d3f39b8291bf@linux.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2202061941500.3126@hadrien>
On 2/6/22 21:43, Julia Lawall wrote:
>
>
> On Sun, 6 Feb 2022, Denis Efremov wrote:
>
>> Hi,
>>
>> I'm observing a weird crash with spatch 1.1.1
>>
>> $ spatch --version
>> spatch version 1.1.1 compiled with OCaml version 4.11.2
>> Flags passed to the configure script: --enable-opt --enable-ocaml --enable-python --enable-pcre-syntax --enable-pcre --prefix /home/work/.opam/4.11.2 --libdir /home/work/.opam/4.11.2/lib
>> OCaml scripting support: yes
>> Python scripting support: yes
>> Syntax of regular expressions: PCRE
>>
>> $ cat segfault.cocci
>> @err@
>> position p;
>> @@
>>
>> amd_energy_is_visible(...)
>> {
>> * return 0444;@p
>> }
>>
>> @script:python@
>> p << err.p;
>> @@
>>
>> coccilib.report.print_report(p[0], "found")
>>
>> $ mkdir empty_dir # creating empty directory
>> $ spatch segfault.cocci empty_dir
>> init_defs_builtins: /home/work/.opam/4.11.2/lib/coccinelle/standard.h
>> 0 files match
>> [1] 152475 segmentation fault (core dumped) spatch segfault.cocci test
>
> I tried 1.1.1 with the options --enable-opt --enable-ocaml --enable-python
> --enable-pcre-syntax --enable-pcre, but it seems to work find for me.
> Does the problem go away if there is a file in the directory? If you
> remove the python code?
It doesn't crash if I run it on the linux kernel sources on commits prior to
9049572fb145 hwmon: Remove amd_energy driver
$ git checkout 9049572fb145~
# there is amd_energy_is_visible in drivers/hwmon/amd_energy.c
# spatch doesn't crash on this commit
$ git checkout 9049572fb145
# no amd_energy_is_visible in kernel source
# spatch crashes
If I remove python code then spatch doesn't crash.
$ python --version
Python 3.10.2
Thanks,
Denis
next prev parent reply other threads:[~2022-02-06 19:04 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 [this message]
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
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=f07ed61b-96e5-d99f-dc0f-d3f39b8291bf@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.