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 255678 - Code assistance is broken on Windows
Summary: Code assistance is broken on Windows
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P1 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords: 81_HR_FIX
Depends on:
Blocks:
 
Reported: 2015-10-04 14:53 UTC by pompex
Modified: 2015-10-29 09:41 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Messages logs (555.02 KB, application/octet-stream)
2015-10-04 16:01 UTC, pompex
Details
Hudson build messages.log (839.60 KB, application/octet-stream)
2015-10-05 00:13 UTC, pompex
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pompex 2015-10-04 14:53:37 UTC
Product Version: NetBeans IDE Dev (Build 201510030002)
Java: 1.8.0_51; Java HotSpot(TM) 64-Bit Server VM 25.51-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_51-b16

---------

This bug is related to the C++ project. I am using the remote server to compile the source, hosted on the FreeBSD.

I've downloaded latest dev version as the 8.1 Beta code-completion is broken. It seems like the dev version code assistance for C(++) projects is broken.

Everything was working fine until I made some changes to the project files in my C++ project and re-opened the IDE. Now I can't really reproduce those steps as the basic functions are not working.

Code Assistance -> Reparse Project is executing without the problem but nothing happends then all of the symptoms below still exist.

---------

Symptoms:

* All identifiers (methods/variables) are marked as error,
* Navigation through the source isn't working,
* No exceptions are being thrown,
* Code-completion is working, but it seem to show only the global variables,

---------

What have I tried (nothing helped):

* Removing the cache from the: C:\Users\<username>\AppData\Local\NetBeans\Cache\dev,
* Changing the netbeans_jdkhome in netbeans.conf to the other version
Comment 1 Vladimir Voskresensky 2015-10-04 15:28:39 UTC
do you have anything interesting in your message.log?
http://wiki.netbeans.org/FaqLogMessagesFile
Comment 2 pompex 2015-10-04 16:01:17 UTC
Created attachment 156504 [details]
Messages logs
Comment 3 pompex 2015-10-04 16:01:24 UTC
There are few exceptions logged, this may be interesting:

---------
Tons of exceptions:
Caused by: java.lang.AssertionError: filename from getStatValue() refers to wrong file
---------

I have attached a messages.log file as it seems like there are more bad things going on.
Comment 4 Vladimir Voskresensky 2015-10-04 19:40:25 UTC
Looks serious enough. Needs investigation
Comment 5 Vladimir Voskresensky 2015-10-04 22:28:09 UTC
Pompex, could you, please, try to reproduce the issue with smaller test case and provide steps/project for me to analyse? 

Also I've committed more debug info. It would be very helpful if you can download dev bits with my changes from
http://deadlock.netbeans.org/job/cnd-main/2928/
It would be in BuildArtifacts as
NetBeans-dev-cnd-main-292****.zip

Thanks for your help!
Vladimir.
Comment 6 pompex 2015-10-05 00:00:04 UTC
I have spent like 2 hours on testing cases and such as I am still coding with this Netbeans version. I have collected few more observations which can help here:

* I have been coding among 4 project files for a while now (my project has more than 260 files [cpp/headers]) while reporting this so I was basing on my observations from these 4. However, I found out that everything is working just fine for almost all of the project files (sometimes the Navigator simply hangs at "Please wait..." for all files),

* It's not random (fortunately!). I mean that described symptoms doesn't occur for random project files. It's rather static and the problem symtomps are related to the same single files.

* I am able to make it work (though it doesn't work everytime). Looks like it's strongly related to the remote server connection;

The following steps can bring it back to life:

1) Remove Netbeans cache folder (important),
2) When IDE boot up, it's very important to immadiately reconnect to the remote server (I have observed it must be done just before the C++ project parsing starts),
3) Sometimes closing & re-opening the file tab helps,
[..]

* ^ when it's finally working, adding a new function to the file header/cpp file results in the same symtomps I described in the bug description, but this time just for this certain function (reparsing doesn't help so far). Also, the function is not being shown in the code auto-completion window,

---------

Hope that can help a bit. I will post more informations from the hudson build soon.
Comment 7 pompex 2015-10-05 00:13:44 UTC
Created attachment 156505 [details]
Hudson build messages.log
Comment 8 pompex 2015-10-05 00:14:23 UTC
Added messages.log from the hudson build.
Comment 9 pompex 2015-10-05 01:42:11 UTC
After a slight rewiew of the messages.log file, it looks like there are some path issues.

---------

The exception:

Caused by: java.lang.AssertionError: filename [string size=75+'0']
E:\dev\Projects\svn\CFPOML_DB\source/../../libsql/../libcore/stdafx.h from getStatValue() refers to wrong file:

and the file it points to definately doesn't exists and the path is wrong.

E:\dev\Projects\svn\CFPOML_DB\source/../../libsql/../libcore/stdafx.h

libthecore is at the:

E:\dev\Projects\svn\libthecore\stdafx.h

same to the other static project libraries.

(libcore/libsql and those beggining with "lib" are the static project libraries in Netbeans).
Comment 10 Vladimir Voskresensky 2015-10-05 12:49:58 UTC
Thanks for the helpful information and log file. Looks like show-stopper for 8.1.

Some comments. 
E:\dev\Projects\svn\CFPOML_DB\source/../../libsql/../libcore/stdafx.h
(when collapse ..) becomes
E:\dev\Projects\svn\libcore/stdafx.h
which is OK as path and similar to 
E:\dev\Projects\svn\libcore\stdafx.h

We have to resolve UniqueID consistency on Windows.
Vladimir, please, have a look
Comment 11 pompex 2015-10-05 18:07:38 UTC
According to my #6 comment:

--------- Quote ---------
* ^ when it's finally working, adding a new function to the file header/cpp file results in the same symtomps I described in the bug description, but this time just for this certain function (reparsing doesn't help so far). Also, the function is not being shown in the code auto-completion window,"
--------- /Quote ---------

This is what it looks like when I'm adding a new function in the header file (`void SetOfflineShop[..]` is the new function):

http://i.imgur.com/Y6nDNi5.png

Reparsing can fix the colors only, otherwise everything is still messed up as I said in my comment.

Let me know if you need more informations regarding this.
Comment 12 Quality Engineering 2015-10-06 01:23:29 UTC
Integrated into 'main-silver', will be available in build *201510060002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/370f3478d1fb
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixing #255678 - Code assistance is broken (binaries)
- more info in assert
Comment 13 pompex 2015-10-06 08:32:42 UTC
Unfortunately, it doesn't work in the 201510060002 build either with the same symptoms as before. 

Let me know if I can help you more somehow.
Comment 14 Vladimir Kvashin 2015-10-06 14:14:37 UTC
The below change set should fix AssertionError: filename ... from getStatValue() refers to wrong file

http://hg.netbeans.org/cnd-main/rev/12a1d27974ff
Comment 15 Quality Engineering 2015-10-07 01:25:19 UTC
Integrated into 'main-silver', will be available in build *201510070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/12a1d27974ff
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: corrected getStat() on Windows (fixing #255678 - Code assistance is broken on Windows)
Comment 16 pompex 2015-10-07 09:54:42 UTC
It's a lot better now, navigator is now working correctly.

Unfortunately there are some new issues:

* All of my C++ project are having include directives issues (wasn't happening before) - reparsing can't fix this issue - it's hapenning for the external includes like the stl libraries,

* There are several unresolved identifiers left (might be an issue related to the above - includes) for functions/methods/typedefs, I have wrote a test function:

----------

	void TestFunction() {
		const int16_t testInteger = 1234;
		std::vector<int32_t> testVec;

		testVec.push_back(1);
		testVec.push_back(3);
		testVec.push_back(3);
		testVec.push_back(3);
		testVec.push_back(7);

		// Look for 3
		for (auto it = testVec.begin(); it != testVec.end(); it++) {
			if (*it == 3) {
				std::cout << "Yay I am 3...\n";
			}
		}

		// C++11 functions
		const char* convertMe = "1337";
		printf("Integer: %d\n", std::stoi(convertMe));
		printf("Long: %d\n", std::stoll(convertMe));
		printf("long long: %d\n", std::stoll(convertMe));
	}

----------

This is the result: http://i.imgur.com/2Xz8RJV.png
Comment 17 Alexander Simon 2015-10-08 11:43:11 UTC
fix double project dispose:
http://hg.netbeans.org/cnd-main/rev/219c0f39236e
Comment 18 Quality Engineering 2015-10-09 01:21:48 UTC
Integrated into 'main-silver', will be available in build *201510090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6a353a951d9f
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: fixing #255678 - Code assistance is broken on Windows
- we cleared snapshot after reparse phase, so while file is being parsed user can see only partial model of file
Comment 19 pompex 2015-10-10 08:03:54 UTC
Any progress on fixing the unresolved identifiers? (comment #16)
Comment 20 Vladimir Kvashin 2015-10-12 17:03:27 UTC
(In reply to pompex from comment #19)
> Any progress on fixing the unresolved identifiers? (comment #16)
This should be fixed be recent commits. You can get this fixes in 8.1 RC2 that is to be out shortly (tomorrow, I guess). So I'm closing the bug.

If new issues appear, could you please file a separate bug with the specific description.
Comment 21 ilia 2015-10-13 14:42:11 UTC
Transplanted to release81:
  http://hg.netbeans.org/releases/rev/e959f34522f1 [fixing fixing #255678 - Code assistance is broken on Windows]
  http://hg.netbeans.org/releases/rev/be4eb235e55a [fixing #255678 - Code assistance is broken on Windows]
  http://hg.netbeans.org/releases/rev/516218ee9fac [fixing #255678 - Code assistance is broken on Windows]
  http://hg.netbeans.org/releases/rev/6a755d59df93 [corrected getStat() on Windows (fixing #255678 - Code assistance is broken on Windows)]
  http://hg.netbeans.org/releases/rev/93ec79d4ba94 [fixing #255678 - Code assistance is broken on Windows]
Comment 22 soldatov 2015-10-29 09:41:21 UTC
Verified in NetBeans IDE 8.1 (Build 201510222201)
If someone see problems with code assistance on Windows, new separate bug should be filed.