This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 255337 - [newcodemodel] preprocessor states differ on 1
Summary: [newcodemodel] preprocessor states differ on 1
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: PC Solaris
: P2 normal (vote)
Assignee: issues@cnd
URL:
Keywords:
Depends on:
Blocks: 250075
  Show dependency tree
 
Reported: 2015-09-16 16:05 UTC by Alexander Simon
Modified: 2015-09-23 09:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2015-09-16 16:05:48 UTC
I'm investigating failed test:
cnd-test-solaris10.x86/11757/testReport/org.netbeans.modules.cnd.repository.impl/ReopenRepositoryValidationFinal/testRepository/
It failed with difference in states of the file sqlite-autoconf-3071700/sqlite3.c
Difference in last two segments of the states:
...[4953391-4966886][4967555-4973714]
...[4953391-4966887][4967556-4973715]
Converted offset to line:column:
...[139724:56/4953391-140191:1/4966886][140209:57/4967555-140453:40/4973714]
...[139724:56/4953391-140192:1/4966887][140210: 1/4967556-140454: 1/4973715]
As you can see the offset in second line is wrong (offset is increased on +1).
I hardly believe in error in hardware/cache.
It looks like code model preprocessor gets wrong offset of dead segments.
Code fragment with offsets in square parenthesis:

#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ICU)[139724:56/4953391]
...
#endif
[140191:1/4966886]
[140192:1/4966887]#endif
...
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)[140209:57/4967555]
[140210:1/4967556]#ifdef SQLITE_ENABLE_ICU
...
#endif /* defined(SQLITE_ENABLE_ICU) */[140453:40/4973714]
[140454:1/4973715]#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */
...
Comment 1 Alexander Simon 2015-09-16 16:16:49 UTC
problem is also reproduced in the build 11760
Comment 2 Alexander Simon 2015-09-17 08:02:26 UTC
additional investigation:
I reproduced bug on my computer.

#cat ./testRepository/ModelBuiltFromRepository.out | grep "3190-3210"
has 1 line ends on [4967556-4973715] (wrong)

#cat ./testRepository-1/ModelBuiltFromRepository.out | grep "3190-3210"
has 2 lines ends on [4967555-4973714] (right) and [4967556-4973715] (wrong)

Indeed sqlite3.c is included from tea/generic/tclsqlite3.c:

#ifdef USE_SYSTEM_SQLITE
# include <sqlite3.h>
#else
#include "../../sqlite3.c"
#endif

I.e. first golden parse produced wrong ppstate, second parse produced right and wrong ppstate.

I hope it help.
Comment 3 Quality Engineering 2015-09-18 01:41:07 UTC
Integrated into 'main-silver', will be available in build *201509180002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b2b9455a1b6a
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: trying to localize iz #255337 - [newcodemodel] preprocessor states differ on 1
Comment 4 Quality Engineering 2015-09-19 03:05:23 UTC
Integrated into 'main-silver', will be available in build *201509190002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/7121a799ed9b
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #250075 Finishing interrupted parsing produces broken code model
- work around blocker Bug #255337 [newcodemodel] preprocessor states differ on 1
It seems new code model do not use file owner query and always assume UTF-8 encoding.
Provide default owner query for test which returns UTF-8
Comment 5 Vladimir Kvashin 2015-09-23 09:37:18 UTC
Fixed via changing FileSystem to ClankFileObjectBasedFileSystem