Coccinelle archive on lore.kernel.org
 help / Atom feed
* [Cocci] Problem with improper multi-line string literals
@ 2018-10-12 21:28 timur
  2018-10-12 21:37 ` julia.lawall
  2018-10-13 21:19 ` julia.lawall
  0 siblings, 2 replies; 20+ messages in thread
From: timur @ 2018-10-12 21:28 UTC (permalink / raw)
  To: cocci

I've attached a test.c and nv_printf.cocci file that demonstrates the problem.

It appears that Coccinelle sometimes cannot handle multi-line string
literals that are syntactically correct but still improper.  For
example:

        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
                    "NVRM: %s: this is a test \
                    of multiline " NvP64_fmt " strings %p\n",
                    __FUNCTION__,
                    p1,
                    p2));

This is valid C, but technically the string literal should have
quotation marks at the beginning of each line.  When Coccinelle
attempts to process my script with this, it gets confused and mangles
the parameters after the string literal:

 void func(void)
 {
-        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
-                    "NVRM: %s: this is a test \
-                    of multiline " NvP64_fmt " strings %p\n",
-                    __FUNCTION__,
-                    p1,
-                    p2));
-}
+        NV_PRINTF(DBG_LEVEL_ERRORS, "NVRM: %s: this is a test \
+                    of multiline " NvP64_fmt " strings %p\n", __FUNCTION__,
+                    of multiline "p1, p2);
+}"

I added code into my Python script to combine the string into one
line, but that doesn't really matter because Coccinelle doesn't even
call my Python code.  In fact, it ignores many of my rules because the
DBG_LEVEL_ERRORS should have been changed to "LEVEL_ERROR".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 267 bytes
Desc: not available
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20181012/b8997b9c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nv_printf.cocci
Type: application/octet-stream
Size: 4024 bytes
Desc: not available
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20181012/b8997b9c/attachment.obj>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-12 21:28 [Cocci] Problem with improper multi-line string literals timur
@ 2018-10-12 21:37 ` julia.lawall
  2018-10-12 21:42   ` timur
  2018-10-13 21:19 ` julia.lawall
  1 sibling, 1 reply; 20+ messages in thread
From: julia.lawall @ 2018-10-12 21:37 UTC (permalink / raw)
  To: cocci



On Fri, 12 Oct 2018, Timur Tabi wrote:

> I've attached a test.c and nv_printf.cocci file that demonstrates the problem.
>
> It appears that Coccinelle sometimes cannot handle multi-line string
> literals that are syntactically correct but still improper.  For
> example:

It does look strange.  Maybe you can avoid removing and reconstructing the
string.  For example, if you rewrite rule1 as:

@rule1@
expression x;
expression list y;
@@
-DBG_PRINTF
+NV_PRINTF
  (
- x,
  y);

then the code generated by rule1 is OK.  I haven't checked whether this
can be done in the whole semantic patch, though.

julia

>
>         DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
>                     "NVRM: %s: this is a test \
>                     of multiline " NvP64_fmt " strings %p\n",
>                     __FUNCTION__,
>                     p1,
>                     p2));
>
> This is valid C, but technically the string literal should have
> quotation marks at the beginning of each line.  When Coccinelle
> attempts to process my script with this, it gets confused and mangles
> the parameters after the string literal:
>
>  void func(void)
>  {
> -        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
> -                    "NVRM: %s: this is a test \
> -                    of multiline " NvP64_fmt " strings %p\n",
> -                    __FUNCTION__,
> -                    p1,
> -                    p2));
> -}
> +        NV_PRINTF(DBG_LEVEL_ERRORS, "NVRM: %s: this is a test \
> +                    of multiline " NvP64_fmt " strings %p\n", __FUNCTION__,
> +                    of multiline "p1, p2);
> +}"
>
> I added code into my Python script to combine the string into one
> line, but that doesn't really matter because Coccinelle doesn't even
> call my Python code.  In fact, it ignores many of my rules because the
> DBG_LEVEL_ERRORS should have been changed to "LEVEL_ERROR".
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-12 21:37 ` julia.lawall
@ 2018-10-12 21:42   ` timur
  2018-10-12 22:24     ` timur
       [not found]     ` <e4e5dc37-c364-c53d-26f6-52205cfee304@users.sourceforge.net>
  0 siblings, 2 replies; 20+ messages in thread
From: timur @ 2018-10-12 21:42 UTC (permalink / raw)
  To: cocci

On Fri, Oct 12, 2018 at 4:38 PM Julia Lawall <julia.lawall@lip6.fr> wrote:
> It does look strange.  Maybe you can avoid removing and reconstructing the
> string.  For example, if you rewrite rule1 as:
>
> @rule1@
> expression x;
> expression list y;
> @@
> -DBG_PRINTF
> +NV_PRINTF
>   (
> - x,
>   y);
>
> then the code generated by rule1 is OK.  I haven't checked whether this
> can be done in the whole semantic patch, though.

That made a huge difference, thanks.  I still need to keep the Python
code that merges the string into one line, but that could be just for
my own code vs Coccinelle's parser.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-12 21:42   ` timur
@ 2018-10-12 22:24     ` timur
  2018-10-12 23:08       ` timur
       [not found]     ` <e4e5dc37-c364-c53d-26f6-52205cfee304@users.sourceforge.net>
  1 sibling, 1 reply; 20+ messages in thread
From: timur @ 2018-10-12 22:24 UTC (permalink / raw)
  To: cocci

On Fri, Oct 12, 2018 at 4:42 PM Timur Tabi <timur@kernel.org> wrote:
> That made a huge difference, thanks.  I still need to keep the Python
> code that merges the string into one line, but that could be just for
> my own code vs Coccinelle's parser.

One drawback with your version is that it doesn't compress parameters
into fewer lines, like the original did, so I added this rule at the
very end:

// Finally, compress all the parameters into as few lines as possible
@depends on rules@
expression list x;
@@
-NV_PRINTF(x);
+NV_PRINTF(x);

I think now that my script is perfect.  Thanks again.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-12 22:24     ` timur
@ 2018-10-12 23:08       ` timur
  2018-10-12 23:22         ` timur
  0 siblings, 1 reply; 20+ messages in thread
From: timur @ 2018-10-12 23:08 UTC (permalink / raw)
  To: cocci

On Fri, Oct 12, 2018 at 5:24 PM Timur Tabi <timur@kernel.org> wrote:>
I think now that my script is perfect.  Thanks again.

Looks like I spoke too soon.  It's modifying lines that are already
NV_PRINTF(), despite all the "depends on" that I have.  I want
Coccinelle to ignore any lines in the C file that are already
NV_PRINTF and just modify lines that are DBG_PRINTF.  But when I add
an NV_PRINTF() line to test.c, I get this:

-        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
-                    "NVRM: %s: this is a test \
-                    of multiline " NvP64_fmt " strings %p\n",
-                    __FUNCTION__,
-                    p1,
-                    p2));
+        NV_PRINTF(LEVEL_ERROR,
+                  "this is a test of multiline " NvP64_fmt " strings %p\n",
+                  p1, p2);


-        NV_PRINTF(LEVEL_INFO, "%s\n", __FUNCTION__);
+        NV_PRINTF(LEVEL_INFO, "\n");

That second diff should not be there.

Looking at the output of --debug, I see it go through all the rules
and tell me what dependencies are satisfied, but it only does it once.
I would expect Coccinelle to re-evaluate all the rules for every line
of code it sees.  My script used to do that, so I broke it somehow.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-12 23:08       ` timur
@ 2018-10-12 23:22         ` timur
  2018-10-13  3:08           ` julia.lawall
  0 siblings, 1 reply; 20+ messages in thread
From: timur @ 2018-10-12 23:22 UTC (permalink / raw)
  To: cocci

On Fri, Oct 12, 2018 at 6:08 PM Timur Tabi <timur@kernel.org> wrote:

> -        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
> -                    "NVRM: %s: this is a test \
> -                    of multiline " NvP64_fmt " strings %p\n",
> -                    __FUNCTION__,
> -                    p1,
> -                    p2));
> +        NV_PRINTF(LEVEL_ERROR,
> +                  "this is a test of multiline " NvP64_fmt " strings %p\n",
> +                  p1, p2);
>
>
> -        NV_PRINTF(LEVEL_INFO, "%s\n", __FUNCTION__);
> +        NV_PRINTF(LEVEL_INFO, "\n");
>
> That second diff should not be there.
>
> Looking at the output of --debug, I see it go through all the rules
> and tell me what dependencies are satisfied, but it only does it once.
> I would expect Coccinelle to re-evaluate all the rules for every line
> of code it sees.  My script used to do that, so I broke it somehow.

The weird thing is that if I remove the DBG_PRINTF(()) line in test.c,
then the NV_PRINTF() line is *not* modified.  It's as if Coccinelle
doesn't reset the dependencies when it evaluates the NV_PRINTF() line.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-12 23:22         ` timur
@ 2018-10-13  3:08           ` julia.lawall
  0 siblings, 0 replies; 20+ messages in thread
From: julia.lawall @ 2018-10-13  3:08 UTC (permalink / raw)
  To: cocci



On Fri, 12 Oct 2018, Timur Tabi wrote:

> On Fri, Oct 12, 2018 at 6:08 PM Timur Tabi <timur@kernel.org> wrote:
>
> > -        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
> > -                    "NVRM: %s: this is a test \
> > -                    of multiline " NvP64_fmt " strings %p\n",
> > -                    __FUNCTION__,
> > -                    p1,
> > -                    p2));
> > +        NV_PRINTF(LEVEL_ERROR,
> > +                  "this is a test of multiline " NvP64_fmt " strings %p\n",
> > +                  p1, p2);
> >
> >
> > -        NV_PRINTF(LEVEL_INFO, "%s\n", __FUNCTION__);
> > +        NV_PRINTF(LEVEL_INFO, "\n");
> >
> > That second diff should not be there.
> >
> > Looking at the output of --debug, I see it go through all the rules
> > and tell me what dependencies are satisfied, but it only does it once.
> > I would expect Coccinelle to re-evaluate all the rules for every line
> > of code it sees.  My script used to do that, so I broke it somehow.
>
> The weird thing is that if I remove the DBG_PRINTF(()) line in test.c,
> then the NV_PRINTF() line is *not* modified.  It's as if Coccinelle
> doesn't reset the dependencies when it evaluates the NV_PRINTF() line.

Coccinelle applies the first rule to the whole file, then the second rule
to the whole file, etc.

To find the problem, I need the current state of your script.

julia

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
       [not found]     ` <e4e5dc37-c364-c53d-26f6-52205cfee304@users.sourceforge.net>
@ 2018-10-13 15:56       ` timur
  0 siblings, 0 replies; 20+ messages in thread
From: timur @ 2018-10-13 15:56 UTC (permalink / raw)
  To: cocci

On 10/13/18 7:44 AM, SF Markus Elfring wrote:
> I have also taken another look at your evolving SmPL script ?nv_printf.cocci?.
> I suggest to merge the first five SmPL rules into one rule by using
> a SmPL disjunction. Will you get nicer run time characteristics then?

I care more about simplicity and code maintenance than I do about 
runtime.  It already runs in a few seconds, how much faster do I need it 
to be?

I'd rather have help in fixing bugs than making it more efficient.

> How do you think about to continue development discussions around topics
> like ?nested SmPL disjunctions? (and ?Usage of regular expressions in
> SmPL constraints?)?

That's way over my head.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-12 21:28 [Cocci] Problem with improper multi-line string literals timur
  2018-10-12 21:37 ` julia.lawall
@ 2018-10-13 21:19 ` julia.lawall
  2018-10-15 16:37   ` timur
  1 sibling, 1 reply; 20+ messages in thread
From: julia.lawall @ 2018-10-13 21:19 UTC (permalink / raw)
  To: cocci



On Fri, 12 Oct 2018, Timur Tabi wrote:

> I've attached a test.c and nv_printf.cocci file that demonstrates the problem.
>
> It appears that Coccinelle sometimes cannot handle multi-line string
> literals that are syntactically correct but still improper.  For
> example:
>
>         DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
>                     "NVRM: %s: this is a test \
>                     of multiline " NvP64_fmt " strings %p\n",
>                     __FUNCTION__,
>                     p1,
>                     p2));
>
> This is valid C, but technically the string literal should have
> quotation marks at the beginning of each line.  When Coccinelle
> attempts to process my script with this, it gets confused and mangles
> the parameters after the string literal:
>
>  void func(void)
>  {
> -        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
> -                    "NVRM: %s: this is a test \
> -                    of multiline " NvP64_fmt " strings %p\n",
> -                    __FUNCTION__,
> -                    p1,
> -                    p2));
> -}
> +        NV_PRINTF(DBG_LEVEL_ERRORS, "NVRM: %s: this is a test \
> +                    of multiline " NvP64_fmt " strings %p\n", __FUNCTION__,
> +                    of multiline "p1, p2);
> +}"

This problem has been fixed.  Actually, it thought that "    of multiline " was the new amount to indent...

julia

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-13 21:19 ` julia.lawall
@ 2018-10-15 16:37   ` timur
  2018-10-15 16:39     ` julia.lawall
  2018-10-16 15:10     ` himanshujha199640
  0 siblings, 2 replies; 20+ messages in thread
From: timur @ 2018-10-15 16:37 UTC (permalink / raw)
  To: cocci

On Sat, Oct 13, 2018 at 4:19 PM Julia Lawall <julia.lawall@lip6.fr> wrote:
> This problem has been fixed.  Actually, it thought that "    of multiline " was the new amount to indent...

When I try to build this on Ubuntu 18, I get the following error:

OCAMLOPT  parsing_c/includes.ml
File "parsing_c/includes.ml", line 159, characters 9-22:
Error: Unbound module Parmap
Makefile:424: recipe for target 'parsing_c/includes.cmx' failed
make: *** [parsing_c/includes.cmx] Error 2
rm parsing_cocci/lexer_cli.ml parsing_cocci/parser_cocci_menhir.ml.d
parsing_cocci/parser_cocci_menhir.mli.d parsing_cocci/lexer_script.ml
parsing_cocci/lexer_cocci.ml

I installed all the packages listed in install.txt.

I tried "./configure --disable-pcre-syntax" and "./configure
--disable-ocaml", but neither helped.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-15 16:37   ` timur
@ 2018-10-15 16:39     ` julia.lawall
  2018-10-15 16:50       ` timur
  2018-10-16 15:10     ` himanshujha199640
  1 sibling, 1 reply; 20+ messages in thread
From: julia.lawall @ 2018-10-15 16:39 UTC (permalink / raw)
  To: cocci



On Mon, 15 Oct 2018, Timur Tabi wrote:

> On Sat, Oct 13, 2018 at 4:19 PM Julia Lawall <julia.lawall@lip6.fr> wrote:
> > This problem has been fixed.  Actually, it thought that "    of multiline " was the new amount to indent...
>
> When I try to build this on Ubuntu 18, I get the following error:
>
> OCAMLOPT  parsing_c/includes.ml
> File "parsing_c/includes.ml", line 159, characters 9-22:
> Error: Unbound module Parmap
> Makefile:424: recipe for target 'parsing_c/includes.cmx' failed
> make: *** [parsing_c/includes.cmx] Error 2
> rm parsing_cocci/lexer_cli.ml parsing_cocci/parser_cocci_menhir.ml.d
> parsing_cocci/parser_cocci_menhir.mli.d parsing_cocci/lexer_script.ml
> parsing_cocci/lexer_cocci.ml
>
> I installed all the packages listed in install.txt.
>
> I tried "./configure --disable-pcre-syntax" and "./configure
> --disable-ocaml", but neither helped.

Neither is relevant.  Try make distclean, ./autogen, ./configure

julia

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-15 16:39     ` julia.lawall
@ 2018-10-15 16:50       ` timur
  2018-10-15 16:55         ` julia.lawall
  0 siblings, 1 reply; 20+ messages in thread
From: timur @ 2018-10-15 16:50 UTC (permalink / raw)
  To: cocci

On Mon, Oct 15, 2018 at 11:40 AM Julia Lawall <julia.lawall@lip6.fr> wrote:

> Neither is relevant.  Try make distclean, ./autogen, ./configure

That didn't help.  I'm already working with a clean clone of the git repo.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-15 16:50       ` timur
@ 2018-10-15 16:55         ` julia.lawall
  2018-10-15 18:35           ` timur
  0 siblings, 1 reply; 20+ messages in thread
From: julia.lawall @ 2018-10-15 16:55 UTC (permalink / raw)
  To: cocci



On Mon, 15 Oct 2018, Timur Tabi wrote:

> On Mon, Oct 15, 2018 at 11:40 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
>
> > Neither is relevant.  Try make distclean, ./autogen, ./configure
>
> That didn't help.  I'm already working with a clean clone of the git repo.

Do you have parmap installed on your machine?  Try

ocamlfind query parmap

Then try which ocaml and see if they have the same prefix.  For example,
I have:

hadrien: ocamlfind query parmap
/home/jll/.opam/4.06.1/lib/parmap
hadrien: which ocaml
/home/jll/.opam/4.06.1/bin/ocaml

julia

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-15 16:55         ` julia.lawall
@ 2018-10-15 18:35           ` timur
  0 siblings, 0 replies; 20+ messages in thread
From: timur @ 2018-10-15 18:35 UTC (permalink / raw)
  To: cocci

On Mon, Oct 15, 2018 at 11:55 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
> Do you have parmap installed on your machine?  Try
>
> ocamlfind query parmap

$  ocamlfind query parmap
/usr/lib/ocaml/parmap

> Then try which ocaml and see if they have the same prefix.  For example,
> I have:
>
> hadrien: ocamlfind query parmap
> /home/jll/.opam/4.06.1/lib/parmap
> hadrien: which ocaml
> /home/jll/.opam/4.06.1/bin/ocaml

$ which ocaml
/usr/bin/ocaml
$ ocaml --version
The OCaml toplevel, version 4.05.0

I have a stock Ubuntu 18.04 installation.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-15 16:37   ` timur
  2018-10-15 16:39     ` julia.lawall
@ 2018-10-16 15:10     ` himanshujha199640
  2018-10-16 15:12       ` julia.lawall
  2018-10-16 16:28       ` timur
  1 sibling, 2 replies; 20+ messages in thread
From: himanshujha199640 @ 2018-10-16 15:10 UTC (permalink / raw)
  To: cocci

On Mon, Oct 15, 2018 at 11:37:00AM -0500, Timur Tabi wrote:
> On Sat, Oct 13, 2018 at 4:19 PM Julia Lawall <julia.lawall@lip6.fr> wrote:
> > This problem has been fixed.  Actually, it thought that "    of multiline " was the new amount to indent...
> 
> When I try to build this on Ubuntu 18, I get the following error:
> 
> OCAMLOPT  parsing_c/includes.ml
> File "parsing_c/includes.ml", line 159, characters 9-22:
> Error: Unbound module Parmap
> Makefile:424: recipe for target 'parsing_c/includes.cmx' failed
> make: *** [parsing_c/includes.cmx] Error 2
> rm parsing_cocci/lexer_cli.ml parsing_cocci/parser_cocci_menhir.ml.d
> parsing_cocci/parser_cocci_menhir.mli.d parsing_cocci/lexer_script.ml
> parsing_cocci/lexer_cocci.ml
> 
> I installed all the packages listed in install.txt.
> 
> I tried "./configure --disable-pcre-syntax" and "./configure
> --disable-ocaml", but neither helped.

FYI coccinelle works fine on Ubuntu 18.04.1 when built through
source code.

There might be problem for the specific config you're targeting.
But I'm curious as to how disabling pcre-syntax helps ?

I do understand the purpose of disabling ocaml scripting.

himanshu at himanshu-Vostro-3559:~$ spatch --version
spatch version 1.0.7-00498-g41ec93a2 compiled with OCaml version 4.05.0
Flags passed to the configure script: --with-bash-completion=/etc/bash_completion.d/
OCaml scripting support: yes
Python scripting support: yes
Syntax of regular expresssions: PCRE


Thanks
-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-16 15:10     ` himanshujha199640
@ 2018-10-16 15:12       ` julia.lawall
  2018-10-16 16:28       ` timur
  1 sibling, 0 replies; 20+ messages in thread
From: julia.lawall @ 2018-10-16 15:12 UTC (permalink / raw)
  To: cocci



On Tue, 16 Oct 2018, Himanshu Jha wrote:

> On Mon, Oct 15, 2018 at 11:37:00AM -0500, Timur Tabi wrote:
> > On Sat, Oct 13, 2018 at 4:19 PM Julia Lawall <julia.lawall@lip6.fr> wrote:
> > > This problem has been fixed.  Actually, it thought that "    of multiline " was the new amount to indent...
> >
> > When I try to build this on Ubuntu 18, I get the following error:
> >
> > OCAMLOPT  parsing_c/includes.ml
> > File "parsing_c/includes.ml", line 159, characters 9-22:
> > Error: Unbound module Parmap
> > Makefile:424: recipe for target 'parsing_c/includes.cmx' failed
> > make: *** [parsing_c/includes.cmx] Error 2
> > rm parsing_cocci/lexer_cli.ml parsing_cocci/parser_cocci_menhir.ml.d
> > parsing_cocci/parser_cocci_menhir.mli.d parsing_cocci/lexer_script.ml
> > parsing_cocci/lexer_cocci.ml
> >
> > I installed all the packages listed in install.txt.
> >
> > I tried "./configure --disable-pcre-syntax" and "./configure
> > --disable-ocaml", but neither helped.
>
> FYI coccinelle works fine on Ubuntu 18.04.1 when built through
> source code.
>
> There might be problem for the specific config you're targeting.
> But I'm curious as to how disabling pcre-syntax helps ?
>
> I do understand the purpose of disabling ocaml scripting.

No, disabling OCaml scripting doesn't help either. Parmap is for
parallelism, whether one has OCaml scripting or not.

julia

>
> himanshu at himanshu-Vostro-3559:~$ spatch --version
> spatch version 1.0.7-00498-g41ec93a2 compiled with OCaml version 4.05.0
> Flags passed to the configure script: --with-bash-completion=/etc/bash_completion.d/
> OCaml scripting support: yes
> Python scripting support: yes
> Syntax of regular expresssions: PCRE
>
>
> Thanks
> --
> Himanshu Jha
> Undergraduate Student
> Department of Electronics & Communication
> Guru Tegh Bahadur Institute of Technology
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-16 15:10     ` himanshujha199640
  2018-10-16 15:12       ` julia.lawall
@ 2018-10-16 16:28       ` timur
  2018-10-16 16:39         ` julia.lawall
  2018-10-16 17:10         ` himanshujha199640
  1 sibling, 2 replies; 20+ messages in thread
From: timur @ 2018-10-16 16:28 UTC (permalink / raw)
  To: cocci

On 10/16/18 10:10 AM, Himanshu Jha wrote:
> FYI coccinelle works fine on Ubuntu 18.04.1 when built through
> source code.

I've attached my config.log, can you compare it with yours and post the diff?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.log
Type: text/x-log
Size: 24272 bytes
Desc: not available
URL: <https://systeme.lip6.fr/pipermail/cocci/attachments/20181016/657b6d9b/attachment-0001.bin>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-16 16:28       ` timur
@ 2018-10-16 16:39         ` julia.lawall
  2018-10-16 17:14           ` timur
  2018-10-16 17:10         ` himanshujha199640
  1 sibling, 1 reply; 20+ messages in thread
From: julia.lawall @ 2018-10-16 16:39 UTC (permalink / raw)
  To: cocci



On Tue, 16 Oct 2018, Timur Tabi wrote:

> On 10/16/18 10:10 AM, Himanshu Jha wrote:
> > FYI coccinelle works fine on Ubuntu 18.04.1 when built through
> > source code.
>
> I've attached my config.log, can you compare it with yours and post the diff?

I didn't find anything significant.  Maybe you can try disabling parmap,
like you disabled pcre.  There seems to be a config option for that.

julia

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-16 16:28       ` timur
  2018-10-16 16:39         ` julia.lawall
@ 2018-10-16 17:10         ` himanshujha199640
  1 sibling, 0 replies; 20+ messages in thread
From: himanshujha199640 @ 2018-10-16 17:10 UTC (permalink / raw)
  To: cocci

On Tue, Oct 16, 2018 at 11:28:31AM -0500, Timur Tabi wrote:
> On 10/16/18 10:10 AM, Himanshu Jha wrote:
> > FYI coccinelle works fine on Ubuntu 18.04.1 when built through
> > source code.
> 
> I've attached my config.log, can you compare it with yours and post the diff?


himanshu at himanshu-Vostro-3559:~/coccinelle$ diff timur-config.log config.log 
4c4
< It was created by coccinelle configure 1.0.7-00033-g21afa515-dirty, which was
---
> It was created by coccinelle configure 1.0.7-00498-g41ec93a2, which was
13c13
< hostname = ttabi
---
> hostname = himanshu-Vostro-3559
15c15
< uname -r = 4.15.0-34-generic
---
> uname -r = 4.15.0-36-generic
17c17
< uname -v = #37-Ubuntu SMP Mon Aug 27 15:21:48 UTC 2018
---
> uname -v = #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018
30c30,31
< PATH: /home/ttabi/bin
---
> PATH: /home/himanshu/Downloads/nRF5x-Command-Line-Tools_9_7_3_Linux-x86_64/nrfjprogs
> PATH: /home/himanshu/.local/bin
38a40
> PATH: /home/himanshu/Downloads/nRF5x-Command-Line-Tools_9_7_3_Linux-x86_64
40,44d41
< PATH: /home/ttabi/bin
< PATH: /home/ttabi/sw/misc/linux
< PATH: /home/ttabi/sw/automation/dvs/dvsbuild/
< PATH: /home/ttabi/sw/main/apps/p4review
< PATH: /home/ttabi/ttabi_p4hw-1/hw/nv/utils/as2/beta_0.4/bin
51c48
< configure:2191: configuring coccinelle 1.0.7-00033-g21afa515-dirty in /home/ttabi/coccinelle
---
> configure:2191: configuring coccinelle 1.0.7-00498-g41ec93a2 in /home/himanshu/coccinelle
59,60c56,59
< configure:2556: found /usr/bin/gawk
< configure:2567: result: gawk
---
> configure:2570: result: no
> configure:2540: checking for mawk
> configure:2556: found /usr/bin/mawk
> configure:2567: result: mawk
70c69
< configure:2996: version suffix set to Sun, 14 Oct 2018 21:55:15 +0200
---
> configure:2996: version suffix set to Thu, 9 Aug 2018 21:43:25 +0200
163,164c162,163
< | #define PACKAGE_VERSION "1.0.7-00033-g21afa515-dirty"
< | #define PACKAGE_STRING "coccinelle 1.0.7-00033-g21afa515-dirty"
---
> | #define PACKAGE_VERSION "1.0.7-00498-g41ec93a2"
> | #define PACKAGE_STRING "coccinelle 1.0.7-00498-g41ec93a2"
168c167
< | #define VERSION "1.0.7-00033-g21afa515-dirty"
---
> | #define VERSION "1.0.7-00498-g41ec93a2"
184,185c183,184
< | #define PACKAGE_VERSION "1.0.7-00033-g21afa515-dirty"
< | #define PACKAGE_STRING "coccinelle 1.0.7-00033-g21afa515-dirty"
---
> | #define PACKAGE_VERSION "1.0.7-00498-g41ec93a2"
> | #define PACKAGE_STRING "coccinelle 1.0.7-00498-g41ec93a2"
189c188
< | #define VERSION "1.0.7-00033-g21afa515-dirty"
---
> | #define VERSION "1.0.7-00498-g41ec93a2"
259c258
< configure:11145: coccinelle may use external ocaml libraries in /home/ttabi/coccinelle/bundles
---
> configure:11145: coccinelle may use external ocaml libraries in /home/himanshu/coccinelle/bundles
285c284
< configure:12926: using bundled substitute for pyml in /home/ttabi/coccinelle/bundles/pyml
---
> configure:12926: using bundled substitute for pyml in /home/himanshu/coccinelle/bundles/pyml
317c316
< This file was extended by coccinelle config.status 1.0.7-00033-g21afa515-dirty, which was
---
> This file was extended by coccinelle config.status 1.0.7-00498-g41ec93a2, which was
326c325
< on ttabi
---
> on himanshu-Vostro-3559
428c427
< ac_cv_prog_AWK=gawk
---
> ac_cv_prog_AWK=mawk
446c445
< ACLOCAL='${SHELL} /home/ttabi/coccinelle/setup/missing aclocal-1.15'
---
> ACLOCAL='${SHELL} /home/himanshu/coccinelle/setup/missing aclocal-1.15'
455,458c454,457
< AUTOCONF='${SHELL} /home/ttabi/coccinelle/setup/missing autoconf'
< AUTOHEADER='${SHELL} /home/ttabi/coccinelle/setup/missing autoheader'
< AUTOMAKE='${SHELL} /home/ttabi/coccinelle/setup/missing automake-1.15'
< AWK='gawk'
---
> AUTOCONF='${SHELL} /home/himanshu/coccinelle/setup/missing autoconf'
> AUTOHEADER='${SHELL} /home/himanshu/coccinelle/setup/missing autoheader'
> AUTOMAKE='${SHELL} /home/himanshu/coccinelle/setup/missing automake-1.15'
> AWK='mawk'
466,468c465,467
< COCCI_OCAML_EXTERNAL='/home/ttabi/coccinelle/bundles'
< COCCI_SRCDIR='/home/ttabi/coccinelle'
< COCCI_VERSION='1.0.7-00033-g21afa515-dirty'
---
> COCCI_OCAML_EXTERNAL='/home/himanshu/coccinelle/bundles'
> COCCI_SRCDIR='/home/himanshu/coccinelle'
> COCCI_VERSION='1.0.7-00498-g41ec93a2'
470c469
< CONFVERSION='Sun, 14 Oct 2018 21:55:15 +0200'
---
> CONFVERSION='Thu, 9 Aug 2018 21:43:25 +0200'
475c474
< DEFS='-DPACKAGE_NAME=\"coccinelle\" -DPACKAGE_TARNAME=\"coccinelle\" -DPACKAGE_VERSION=\"1.0.7-00033-g21afa515-dirty\" -DPACKAGE_STRING=\"coccinelle\ 1.0.7-00033-g21afa515-dirty\" -DPACKAGE_BUGREPORT=\"cocci@systeme.lip6.fr\" -DPACKAGE_URL=\"http://coccinelle.lip6.fr/\" -DPACKAGE=\"coccinelle\" -DVERSION=\"1.0.7-00033-g21afa515-dirty\"'
---
> DEFS='-DPACKAGE_NAME=\"coccinelle\" -DPACKAGE_TARNAME=\"coccinelle\" -DPACKAGE_VERSION=\"1.0.7-00498-g41ec93a2\" -DPACKAGE_STRING=\"coccinelle\ 1.0.7-00498-g41ec93a2\" -DPACKAGE_BUGREPORT=\"cocci at systeme.lip6.fr\" -DPACKAGE_URL=\"http://coccinelle.lip6.fr/\" -DPACKAGE=\"coccinelle\" -DVERSION=\"1.0.7-00498-g41ec93a2\"'
520c519
< MAKEINFO='${SHELL} /home/ttabi/coccinelle/setup/missing makeinfo'
---
> MAKEINFO='${SHELL} /home/himanshu/coccinelle/setup/missing makeinfo'
527c526
< MAKE_pyml='/home/ttabi/coccinelle/bundles/pyml'
---
> MAKE_pyml='/home/himanshu/coccinelle/bundles/pyml'
583c582
< PACKAGE_STRING='coccinelle 1.0.7-00033-g21afa515-dirty'
---
> PACKAGE_STRING='coccinelle 1.0.7-00498-g41ec93a2'
586c585
< PACKAGE_VERSION='1.0.7-00033-g21afa515-dirty'
---
> PACKAGE_VERSION='1.0.7-00498-g41ec93a2'
594,595c593,594
< PATH_menhirLib_bundle='/home/ttabi/coccinelle/bundles/menhirLib'
< PATH_menhir_bundle='/home/ttabi/coccinelle/bundles/menhirLib/menhir'
---
> PATH_menhirLib_bundle='/home/himanshu/coccinelle/bundles/menhirLib'
> PATH_menhir_bundle='/home/himanshu/coccinelle/bundles/menhirLib/menhir'
598c597
< PATH_pyml='/home/ttabi/coccinelle/bundles/pyml'
---
> PATH_pyml='/home/himanshu/coccinelle/bundles/pyml'
604c603
< PKG_CONFIG='/home/ttabi/coccinelle/setup/fake-subst.sh /usr/bin/pkg-config'
---
> PKG_CONFIG='/home/himanshu/coccinelle/setup/fake-subst.sh /usr/bin/pkg-config'
630c629
< VERSION='1.0.7-00033-g21afa515-dirty'
---
> VERSION='1.0.7-00498-g41ec93a2'
663c662
< install_sh='${SHELL} /home/ttabi/coccinelle/setup/install-sh'
---
> install_sh='${SHELL} /home/himanshu/coccinelle/setup/install-sh'
696,697c695,696
< #define PACKAGE_VERSION "1.0.7-00033-g21afa515-dirty"
< #define PACKAGE_STRING "coccinelle 1.0.7-00033-g21afa515-dirty"
---
> #define PACKAGE_VERSION "1.0.7-00498-g41ec93a2"
> #define PACKAGE_STRING "coccinelle 1.0.7-00498-g41ec93a2"
701c700
< #define VERSION "1.0.7-00033-g21afa515-dirty"
---
> #define VERSION "1.0.7-00498-g41ec93a2"


-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Cocci] Problem with improper multi-line string literals
  2018-10-16 16:39         ` julia.lawall
@ 2018-10-16 17:14           ` timur
  0 siblings, 0 replies; 20+ messages in thread
From: timur @ 2018-10-16 17:14 UTC (permalink / raw)
  To: cocci

On 10/16/18 11:39 AM, Julia Lawall wrote:
> I didn't find anything significant.  Maybe you can try disabling parmap,
> like you disabled pcre.  There seems to be a config option for that.

"./configure --disable-parmap" fixed the problem for me.  Thanks.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, back to index

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-12 21:28 [Cocci] Problem with improper multi-line string literals timur
2018-10-12 21:37 ` julia.lawall
2018-10-12 21:42   ` timur
2018-10-12 22:24     ` timur
2018-10-12 23:08       ` timur
2018-10-12 23:22         ` timur
2018-10-13  3:08           ` julia.lawall
     [not found]     ` <e4e5dc37-c364-c53d-26f6-52205cfee304@users.sourceforge.net>
2018-10-13 15:56       ` timur
2018-10-13 21:19 ` julia.lawall
2018-10-15 16:37   ` timur
2018-10-15 16:39     ` julia.lawall
2018-10-15 16:50       ` timur
2018-10-15 16:55         ` julia.lawall
2018-10-15 18:35           ` timur
2018-10-16 15:10     ` himanshujha199640
2018-10-16 15:12       ` julia.lawall
2018-10-16 16:28       ` timur
2018-10-16 16:39         ` julia.lawall
2018-10-16 17:14           ` timur
2018-10-16 17:10         ` himanshujha199640

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox