SlideShare a Scribd company logo
1 of 3
Download to read offline
Bugs Found by LibreOffice in PVS-Studio
Author: Svyatoslav Razmyslov
Date: 24.02.2015
Usually we check various projects by PVS-Studio. This time, it's been vice versa: We have checked PVS-
Studio by LibreOffice :-). And then managed to do the opposite check as well.
Introduction
Our articles about project checks evoke different reactions from the readers: from "Aren't you bored
advertising your tool already?" to "Thank you very much! PVS-Studio is really a great tool!" For justice's
sake, I would like to notice that no advertising managers ever take part in the project check, it's only the
PVS-Studio developers and translator who do the job. So our contribution to the open-source
community is real and really sensible. Developers do not always show interest in maintaining the
feedback but they do fix the bugs we report to them in emails. By the example of the LibreOffice
project's check, the article about which will soon be published, I'd like to tell you about how our checks
influence the analyzer itself and about the work we have done.
About the analyzer
PVS-Studio is a static analyzer detecting errors in the source code of programs in C/C++. Its usage and
integration capabilities are constantly evolving, so, besides the demonstration purposes, open-source
projects serve as impartial testers for our analyzer.
The LibreOffice project turned out to be a good test for the analyzer and made everyone in the PVS-
Studio team spend some effort to resolve the problems revealed by the analysis.
Now I'll tell you about the problems we were faced by when running that check.
Memory leak
LibreOffice is built with MS Visual C++ 2013 in Cygwin. Not so long ago, the PVS-Studio Standalone utility
acquired the ability to check any projects. Regardless of the specifics of the present build system, you
can now simply enable the "Compiler Monitoring" option and start the project build. To learn more
about this feature, see the article PVS-Studio Now Supports Any Build System under Windows and Any
Compiler. Easy and Right Out of the Box. To put it short, the utility can extract from the processes
running under Windows all the information necessary for starting the analysis process in the same
environment. So, when running a project build, a few hundreds of Kbytes of unmanaged memory are
allocated for storing the launch command line, current folder, environment variables and so on. For
processes supported by the compiler, the information would be copied into managed memory while
unmanaged memory was freed in any case. But, as we have discovered, it did not work for the
environment variables. For each process, about 500 Kbytes on average failed to be freed. It didn't cause
any serious troubles with previous projects (at least we didn't notice anything and users didn't complain
either). But when building LibreOffice through Make, a huge number of processes are run which do not
refer to the compiler. During the several hours of the build process, more than one hundred thousand
processes were launched, which resulted in "piling up" of total 25 Gbytes. After fixing the issue, the size
of the memory used by the monitoring system dropped to 1,8 Gbytes.
Long analysis
The whole build process, including library compilation, contained 12245 source files. Unfortunately, the
analysis process for such a huge number of files took about 15 hours, so we made some optimizations in
the analyzer kernel that allowed us to re-analyze the project in as few as 9 hours. It is twice the project
build time but this speed is still quite adequate and satisfying.
Analysis complications
If the analyzer can't figure out some constructs in the source code, it generates the V001 message for
that file. It skips this fragment, which very rarely affects the analysis results. However, we studied and
fixed all the V001 messages for this project.
Old path format
When checking the project, we discovered that the system paths had been defined in the old format, for
example "C:/PROGRA~2/MICROS~4.0/VC/include". This format is fully supported by the analyzer kernel
and plugin but the message filtering mechanism failed for the system files, so we had to make some
fixes.
Unlucky serialization
This issue doesn't quite refer to the PVS-Studio products. The PVS-Studio Standalone utility where
LibreOffice was checked has recently got a better file navigation mechanism which now allows
navigation by included headers and search for types and variables in dependent files. All the
dependencies are collected during the check and saved in the same folder with the *.plog file.
Unfortunately, the standard class System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
cannot serialize structures of a large size - an internal exception is thrown, so now we use the Protocol
Buffers library which is very good at this task.
Conclusion
The check of the LibreOffice project resulted in an article aiming at improving one more open-source
project, as well as useful fixes made in the PVS-Studio products. The article about the bugs found in
LibreOffice will be published soon. And we want to say thank you to the LibreOffice project that has
helped us make our analyzer better!
References
1. PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy and Right
Out of the Box
2. PVS-Studio's New Message Suppression Mechanism

More Related Content

What's hot

Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...
Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...
Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...Windows Developer
 
Pipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of TestingPipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of TestingSwapnil Jadhav
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 
Jenkins Pipelining and Gatling Integration
Jenkins Pipelining and  Gatling IntegrationJenkins Pipelining and  Gatling Integration
Jenkins Pipelining and Gatling IntegrationKnoldus Inc.
 
Automating Perl deployments with Hudson
Automating Perl deployments with HudsonAutomating Perl deployments with Hudson
Automating Perl deployments with Hudsonnachbaur
 
Introduction to GOCD - Amulya Sharma
Introduction to GOCD - Amulya SharmaIntroduction to GOCD - Amulya Sharma
Introduction to GOCD - Amulya SharmaAmulya Sharma
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti
 
Jenkins Pipeline 101 and TCI - presentation and workshop
Jenkins Pipeline 101 and TCI - presentation and workshopJenkins Pipeline 101 and TCI - presentation and workshop
Jenkins Pipeline 101 and TCI - presentation and workshopYoram Michaeli
 
Building the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for TestersBuilding the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for TestersWilliam Echlin
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jiralenamattt
 
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonEclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonVladLica
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineSlawa Giterman
 

What's hot (20)

Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...
Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...
Build 2017 - B8096 - Ten things you didn’t know about Visual Studio 2017 for ...
 
Pipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of TestingPipeline as code using Jenkins -Ministry of Testing
Pipeline as code using Jenkins -Ministry of Testing
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 
Graphql usage
Graphql usageGraphql usage
Graphql usage
 
Jenkins
JenkinsJenkins
Jenkins
 
Meet Jenkins
Meet JenkinsMeet Jenkins
Meet Jenkins
 
Jenkins Pipelining and Gatling Integration
Jenkins Pipelining and  Gatling IntegrationJenkins Pipelining and  Gatling Integration
Jenkins Pipelining and Gatling Integration
 
Automated Testing in DevOps
Automated Testing in DevOpsAutomated Testing in DevOps
Automated Testing in DevOps
 
Source Code management System
Source Code management SystemSource Code management System
Source Code management System
 
Automating Perl deployments with Hudson
Automating Perl deployments with HudsonAutomating Perl deployments with Hudson
Automating Perl deployments with Hudson
 
Introduction to GOCD - Amulya Sharma
Introduction to GOCD - Amulya SharmaIntroduction to GOCD - Amulya Sharma
Introduction to GOCD - Amulya Sharma
 
SVN notes
SVN notesSVN notes
SVN notes
 
Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1Tuenti Release Workflow v1.1
Tuenti Release Workflow v1.1
 
Jenkins Pipeline 101 and TCI - presentation and workshop
Jenkins Pipeline 101 and TCI - presentation and workshopJenkins Pipeline 101 and TCI - presentation and workshop
Jenkins Pipeline 101 and TCI - presentation and workshop
 
Building the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for TestersBuilding the Test Automation Framework - Jenkins for Testers
Building the Test Automation Framework - Jenkins for Testers
 
Bitbucket git-bamboo-jira
Bitbucket git-bamboo-jiraBitbucket git-bamboo-jira
Bitbucket git-bamboo-jira
 
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/HudsonEclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
 
Manen Ant SVN
Manen Ant SVNManen Ant SVN
Manen Ant SVN
 
Contineous integration
Contineous integrationContineous integration
Contineous integration
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
 

Viewers also liked

PVS-Studio for Visual C++
PVS-Studio for Visual C++PVS-Studio for Visual C++
PVS-Studio for Visual C++PVS-Studio
 
SBP 06092015
SBP 06092015SBP 06092015
SBP 06092015Paul Kane
 
Prueba primer parcial historia del derecho
Prueba primer parcial historia del derechoPrueba primer parcial historia del derecho
Prueba primer parcial historia del derecholiznavarro888
 
EXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMAR
EXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMAREXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMAR
EXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMARDHANANJAY KUMAR
 
EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE
EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE
EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE IAEME Publication
 
Justyna Salamonska - ageing and attitudes
Justyna Salamonska - ageing and attitudesJustyna Salamonska - ageing and attitudes
Justyna Salamonska - ageing and attitudesMigrationPolicyCentre
 
Islas Vírgenes Británicas - sociedades offshore BVI IBC - Slogold
Islas Vírgenes Británicas - sociedades offshore BVI IBC - SlogoldIslas Vírgenes Británicas - sociedades offshore BVI IBC - Slogold
Islas Vírgenes Británicas - sociedades offshore BVI IBC - SlogoldTom Asg
 
HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...
HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...
HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...IAEME Publication
 
Talent Relationship Management part of the SAAA Recruitment model
Talent Relationship Management part of the SAAA Recruitment modelTalent Relationship Management part of the SAAA Recruitment model
Talent Relationship Management part of the SAAA Recruitment modelAlexander Crépin
 

Viewers also liked (16)

PVS-Studio for Visual C++
PVS-Studio for Visual C++PVS-Studio for Visual C++
PVS-Studio for Visual C++
 
SBP 06092015
SBP 06092015SBP 06092015
SBP 06092015
 
Prueba primer parcial historia del derecho
Prueba primer parcial historia del derechoPrueba primer parcial historia del derecho
Prueba primer parcial historia del derecho
 
Ferrehogar 16
Ferrehogar 16Ferrehogar 16
Ferrehogar 16
 
Taller1
Taller1Taller1
Taller1
 
3 Essential Social Media Advice
3 Essential Social Media Advice3 Essential Social Media Advice
3 Essential Social Media Advice
 
Taller 7
Taller 7Taller 7
Taller 7
 
EXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMAR
EXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMAREXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMAR
EXCEL WITH VBA+SQL- CV.doc@ 2.5 Yr exp DKUMAR
 
EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE
EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE
EFFECT OF ALKALI MATERIALS ON GEO POLYMER CONCRETE
 
Justyna Salamonska - ageing and attitudes
Justyna Salamonska - ageing and attitudesJustyna Salamonska - ageing and attitudes
Justyna Salamonska - ageing and attitudes
 
Islas Vírgenes Británicas - sociedades offshore BVI IBC - Slogold
Islas Vírgenes Británicas - sociedades offshore BVI IBC - SlogoldIslas Vírgenes Británicas - sociedades offshore BVI IBC - Slogold
Islas Vírgenes Británicas - sociedades offshore BVI IBC - Slogold
 
HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...
HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...
HEAT TRANSFER AND FLOW FRICTION CHARACTERISTICS OF SOLAR WATER HEATER WITH IN...
 
Embajadores de la marca
Embajadores de la marcaEmbajadores de la marca
Embajadores de la marca
 
Turbine
TurbineTurbine
Turbine
 
Lean Startup Hardware Examples
Lean Startup Hardware ExamplesLean Startup Hardware Examples
Lean Startup Hardware Examples
 
Talent Relationship Management part of the SAAA Recruitment model
Talent Relationship Management part of the SAAA Recruitment modelTalent Relationship Management part of the SAAA Recruitment model
Talent Relationship Management part of the SAAA Recruitment model
 

Similar to Bugs Found by LibreOffice in PVS-Studio

PVS-Studio confesses its love for Linux
PVS-Studio confesses its love for LinuxPVS-Studio confesses its love for Linux
PVS-Studio confesses its love for LinuxPVS-Studio
 
The Development History of PVS-Studio for Linux
The Development History of PVS-Studio for LinuxThe Development History of PVS-Studio for Linux
The Development History of PVS-Studio for LinuxPVS-Studio
 
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumTrying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumAndrey Karpov
 
You can now use PVS-Studio with Visual Studio absent; just give it the prepro...
You can now use PVS-Studio with Visual Studio absent; just give it the prepro...You can now use PVS-Studio with Visual Studio absent; just give it the prepro...
You can now use PVS-Studio with Visual Studio absent; just give it the prepro...Andrey Karpov
 
PVS-Studio Has Finally Got to Boost
PVS-Studio Has Finally Got to BoostPVS-Studio Has Finally Got to Boost
PVS-Studio Has Finally Got to BoostAndrey Karpov
 
RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)alloy020
 
R&D on PVS-Studio
R&D on PVS-StudioR&D on PVS-Studio
R&D on PVS-StudioPVS-Studio
 
War of the Machines: PVS-Studio vs. TensorFlow
War of the Machines: PVS-Studio vs. TensorFlowWar of the Machines: PVS-Studio vs. TensorFlow
War of the Machines: PVS-Studio vs. TensorFlowPVS-Studio
 
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...Andrey Karpov
 
Comparing Functionalities of PVS-Studio and CppCat Static Code Analyzers
Comparing Functionalities of PVS-Studio and CppCat Static Code AnalyzersComparing Functionalities of PVS-Studio and CppCat Static Code Analyzers
Comparing Functionalities of PVS-Studio and CppCat Static Code AnalyzersAndrey Karpov
 
How we test the code analyzer
How we test the code analyzerHow we test the code analyzer
How we test the code analyzerPVS-Studio
 
How to Port a 9 Million Code Line Project to 64 bits?
How to Port a 9 Million Code Line Project to 64 bits? How to Port a 9 Million Code Line Project to 64 bits?
How to Port a 9 Million Code Line Project to 64 bits? PVS-Studio
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...Simplilearn
 
Built to Scale: The Mozilla Release Engineering toolbox
Built to Scale: The Mozilla Release Engineering toolboxBuilt to Scale: The Mozilla Release Engineering toolbox
Built to Scale: The Mozilla Release Engineering toolboxKim Moir
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLabPablo Arriazu
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notesPerrin Harkins
 
Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Rafael Camacho Dejay
 
How we test the code analyzer
How we test the code analyzerHow we test the code analyzer
How we test the code analyzerPVS-Studio
 
Tips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1xTips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1xSenturus
 
We continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShellWe continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShellPVS-Studio
 

Similar to Bugs Found by LibreOffice in PVS-Studio (20)

PVS-Studio confesses its love for Linux
PVS-Studio confesses its love for LinuxPVS-Studio confesses its love for Linux
PVS-Studio confesses its love for Linux
 
The Development History of PVS-Studio for Linux
The Development History of PVS-Studio for LinuxThe Development History of PVS-Studio for Linux
The Development History of PVS-Studio for Linux
 
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in ChromiumTrying to Sell PVS-Studio to Google, or New Bugs in Chromium
Trying to Sell PVS-Studio to Google, or New Bugs in Chromium
 
You can now use PVS-Studio with Visual Studio absent; just give it the prepro...
You can now use PVS-Studio with Visual Studio absent; just give it the prepro...You can now use PVS-Studio with Visual Studio absent; just give it the prepro...
You can now use PVS-Studio with Visual Studio absent; just give it the prepro...
 
PVS-Studio Has Finally Got to Boost
PVS-Studio Has Finally Got to BoostPVS-Studio Has Finally Got to Boost
PVS-Studio Has Finally Got to Boost
 
RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)RubyMotion Inspect Conference - 2013. (With speaker notes.)
RubyMotion Inspect Conference - 2013. (With speaker notes.)
 
R&D on PVS-Studio
R&D on PVS-StudioR&D on PVS-Studio
R&D on PVS-Studio
 
War of the Machines: PVS-Studio vs. TensorFlow
War of the Machines: PVS-Studio vs. TensorFlowWar of the Machines: PVS-Studio vs. TensorFlow
War of the Machines: PVS-Studio vs. TensorFlow
 
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy...
 
Comparing Functionalities of PVS-Studio and CppCat Static Code Analyzers
Comparing Functionalities of PVS-Studio and CppCat Static Code AnalyzersComparing Functionalities of PVS-Studio and CppCat Static Code Analyzers
Comparing Functionalities of PVS-Studio and CppCat Static Code Analyzers
 
How we test the code analyzer
How we test the code analyzerHow we test the code analyzer
How we test the code analyzer
 
How to Port a 9 Million Code Line Project to 64 bits?
How to Port a 9 Million Code Line Project to 64 bits? How to Port a 9 Million Code Line Project to 64 bits?
How to Port a 9 Million Code Line Project to 64 bits?
 
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
DevOps Tutorial For Beginners | DevOps Tutorial | DevOps Tools | DevOps Train...
 
Built to Scale: The Mozilla Release Engineering toolbox
Built to Scale: The Mozilla Release Engineering toolboxBuilt to Scale: The Mozilla Release Engineering toolbox
Built to Scale: The Mozilla Release Engineering toolbox
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 
Care and feeding notes
Care and feeding notesCare and feeding notes
Care and feeding notes
 
Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01Programming Sessions KU Leuven - Session 01
Programming Sessions KU Leuven - Session 01
 
How we test the code analyzer
How we test the code analyzerHow we test the code analyzer
How we test the code analyzer
 
Tips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1xTips for Installing Cognos Analytics 11.2.1x
Tips for Installing Cognos Analytics 11.2.1x
 
We continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShellWe continue checking Microsoft projects: analysis of PowerShell
We continue checking Microsoft projects: analysis of PowerShell
 

Recently uploaded

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Bugs Found by LibreOffice in PVS-Studio

  • 1. Bugs Found by LibreOffice in PVS-Studio Author: Svyatoslav Razmyslov Date: 24.02.2015 Usually we check various projects by PVS-Studio. This time, it's been vice versa: We have checked PVS- Studio by LibreOffice :-). And then managed to do the opposite check as well. Introduction Our articles about project checks evoke different reactions from the readers: from "Aren't you bored advertising your tool already?" to "Thank you very much! PVS-Studio is really a great tool!" For justice's sake, I would like to notice that no advertising managers ever take part in the project check, it's only the PVS-Studio developers and translator who do the job. So our contribution to the open-source community is real and really sensible. Developers do not always show interest in maintaining the feedback but they do fix the bugs we report to them in emails. By the example of the LibreOffice project's check, the article about which will soon be published, I'd like to tell you about how our checks influence the analyzer itself and about the work we have done.
  • 2. About the analyzer PVS-Studio is a static analyzer detecting errors in the source code of programs in C/C++. Its usage and integration capabilities are constantly evolving, so, besides the demonstration purposes, open-source projects serve as impartial testers for our analyzer. The LibreOffice project turned out to be a good test for the analyzer and made everyone in the PVS- Studio team spend some effort to resolve the problems revealed by the analysis. Now I'll tell you about the problems we were faced by when running that check. Memory leak LibreOffice is built with MS Visual C++ 2013 in Cygwin. Not so long ago, the PVS-Studio Standalone utility acquired the ability to check any projects. Regardless of the specifics of the present build system, you can now simply enable the "Compiler Monitoring" option and start the project build. To learn more about this feature, see the article PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy and Right Out of the Box. To put it short, the utility can extract from the processes running under Windows all the information necessary for starting the analysis process in the same environment. So, when running a project build, a few hundreds of Kbytes of unmanaged memory are allocated for storing the launch command line, current folder, environment variables and so on. For processes supported by the compiler, the information would be copied into managed memory while unmanaged memory was freed in any case. But, as we have discovered, it did not work for the environment variables. For each process, about 500 Kbytes on average failed to be freed. It didn't cause any serious troubles with previous projects (at least we didn't notice anything and users didn't complain either). But when building LibreOffice through Make, a huge number of processes are run which do not refer to the compiler. During the several hours of the build process, more than one hundred thousand processes were launched, which resulted in "piling up" of total 25 Gbytes. After fixing the issue, the size of the memory used by the monitoring system dropped to 1,8 Gbytes. Long analysis The whole build process, including library compilation, contained 12245 source files. Unfortunately, the analysis process for such a huge number of files took about 15 hours, so we made some optimizations in the analyzer kernel that allowed us to re-analyze the project in as few as 9 hours. It is twice the project build time but this speed is still quite adequate and satisfying. Analysis complications If the analyzer can't figure out some constructs in the source code, it generates the V001 message for that file. It skips this fragment, which very rarely affects the analysis results. However, we studied and fixed all the V001 messages for this project. Old path format When checking the project, we discovered that the system paths had been defined in the old format, for example "C:/PROGRA~2/MICROS~4.0/VC/include". This format is fully supported by the analyzer kernel and plugin but the message filtering mechanism failed for the system files, so we had to make some fixes. Unlucky serialization This issue doesn't quite refer to the PVS-Studio products. The PVS-Studio Standalone utility where LibreOffice was checked has recently got a better file navigation mechanism which now allows navigation by included headers and search for types and variables in dependent files. All the
  • 3. dependencies are collected during the check and saved in the same folder with the *.plog file. Unfortunately, the standard class System.Runtime.Serialization.Formatters.Binary.BinaryFormatter cannot serialize structures of a large size - an internal exception is thrown, so now we use the Protocol Buffers library which is very good at this task. Conclusion The check of the LibreOffice project resulted in an article aiming at improving one more open-source project, as well as useful fixes made in the PVS-Studio products. The article about the bugs found in LibreOffice will be published soon. And we want to say thank you to the LibreOffice project that has helped us make our analyzer better! References 1. PVS-Studio Now Supports Any Build System under Windows and Any Compiler. Easy and Right Out of the Box 2. PVS-Studio's New Message Suppression Mechanism