Skip to contentSkip to conversation

Regression since recent parentypes patches were merged

Cocci Christoph Böhmwalder 3 participants 4 messages May 12, 2020 – May 13, 2020

lore
Share & tools
lore
#0 lore raw

Hi Jaskaran,
Hi all,

I have noticed a regression in spatch since the recent SmPL improvements were merged. Here is a small reproducer:

@@
struct socket *sock;
struct sockaddr *uaddr;
int peer;
@@
{
+int ___addr_len;
...
- sock->ops->getname(sock, uaddr, peer);
+ sock->ops->getname(sock, uaddr, &___addr_len, peer);
...
}

This used to parse just fine, however now it errors out:

$ spatch --parse-cocci compat.cocci
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
minus: parse error:
  File "compat.cocci", line 9, column 13, charpos = 98
  around = 'getname',
  whole content = - sock->ops->getname(sock, uaddr, peer);

I have bisected the problem and it appears that the first bad commit is:

commit c280375635f62dfbe052709e4e47a82140d32ce5

Author: Jaskaran Singh <[email protected]>
Date:   Fri Mar 20 12:31:32 2020 +0530

Add parentypes to SmPL

This allows the SmPL and C ASTs to better match up, which enables more transformations. The patch is very large, so I have left the different messages as they were proposed in the original patch series.

Which is unfortunately huge, and since it was squashed together I really can't be any more specific.

Anyways, is this a bug? Or was I doing something wrong in the first place?

Thanks and best regards,
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#1 lore raw
Quoted 39 lines · Christoph Böhmwalder

Hi Jaskaran,
Hi all,

I have noticed a regression in spatch since the recent SmPL improvements were merged. Here is a small reproducer:

@@
struct socket *sock;
struct sockaddr *uaddr;
int peer;
@@
{
+int ___addr_len;
...
- sock->ops->getname(sock, uaddr, peer);
+ sock->ops->getname(sock, uaddr, &___addr_len, peer);
...
}

This used to parse just fine, however now it errors out:

$ spatch --parse-cocci compat.cocci
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
minus: parse error:
   File "compat.cocci", line 9, column 13, charpos = 98
   around = 'getname',
   whole content = - sock->ops->getname(sock, uaddr, peer);

I have bisected the problem and it appears that the first bad commit is:

commit c280375635f62dfbe052709e4e47a82140d32ce5

Author: Jaskaran Singh <[email protected]>
Date:   Fri Mar 20 12:31:32 2020 +0530

Add parentypes to SmPL

Quoted 7 lines

This allows the SmPL and C ASTs to better match up, which enables more transformations. The patch is very large, so I have left the different messages as they were proposed in the original patch series.

Which is unfortunately huge, and since it was squashed together I really can't be any more specific.

It's huge because any change to the AST affects everything...

Quoted 2 lines

Anyways, is this a bug? Or was I doing something wrong in the first place?

It's surely a bug. Thanks for the report.

julia

Quoted 10 lines

Thanks and best regards,
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

#2 lore raw
In reply to Christoph Böhmwalder
Quoted 47 lines · Christoph Böhmwalder

Hi Jaskaran,
Hi all,

I have noticed a regression in spatch since the recent SmPL improvements
were merged. Here is a small reproducer:

@@
struct socket *sock;
struct sockaddr *uaddr;
int peer;
@@
{
+int ___addr_len;
...
- sock->ops->getname(sock, uaddr, peer);
+ sock->ops->getname(sock, uaddr, &___addr_len, peer);
...
}

This used to parse just fine, however now it errors out:

$ spatch --parse-cocci compat.cocci
init_defs_builtins: /usr/local/bin/../lib/coccinelle/standard.h
minus: parse error:
   File "compat.cocci", line 9, column 13, charpos = 98
   around = 'getname',
   whole content = - sock->ops->getname(sock, uaddr, peer);

I have bisected the problem and it appears that the first bad commit is:

commit c280375635f62dfbe052709e4e47a82140d32ce5

Author: Jaskaran Singh <[email protected]>
Date:   Fri Mar 20 12:31:32 2020 +0530

Add parentypes to SmPL

This allows the SmPL and C ASTs to better match up, which
enables
more transformations. The patch is very large, so I have left the different messages as they were proposed in the original patch series.

Quoted 7 lines

Which is unfortunately huge, and since it was squashed together I really
can't be any more specific.

Anyways, is this a bug? Or was I doing something wrong in the first place?

Hi Christoph,

I've sent a patch for this, it should be merged after review. Sorry for the inconvenience!

Cheers,
Jaskaran.

Quoted 5 lines

Thanks and best regards,
--
Christoph Böhmwalder
LINBIT | Keeping the Digital World Running DRBD HA — Disaster Recovery — Software defined Storage

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci