Author Topic: static src analysis for fun and profit  (Read 863 times)

lbalbalba

  • Traveller
  • *
  • Posts: 12
    • View Profile
static src analysis for fun and profit
« on: June 18, 2012, 11:06:37 am »
Hi,

I have been playing around with the llvm/clang static source code analyzer (http://clang.llvm.org/get_started.html) for a while, and thought it might be fun to run it on the planeshift source code. Even though especially the c++ analyzer is still viewed as alpha quality at this time, for those interested the results might be interesting and can be found here :


http://www.lbalbalba.url.ph/clang/planeshift/


Regards,


John Smith.

Edit: Updated to the planeshift svn
« Last Edit: February 24, 2014, 03:06:24 am by lbalbalba »

Mordaan

  • Moderator
  • Hydlaa Notable
  • *
  • Posts: 839
    • View Profile
Re: static src analysis for fun and profit
« Reply #1 on: July 02, 2012, 09:15:18 am »
Hah, interesting.

When you have a project as old as this one now with so many contributors over the years, the code could probably use a periodic analysis/clean up.  Who knows, maybe this can lead to solving some of those crashes.   :whistling:
--Overseer, Explorers Guild.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: static src analysis for fun and profit
« Reply #2 on: July 02, 2012, 09:30:51 am »
Reading compiler warnings would possibly be a first step before this giant leap. And be careful, automated analyzers aren't smarter than their programmers...

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

lbalbalba

  • Traveller
  • *
  • Posts: 12
    • View Profile
Re: static src analysis for fun and profit
« Reply #3 on: July 02, 2012, 10:43:55 am »
be careful, automated analyzers aren't smarter than their programmers...
This is very true. Especially when the C++ (not the C) analyzer is still considered to be in the beta stage at this point in time. However, I still think that it might be useful if a developer that has decent knowledge of the overall codebase took a look at the report. And if one would have the extra time and be really interested in this, one could also aid in improving the analyzer by posting 'false positives' against the Clang Static Analyzer component in the llvm-clang bug tracker: http://llvm.org/bugs/


And I do remember a developer state one time, that if an analyzer cant make sense of the code, that that might mean that piece of code is a good candidate for refactoring.

Anyway, thanks for all the responses so far.

PS: compiler warnings aren't smarter than their programmers either ;)
« Last Edit: July 02, 2012, 11:18:19 am by lbalbalba »

lbalbalba

  • Traveller
  • *
  • Posts: 12
    • View Profile
Re: static src analysis for fun and profit
« Reply #4 on: February 24, 2014, 03:07:34 am »
Updated to the latest planeshift svn and llvm/clang svn:

http://www.lbalbalba.url.ph/clang/planeshift/

lbalbalba

  • Traveller
  • *
  • Posts: 12
    • View Profile
Re: static src analysis for fun and profit
« Reply #5 on: March 13, 2014, 03:27:28 pm »
Updated to the latest planeshift svn (r9332) and llvm/clang svn (r203802) once more:

http://www.lbalbalba.url.ph/clang/planeshift/

Sen

  • Hydlaa Notable
  • *
  • Posts: 746
    • View Profile
Re: static src analysis for fun and profit
« Reply #6 on: March 14, 2014, 01:07:13 pm »
There are no security-related bugs mentioned (not counting e.g. the null dereference and use after free). Was security a part of the test scenario?
.....also a saddle that won't pinch the tail. One day!

derula

  • Hydlaa Citizen
  • *
  • Posts: 405
  • My main: Jamona Shikon
    • View Profile
    • Ugly Horst Tld.
Re: static src analysis for fun and profit
« Reply #7 on: March 14, 2014, 03:08:21 pm »
FYI: lbalbalba's site is being blocked by F-Secure as malicious.

lbalbalba

  • Traveller
  • *
  • Posts: 12
    • View Profile
Re: static src analysis for fun and profit
« Reply #8 on: March 14, 2014, 03:18:45 pm »
FYI: lbalbalba's site is being blocked by F-Secure as malicious.
Really ? That sucks. big bad booo f-secure !

lbalbalba

  • Traveller
  • *
  • Posts: 12
    • View Profile
Re: static src analysis for fun and profit
« Reply #9 on: March 14, 2014, 03:20:26 pm »
There are no security-related bugs mentioned (not counting e.g. the null dereference and use after free). Was security a part of the test scenario?
security is not a separate goal for the scanner. it attempts to find *all* bugs, security related or not.