[Cocci] Source code analysis with big regular expressions?

Julia Lawall julia.lawall at lip6.fr
Tue Feb 25 22:02:02 CET 2014


On Tue, 25 Feb 2014, SF Markus Elfring wrote:

> > Set the OCAMLRUNPARAM environment variable to b in your shell.  I don't 
> > know if it is necessary to recompile coccinelle.  Then when it crashes you 
> > will get a backtrace.
> 
> elfring at Sonne:~/Projekte/Coccinelle/janitor> export OCAMLRUNPARAM=b && spatch
> --sp-file delete_unnecessary_checks2.cocci
> /usr/src/linux-stable/fs/btrfs/inode.cinit_defs_builtins:
> /usr/local/share/coccinelle/standard.h
> Fatal error: exception Pcre.Error(_)
> Called from file "engine.ml", line 206, characters 1-27
> Called from file "engine.ml", line 359, characters 23-36
> 
> 
> How much can this information help us here?

Those two lines at least are not from Coccinelle, so I guess that they are 
from the PCRE implementation.  But I don't think there is anything to do.  
The regular expression engine is just not likely to be designed to support 
such a large regular expression.

If you like you can give each of the function names one by one as a 
command line argument.  Eg

spatch file.cocci file.c -D fn=whatever

and then in your semantic patch

@@
identifier virtual.fn;
@@

... use fn as an identifier ...

julia


More information about the Cocci mailing list