Comments (3)
I have identified two major issues that contribute to the failure of incremental parsing:
[1] The segmentation fault comes from CppMetricsParser::CppMetricsParser
during plugin creation:
node->location.file
has not been not loaded with .load()
. A read attempt is made on the ID of a non-loaded File
object.
Conclusion: This query should be refactored into a view that uses JOINs to achieve the same result without the need for a query_one
for each AST node and .load()
for each file.
[2] Once that's fixed, a second problem arises in SourceManager::removeFile
during the global cleanup phase:
CodeCompass/parser/src/sourcemanager.cpp
Line 243 in 8e84d84
.size()
is being called on the results of an ODB query that has not been cached prior to this via .cache()
.
(See https://www.codesynthesis.com/products/odb/doc/manual.xhtml#4.4 )
Even worse yet, even if we did call .cache()
, .size()
would still always throw odb::result_not_cached
when we use SQLite for parsing. I actually ran into this limitation very recently in https://github.com/Ericsson/CodeCompass/pull/734/files#diff-24d453f78f735d12a81ddf3aa0350be52c74b9d362c63a3c3532e5ca6ad4e6dfR148 .
(See https://www.codesynthesis.com/products/odb/doc/manual.xhtml#18.5.1 )
Conclusion: We should eliminate all .size()
and .cache()
calls on ODB query results from CodeCompass. For as long as we support SQLite, it's a potential source of exceptions.
from codecompass.
I have verified that the bug is present on the master
branch, but do not occur with the --skip cxxmetricsparser
flag. Also, the release/gershwin
branch is not affected by the bug, which is prior to the the introduction of the C++ metrics plugin.
from codecompass.
I have identified two major issues that contribute to the failure of incremental parsing:
[1] The segmentation fault comes from
CppMetricsParser::CppMetricsParser
during plugin creation:
node->location.file
has not been not loaded with.load()
. A read attempt is made on the ID of a non-loadedFile
object.Conclusion: This query should be refactored into a view that uses JOINs to achieve the same result without the need for a
query_one
for each AST node and.load()
for each file.
@dbukki Nice catch 👏
[2] Once that's fixed, a second problem arises in
SourceManager::removeFile
during the global cleanup phase:CodeCompass/parser/src/sourcemanager.cpp
Line 243 in 8e84d84
.size()
is being called on the results of an ODB query that has not been cached prior to this via.cache()
. (See https://www.codesynthesis.com/products/odb/doc/manual.xhtml#4.4 )Even worse yet, even if we did call
.cache()
,.size()
would still always throwodb::result_not_cached
when we use SQLite for parsing. I actually ran into this limitation very recently in https://github.com/Ericsson/CodeCompass/pull/734/files#diff-24d453f78f735d12a81ddf3aa0350be52c74b9d362c63a3c3532e5ca6ad4e6dfR148 . (See https://www.codesynthesis.com/products/odb/doc/manual.xhtml#18.5.1 )Conclusion: We should eliminate all
.size()
and.cache()
calls on ODB query results from CodeCompass. For as long as we support SQLite, it's a potential source of exceptions.
@dbukki We should not optimize for SQLite support, as that is only for development purposes. It was also considered multiple times during the project's lifetime to completly drop SQLite support. If incremental parsing is conflicting with SQLite, then we can make incremental parsing not supporting it.
from codecompass.
Related Issues (20)
- Local variables are not shown for methods
- Relational Cohesion at Module Level for C++
- Lack of Cohesion of Methods at Type Level for C++ HOT 3
- Cyclomatic Complexity at Function Level for C++
- Cyclomatic Complexity at Type Level for C++ HOT 13
- Bumpy Road Complexity at Function Level for C++
- Add an option to skip webgui builds HOT 3
- LibODB not added properly to runtime docker images
- Multiple CppFunction entities HOT 3
- Separate parse-time C++ metrics information into distinct tables
- Fix code scanning alert - Token-Permissions
- Newer NodeJS versions are not compatible with Ubuntu 16.04 / SUSE 42.1
- Dynamic parsing job launch based on available memory
- Add C++ linter to the CI workflow
- Macro expansion error in C/C++ for _Pragma
- Parallel parsing in C++ metrics
- Long C++ metrics parsing time on Ubuntu 22.04 HOT 1
- Handle duplicated compile commands
- Incorrect ODB installation to webserver Docker images HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codecompass.