FeralInteractive / gamemode

Optimise Linux system performance on demand
BSD 3-Clause "New" or "Revised" License
4.66k stars 183 forks source link

Completion of error handling #118

Open elfring opened 5 years ago

elfring commented 5 years ago

Would you like to add more error handling for return values from functions like the following?

afayaz-feral commented 4 years ago

It'll be worth giving the code a once over to make sure we're checking return values when it's appropriate and graceful recovery is possible.

Realistically, with the examples you've given, there's not much we can do except "exit immediately" if those particular functions return errors.

elfring commented 4 years ago

How do you think about to improve static source code analysis also for this software?

mdiluz commented 4 years ago

https://www.github.com/FeralInteractive/gamemode/tree/master/scripts%2Fstatic-analyser-check.sh already has static analysis implemented

elfring commented 4 years ago

Does a combination of analysis tools point any remaining open issues out?

afayaz-feral commented 4 years ago

I ran this check just now and got nothing but false positives. A few instances of "Called function pointer is null (null dereference)".

These all came from the fact that the analyzer assumes that internal_load_libgamemode() will return successfully but it doesn't take into account that the only way it can return successfully is if its managed to set global function pointers.