Re: [git pull] vfs.git regression fix Re: Regression related to ipc shmctl compat

From: Luc Van Oostenryck
Date: Tue Sep 26 2017 - 15:45:50 EST


On Mon, Sep 25, 2017 at 07:07:01PM -0700, Linus Torvalds wrote:
> On Mon, Sep 25, 2017 at 7:03 PM, Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > I agree. It might be better to just remove the address space logic,
> > because afaik it never worked for them.
>
> .. and sadly, we should probably disable the locking ones by default
> too, because while they *work*, sparse only handles static cases, and
> we have way too many dynamically conditional cases that are outside
> the scope of what sparse does.
>
> It would probably be good to disable things that are fundamentally
> hard to fix, and aim for a clean sparse build, and maybe people would
> start using it at least for user pointer checking where it really does
> work.

Currently, the most important cause of uncleanness regarding sparse build,
and by far, is restricted types/-Wbitwise, presumably mostly __be/__le issues.

For example, on 4.13/x86-64/allyesconfig, the summary of sparse errors &
warnings is something like (with details removed):
11096 cast to restricted type
6036 incorrect type in assignment (different base types)
3439 incorrect type in initializer (different base types)
2774 symbol was not declared. Should it be static?
1670 incorrect type in argument (different address spaces)
1284 restricted type degrades to integer
889 cast from restricted type
790 incorrect type in argument (different base types)
668 cast removes address space of expression
600 incompatible types in comparison expression (different address spaces)
558 invalid assignement
465 incorrect type in assignment (different address spaces)
397 context imbalance in - unexpected unlock
297 Variable length array is used.
261 dereference of noderef expression
250 incorrect type in initializer (different address spaces)
244 context imbalance in - different lock contexts for basic block
228 attribute 'require_context': unknown attribute
201 invalid bitfield specifier for type restricted type.
164 context imbalance in - wrong count at exit
104 directive in argument list
93 Using plain integer as NULL pointer
85 incorrect type in return expression (different address spaces)
70 bad integer constant expression
69 cast truncates bits from constant value
55 Initializer entry defined twice
49 mixing different enum types
48 incorrect type in return expression (different base types)
23 constant is so big it is ...
23 cannot size expression
20 function with external linkage has definition
19 preprocessor token offsetof redefined
18 advancing past deep designator
17 no newline at end of file
14 incorrect type in argument (different modifiers)
13 bad assignment to restricted type
12 symbol redeclared with different type - different modifiers
11 dubious: x | !y
10 preprocessor token __must_hold redefined
10 "Sparse checking disabled for this file"
8 call with no type!
7 subtraction of functions? Share your drugs
6 subtraction of different types can't work (different address spaces)
6 shift too big for type
6 invalid initializer
5 incorrect type in initializer (different modifiers)
5 cast to non-scalar
4 trying to concatenate long character string (8191 bytes max)
4 right shift by bigger than source value
4 dubious: !x | y
3 missing braces around initializer
3 incorrect type in initializer (incompatible argument (different address spaces))
3 incompatible types in conditional expression (different base types)
3 dubious: x & !y
2 symbol redeclared with different type - incompatible argument (different address spaces)
2 switch with no cases
2 incorrect type in assignment (different modifiers)
2 incompatible types in comparison expression (different base types)
2 implicit cast from nocast type
2 dubious: !x & y
2 division by zero
2 cast between address spaces (<asn:3>-><asn:4>)
2 arithmetics on pointers to functions
1 unknown expression (8 46)
1 too long token expansion
1 incorrect type in initializer (incompatible argument (different signedness))
1 incorrect type in conditional
1 incorrect type in argument (incompatible argument (different signedness))
1 incorrect type in argument (incompatible argument (different base types))
1 incompatible types in conditional expression (different types)
1 cast from non-scalar
1 bad argument type for ++/--


-- Luc Van Oostenryck