Coccinelle archive on lore.kernel.org
 help / Atom feed
* [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed
@ 2018-12-07 17:17 Timur Tabi
  2018-12-07 17:42 ` Julia Lawall
  0 siblings, 1 reply; 7+ messages in thread
From: Timur Tabi @ 2018-12-07 17:17 UTC (permalink / raw)
  To: cocci

spatch version 1.0.7-00117-g163d2058 compiled with OCaml version 4.05.0
Flags passed to the configure script: --disable-parmap
OCaml scripting support: yes
Python scripting support: yes
Syntax of regular expresssions: PCRE

Unfortunately, I can't share the C source file, and the --debug option
to spatch doesn't display anything.  This is a self-built spatch (with
parmap disabled), and line 361's assertion is:

  F.KeyMap.iter (fun nodei node ->
    assert (F.KeyEdgeSet.cardinal (!g#successors nodei) >= 1);
    ) !g#nodes;

I can't understand this code, so I can't debug it myself.
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed
  2018-12-07 17:17 [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed Timur Tabi
@ 2018-12-07 17:42 ` Julia Lawall
  2018-12-07 17:51   ` Timur Tabi
  0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2018-12-07 17:42 UTC (permalink / raw)
  To: Timur Tabi; +Cc: cocci



On Fri, 7 Dec 2018, Timur Tabi wrote:

> spatch version 1.0.7-00117-g163d2058 compiled with OCaml version 4.05.0
> Flags passed to the configure script: --disable-parmap
> OCaml scripting support: yes
> Python scripting support: yes
> Syntax of regular expresssions: PCRE
>
> Unfortunately, I can't share the C source file, and the --debug option
> to spatch doesn't display anything.  This is a self-built spatch (with
> parmap disabled), and line 361's assertion is:
>
>   F.KeyMap.iter (fun nodei node ->
>     assert (F.KeyEdgeSet.cardinal (!g#successors nodei) >= 1);
>     ) !g#nodes;
>
> I can't understand this code, so I can't debug it myself.

Do you know which function in your C code causes the problem?  Does that
function have some dead code?  You can try

spatch --control-flow file.c

and see if there is anything suspicious.  You may need to reduce the
number of functions in the file or the number of lines of code in the
functions.

julia


_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed
  2018-12-07 17:42 ` Julia Lawall
@ 2018-12-07 17:51   ` Timur Tabi
  2018-12-07 17:55     ` Julia Lawall
  2018-12-07 17:56     ` Julia Lawall
  0 siblings, 2 replies; 7+ messages in thread
From: Timur Tabi @ 2018-12-07 17:51 UTC (permalink / raw)
  To: Julia Lawall; +Cc: cocci, Timur Tabi

On Fri, Dec 7, 2018 at 11:42 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
> Do you know which function in your C code causes the problem?  Does that
> function have some dead code?  You can try
>
> spatch --control-flow file.c

That revealed the line number of the problem.  It's a goto tag in a macro:

#define xxx(type, member) \
...
member##_done:                                                               \
...

I can work around this by temporarily commenting-out that line, since
my script doesn't care about its contents.
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed
  2018-12-07 17:51   ` Timur Tabi
@ 2018-12-07 17:55     ` Julia Lawall
  2018-12-07 17:56     ` Julia Lawall
  1 sibling, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2018-12-07 17:55 UTC (permalink / raw)
  To: Timur Tabi; +Cc: cocci



On Fri, 7 Dec 2018, Timur Tabi wrote:

> On Fri, Dec 7, 2018 at 11:42 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
> > Do you know which function in your C code causes the problem?  Does that
> > function have some dead code?  You can try
> >
> > spatch --control-flow file.c
>
> That revealed the line number of the problem.  It's a goto tag in a macro:
>
> #define xxx(type, member) \
> ...
> member##_done:                                                               \
> ...
>
> I can work around this by temporarily commenting-out that line, since
> my script doesn't care about its contents.

Great to have identified the source of the problem.  It would probably be
better for Coccinelle to skip the relevant top-level element rather than
crashing in this case.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed
  2018-12-07 17:51   ` Timur Tabi
  2018-12-07 17:55     ` Julia Lawall
@ 2018-12-07 17:56     ` Julia Lawall
  2018-12-07 18:17       ` Timur Tabi
  1 sibling, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2018-12-07 17:56 UTC (permalink / raw)
  To: Timur Tabi; +Cc: cocci



On Fri, 7 Dec 2018, Timur Tabi wrote:

> On Fri, Dec 7, 2018 at 11:42 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
> > Do you know which function in your C code causes the problem?  Does that
> > function have some dead code?  You can try
> >
> > spatch --control-flow file.c
>
> That revealed the line number of the problem.  It's a goto tag in a macro:
>
> #define xxx(type, member) \
> ...
> member##_done:                                                               \
> ...
>
> I can work around this by temporarily commenting-out that line, since
> my script doesn't care about its contents.

I guess you run Coccinelle on a complete directory?  If so, does the
assert cause everything to crash, or only the treatment of the given file?

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed
  2018-12-07 17:56     ` Julia Lawall
@ 2018-12-07 18:17       ` Timur Tabi
  2018-12-07 18:20         ` Julia Lawall
  0 siblings, 1 reply; 7+ messages in thread
From: Timur Tabi @ 2018-12-07 18:17 UTC (permalink / raw)
  To: Julia Lawall; +Cc: cocci

On Fri, Dec 7, 2018 at 11:56 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
> I guess you run Coccinelle on a complete directory?  If so, does the
> assert cause everything to crash, or only the treatment of the given file?

Only that file crashes.  I changed that line to remove the ##, but it
didn't fix anything.  So I just commented out the entire macro and now
spatch works on that file.

Considering the unique nature of this code, I'm not sure that there's
anything to fix.  It would be nice if the normal error reporting was
more accurate, since I typically need to use --debug or not
--control-flow just to find the offending line in my C files.
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

* Re: [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed
  2018-12-07 18:17       ` Timur Tabi
@ 2018-12-07 18:20         ` Julia Lawall
  0 siblings, 0 replies; 7+ messages in thread
From: Julia Lawall @ 2018-12-07 18:20 UTC (permalink / raw)
  To: Timur Tabi; +Cc: cocci



On Fri, 7 Dec 2018, Timur Tabi wrote:

> On Fri, Dec 7, 2018 at 11:56 AM Julia Lawall <julia.lawall@lip6.fr> wrote:
> > I guess you run Coccinelle on a complete directory?  If so, does the
> > assert cause everything to crash, or only the treatment of the given file?
>
> Only that file crashes.  I changed that line to remove the ##, but it
> didn't fix anything.  So I just commented out the entire macro and now
> spatch works on that file.
>
> Considering the unique nature of this code, I'm not sure that there's
> anything to fix.  It would be nice if the normal error reporting was
> more accurate, since I typically need to use --debug or not
> --control-flow just to find the offending line in my C files.

For parse errors you can use --verbose-parsing.  Coccinelle doesn't print
these messages by default, because often there are many top-level things
like macro definitions that cause parsing problems, but that are not
relevant to the problem you are interested in.

On the other hand, this isn't a parsing problem, but rather a problem in
the control-flow graph construction.

julia
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-07 17:17 [Cocci] Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed Timur Tabi
2018-12-07 17:42 ` Julia Lawall
2018-12-07 17:51   ` Timur Tabi
2018-12-07 17:55     ` Julia Lawall
2018-12-07 17:56     ` Julia Lawall
2018-12-07 18:17       ` Timur Tabi
2018-12-07 18:20         ` Julia Lawall

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