Skip to contentSkip to conversation

Checking two error messages

Cocci Markus Elfring 2 participants 5 messages Mar 8, 2020 – Mar 11, 2020

lore
Share & tools
lore
#0 lore raw

Hello,

I have tried the following small script variant out again for the semantic patch language.

@display@
expression action;
expression* pointer, target, x;
identifier member, var;
statement is;
type t;
@@
(
*t* var = pointer->member;
|
*pointer->member;
|
*target = pointer->member;
|
*t* var = pointer->member(...);
|
*pointer->member(...);
|
*target = pointer->member(...);
)
... when any

     when != pointer = \( action(...) \| x \)

*if (
( !pointer
| pointer == NULL
)

    )

is

The software “Coccinelle 1.0.8-00029-ga549b9f0” (OCaml 4.10.0) reports the following error messages for an analysis approach on source files from “Linux next-20200306”.

elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_pointer_access_before_null_check3.cocci drivers/firmware/efi/runtime-wrappers.c …
Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_pointer_access_before_null_check3.cocci net/core/dev.c …
no position information

Is such information worth for further clarification?

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

#1 lore raw
Quoted 26 lines · Markus Elfring

Hello,

I have tried the following small script variant out again for the semantic patch language.

@display@
expression action;
expression* pointer, target, x;
identifier member, var;
statement is;
type t;
@@
(
*t* var = pointer->member;
|
*pointer->member;
|
*target = pointer->member;
|
*t* var = pointer->member(...);
|
*pointer->member(...);
|
*target = pointer->member(...);
)
... when any

Quoted 5 lines
     when != pointer = \( action(...) \| x \)

*if (
( !pointer
| pointer == NULL
)

pointer == NULL would have been sufficient (not related to the noted problems).

Quoted 8 lines
    )

is

The software “Coccinelle 1.0.8-00029-ga549b9f0” (OCaml 4.10.0) reports the following error messages for an analysis approach on source files from “Linux next-20200306”.

Quoted 6 lines

elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_pointer_access_before_null_check3.cocci drivers/firmware/efi/runtime-wrappers.c …
Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_pointer_access_before_null_check3.cocci net/core/dev.c …
no position information

Thanks for the reports. These are related to dead code and will be addressed sooner (second case) or later (first case).

julia

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

#2 lore raw

Re: [Cocci] Clarification for application of null pointer checks with SmPL

Quoted 8 lines
Quoted 6 lines

... when any

     when != pointer = \( action(...) \| x \)

*if (
( !pointer
| pointer == NULL
)

pointer == NULL would have been sufficient (not related to the noted problems).

Should this detail be handled as an isomorphism?
https://github.com/coccinelle/coccinelle/blob/19ee1697bf152d37a78a20cefe148775bf4b0e0d/standard.iso#L134

Quoted 9 lines
Quoted 6 lines

elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_pointer_access_before_null_check3.cocci drivers/firmware/efi/runtime-wrappers.c …
Fatal error: exception File "engine/ctlcocci_integration.ml", line 361, characters 4-10: Assertion failed elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_pointer_access_before_null_check3.cocci net/core/dev.c …
no position information

Thanks for the reports. These are related to dead code and will be addressed sooner (second case) or later (first case).

I am curious on further collateral evolution.

Would you like to discuss any extensions for the affected software areas (besides the mentioned error messages)?

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

#3 lore raw

Re: [Cocci] Clarification for application of null pointer checks with SmPL

Quoted 11 lines · Markus Elfring
Quoted 8 lines
Quoted 6 lines

... when any

     when != pointer = \( action(...) \| x \)

*if (
( !pointer
| pointer == NULL
)

pointer == NULL would have been sufficient (not related to the noted problems).

Should this detail be handled as an isomorphism?
https://github.com/coccinelle/coccinelle/blob/19ee1697bf152d37a78a20cefe148775bf4b0e0d/standard.iso#L134

Yes.

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

#4 lore raw

Re: [Cocci] Clarification for application of null pointer checks with SmPL

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

pointer == NULL would have been sufficient (not related to the noted problems).

Should this detail be handled as an isomorphism?
https://github.com/coccinelle/coccinelle/blob/19ee1697bf152d37a78a20cefe148775bf4b0e0d/standard.iso#L134

Yes.

Unfortunately, I might stumble still on difficulties for the understanding of desired and actually observed software behaviour (because of remaining open issues).

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