Hi,

I have just installed the latest spatch release hoping this might be a
bug in my older version, 0.2.3, but I'm now using 0.2.5-rc6, and I have
the same problem.

The idea was to expand on the "drop unnecessary continue" SmPL
(http://coccinelle.lip6.fr/impact/continue.html)

This works fine on the simple test code (test.c) but when it's applied
onto a larger code base, it hangs. I've attached the debug output from
test.c (good.txt) and the debug output from a file in my code base.
(bad.txt) I have to killed the bad spatch after about 30 seconds.

Unfortunately spatch doesn't output any line numbers while it's
processing so it's hard to track down where it's getting stuck. I have
seen spatch getting stuck on many different SmPL patches, but only on
some files. Other large C files work perfectly fine.

Could someone explain what is going wrong here, or even what might be
going wrong?

Thank you.
--
Oliver McFadden. 
int main(void)
{
	int i, j;

	for (i = 0; i < 1; i++) {
		if (j) {
			j++;
			continue;
		}
		continue;
	}
}
// Copyright: (C) 2009 Gilles Muller, Julia Lawall, INRIA, DIKU.  GPLv2.

@@
@@

for (...;...;...) {
    ...
    if (...) {
        ...
-       continue;
    }
}

@@
@@

for (...;...;...) {
    ...
-   continue;
}
init_defs_builtins: /usr/share/coccinelle/standard.h
-----------------------------------------------------------------------
processing semantic patch file: ../contrib/cocci/continue.cocci
with isos from: /usr/share/coccinelle/standard.iso
-----------------------------------------------------------------------
// Copyright: (C) 2009 Gilles Muller, Julia Lawall, INRIA, DIKU.  GPLv2.

@@
@@

for (...;...;...) {
    ...
    if (...) {
        ...
-       continue;
    }
}

@@
@@

for (...;...;...) {
    ...
-   continue;
}

warning: iso braces1 does not match the code below on line 8
{
  ...
  continue;
}
braces must be all minus (plus code allowed) or all
context (plus code not allowed in the body) to match:
{
  ...
  continue;
}
warning: iso braces1 does not match the code below on line 17
{
  ...
  continue;
}
braces must be all minus (plus code allowed) or all
context (plus code not allowed in the body) to match:
{
  ...
  continue;
}
HANDLING: test.c
-----------------------------------------------------------------------
let's go
-----------------------------------------------------------------------
-----------------------------------------------------------------------
rule starting on line 3 = 
-----------------------------------------------------------------------
dependencies for rule rule starting on line 3 satisfied:
binding in = []
binding relevant in = []
-----------------------------------------------------------------------
rule starting on line 14 = 
-----------------------------------------------------------------------
dependencies for rule rule starting on line 14 satisfied:
binding in = []
binding relevant in = []
     transformation info returned:
          transform state: 19
               with rule_elem: -continue-;
               with binding: []
          transform state: 22
               with rule_elem: -continue-;
               with binding: []
     binding out = []
     transform one node
     transform one node
-----------------------------------------------------------------------
Finished
-----------------------------------------------------------------------
diff = 
--- test.c      2011-02-20 08:19:59.000000000 +0200
+++ /tmp/cocci-output-9748-a40a45-test.c        2011-02-20 08:23:09.000000000 
+0200
@@ -5,8 +5,6 @@ int main(void)
        for (i = 0; i < 1; i++) {
                if (j) {
                        j++;
-                       continue;
                }
-               continue;
        }
 }
Check duplication for 1 files
init_defs_builtins: /usr/share/coccinelle/standard.h
-----------------------------------------------------------------------
processing semantic patch file: ../contrib/cocci/continue.cocci
with isos from: /usr/share/coccinelle/standard.iso
-----------------------------------------------------------------------
// Copyright: (C) 2009 Gilles Muller, Julia Lawall, INRIA, DIKU.  GPLv2.

@@
@@

for (...;...;...) {
    ...
    if (...) {
        ...
-       continue;
    }
}

@@
@@

for (...;...;...) {
    ...
-   continue;
}

warning: iso braces1 does not match the code below on line 8
{
  ...
  continue;
}
braces must be all minus (plus code allowed) or all
context (plus code not allowed in the body) to match:
{
  ...
  continue;
}
warning: iso braces1 does not match the code below on line 17
{
  ...
  continue;
}
braces must be all minus (plus code allowed) or all
context (plus code not allowed in the body) to match:
{
  ...
  continue;
}
HANDLING: compiler/bsp/brushbsp.c
-----------------------------------------------------------------------
let's go
-----------------------------------------------------------------------
-----------------------------------------------------------------------
rule starting on line 3 = 
-----------------------------------------------------------------------
dependencies for rule rule starting on line 3 satisfied:
binding in = []
binding relevant in = []
-----------------------------------------------------------------------
rule starting on line 14 = 
-----------------------------------------------------------------------
dependencies for rule rule starting on line 14 satisfied:
binding in = []
binding relevant in = []
     C-c intercepted, will do some cleaning before exiting
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to