Bug 101872 - [DOM AST - Bindings] Lots of NPE and CCE exceptions in parser/binding code when indexing Mozilla project
Summary: [DOM AST - Bindings] Lots of NPE and CCE exceptions in parser/binding code wh...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-parser (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0   Edit
Assignee: Devin Steffler CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 100248 102764
Blocks:
  Show dependency tree
 
Reported: 2005-06-27 10:48 EDT by Victor Lenet CLA
Modified: 2007-05-29 14:28 EDT (History)
5 users (show)

See Also:


Attachments
zipped build log (247.75 KB, application/x-zip-compressed)
2005-06-27 11:53 EDT, Victor Lenet CLA
no flags Details
Summary of results when indexing Mozilla on Windows (797 bytes, text/plain)
2005-06-28 11:17 EDT, Devin Steffler CLA
no flags Details
List of the missing #includes that have Problem Markers on them. (17.75 KB, text/plain)
2005-06-28 11:18 EDT, Devin Steffler CLA
no flags Details
Brief info about the NPE and CCE found. (1.99 KB, text/plain)
2005-06-28 11:23 EDT, Devin Steffler CLA
no flags Details
changes Vlad made to my workspace to discover #includes in Windows (1.29 KB, patch)
2005-06-28 16:48 EDT, Devin Steffler CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Lenet CLA 2005-06-27 10:48:47 EDT
There are lots of NPE and CCE exceptions in parser and bindings code when
indexing Mozilla project.

Precondition:
Before indexing with Full indexer, get per file scanner info discovered for the
project.
Comment 1 John Camelon CLA 2005-06-27 11:04:33 EDT
Thanks Vlad.
Devin, pls investigate.  Call Andrew or I in if you need any help.
Comment 2 Devin Steffler CLA 2005-06-27 11:10:08 EDT
Can you attach your build log or email me a copy for working with this PR?
Comment 3 Devin Steffler CLA 2005-06-27 11:16:17 EDT
I also just want to make sure that we're using the same code base.  I'm 
assuming that you're using the Mozilla 1.7.5 (suite) found:
http://www.mozilla.org/download-mozilla.html

specifically:
http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla1.7.5/source/mozi
lla-source-1.7.5.tar.gz

Let me know if this is incorrect.
Comment 4 Victor Lenet CLA 2005-06-27 11:53:54 EDT
Created attachment 24038 [details]
zipped build log

I built mozilla on my Linux box and then substituted home directory paths with
local project path (on Windows). I suggest you to do the same.

The source version is the same as the one you are using.
Comment 5 Devin Steffler CLA 2005-06-27 14:36:24 EDT
I got the #Includes discovered fine in Linux (and that's what I'm working with 
now) although I can't get them to be discovered in Windows using the same steps.

Linux path: /home/dsteffle/mozilla-1_7_5/mozilla
Windows path: /cygdrive/c/mozilla-1_7_5/mozilla

In your build output I replaced /cygdrive/d/vmir/Project/CDT/samples/mozilla 
with the paths above.

Steps taken to discover #Includes:
1- create new Standard Make C++ Project pointing the to mozilla source path 
(above)
-> turn indexer off for now to make things faster
-> turn on per file scanner info
2- in Properties->C/C++ Make Project->Discovery Options, Browse... for the text 
file containing the build output
3- click Load and wait for it to finish (seems to do some things, but does not 
add any #Includes in Windows, in Linux #Includes are picked up around 70%)
4- click Apply
5- click OK

I tried this with your build output and my build output as well with no luck in 
Windows.  I even tried changing the path to things like /c/mozilla-
1_7_5/mozilla, C:\mozilla-1_7_5\mozilla, etc but I can't get them to work.
Comment 6 Devin Steffler CLA 2005-06-27 16:50:52 EDT
Vlad did some magic on my workspace to get the #Includes discovered in Windows 
and it's running well now... although it looks like the NPE/CCE are caused by 
different reasons in Windows.

It's also interesting to note that in Linux the Index started with ~13000 files 
and Windows started at ~11000 files or so.  Right now Linux is at 27% with 9646 
files left to index while Windows is at 12% with 8970 files left to Index.
Comment 7 John Camelon CLA 2005-06-27 21:19:26 EDT
Is said "magic" something that a user could do? :-)

We need to identify hangs/Out Of Memory cases so pls let me know if there are
particular files that break.
Comment 8 Devin Steffler CLA 2005-06-28 08:43:59 EDT
I don't know exactly what Vlad did but I was under the impression that he was 
going to commit those changes last night.

There seemed to be a hang with discovery when the Automatically Build Project 
setting was turned on.
Comment 9 John Camelon CLA 2005-06-28 09:51:03 EDT
Vlad : If there is a fix, there should be a bug describing the problem.
Comment 10 Devin Steffler CLA 2005-06-28 11:17:36 EDT
Created attachment 24087 [details]
Summary of results when indexing Mozilla on Windows

Here's the summary of my results.
Comment 11 Devin Steffler CLA 2005-06-28 11:18:28 EDT
Created attachment 24088 [details]
List of the missing #includes that have Problem Markers on them.
Comment 12 Devin Steffler CLA 2005-06-28 11:23:19 EDT
Created attachment 24089 [details]
Brief info about the NPE and CCE found.

Note that the exceptions in Linux are different and occur more frequently when
indexing mozilla.  My Linux machine isn't done indexing yet as it is a much
slower machine.
Comment 13 John Camelon CLA 2005-06-28 11:26:31 EDT
Thanks Devin, this is very informative.  
I'd be interested in seeing how fast a non-debug run of mozilla takes on Windows.
Comment 14 Devin Steffler CLA 2005-06-28 11:30:06 EDT
Note that Bog says the index count seems really low.  This is probably because 
mozilla isn't built on my Windows machine.  On my Linux machine mozilla is 
built and it creates a lot of source code in the object directory when it 
builds the project.  I noticed that Linux indexes ~13000 files while Windows 
only indexes ~10000 files.
Comment 15 Devin Steffler CLA 2005-06-28 13:50:36 EDT
It took 23 minutes to index Mozilla on my Windows machine with a non-debug run.
Comment 16 Doug Schaefer CLA 2005-06-28 14:02:46 EDT
How many files were actually indexed?
Comment 17 Devin Steffler CLA 2005-06-28 14:26:56 EDT
The count started at around 10300 files on the Windows machine.  I'm assuming 
that only files that get indexed are added to that count (shown in the Progress 
Monitor).

If there are files in that count that don't actually get indexed then how can I 
found out how many files got indexed?
Comment 18 Doug Schaefer CLA 2005-06-28 14:33:52 EDT
Remember we don't index files that don't have build info but they are included
in the big count. I think the 150,000 index entries is almost 1/10th of what you
should be getting for all of mozilla. But I could be wrong. Bogdan is figure out
how to provide the count.
Comment 19 Devin Steffler CLA 2005-06-28 15:24:01 EDT
There are 32,670 INFO problem markers with "File not indexed because it was not 
built".  The progress monitor showed that there were 10,300 files being indexed.
Comment 20 Bogdan Gheorghe CLA 2005-06-28 15:47:46 EDT
OK, I added the indexed file count to the info dialog. Bring up the Indexer View
+ click on the "i" to see the number of indexed files.
Comment 21 Devin Steffler CLA 2005-06-28 16:11:22 EDT
Comparison:

Windows:
P4 Hyperthreading 3.0Ghz
1.5 GB RAM
-Xmx512M
non-debug run time: 23 minutes
IEntry Results: 156,397
Total Indexed Files: 4,584
Initial Index Count: ~10,300
INFO Problem Markers (File not indexed): 32,670
Note: Mozilla project not built on Windows machine (missing object directory)

Linux:
P4 2.0Ghz
512 MB RAM
-Xmx350M
non-debug run time: ~2 hours
IEntry Results: 268,668
Total Indexed Files: 5,659
Initial Index Count: ~13,000
INFO Problem Markers (File not indexed): 8,615
Note: Mozilla project built on Linux machine (contains object directory)
Comment 22 Andrew Niefer CLA 2005-06-28 16:45:27 EDT
I have fixed some class cast exceptions in:
CFunction::updateParameterBindings
CVisitor::createBinding (~ line 843)
CPPSemantics::getTargetType

there are still more I'm sure
Comment 23 Devin Steffler CLA 2005-06-28 16:48:23 EDT
Created attachment 24112 [details]
changes Vlad made to my workspace to discover #includes in Windows

Vlad- can you explain what this patch does?

This is the changes that Vlad made to my workspace to get Windows to discover
paths.	I also had to make sure that the "automatically build workspace"
setting is turned off (Window->Preferences->Workspace uncheck Build
automatically).
Comment 24 Victor Lenet CLA 2005-06-28 17:14:17 EDT
Comment on attachment 24112 [details]
changes Vlad made to my workspace to discover #includes in Windows

The patch is obsolete. The fix for 102015 solved the problem.
Comment 25 John Camelon CLA 2005-07-04 10:27:16 EDT
Andrew, what of the exceptions have you fixed, you haven't updated this defect 
but I know you've been working on it.  

Can we cleanup the list and perhaps individually PR what remains so we can
target them for RC candidates?
Comment 26 Devin Steffler CLA 2005-07-11 11:30:04 EDT
There are currently no CCE or NPE when indexing Mozilla in Windows and Linux.  
Marking this as fixed.