Tuesday, September 30, 2008

Failed to Reproduce Bugs

I commented the lines in the makefiles as suggested by Ted in his comment about my Successful PGO build. I rebuilt and ran firefox but it would not crash. I browsed some sites, added bookmarks, and made changes to the bookmarks but it would not crash.

I checked the makefiles created in the objdir and they show that the lines that I commented were indeed commented.

I have read some bugs in bugzilla and have not found anything on a specific bug or how to reproduce a specific bug on Windows.

More research is needed.

Friday, September 26, 2008

Successful PGO Build

On IRC a few folks pointed out that I should be using Visual Studio 2005 instead of Visual Studio 2008 for the PGO build of Firefox and it worked.

The error that indicated the problem is probably with Visual Studio 2008 is posted here under Firefox Compilation Errors ( Sept 26th, 2008 ).

Next steps are to duplicate the bugs or crashes experienced from other users using PGO builds of Firefox.

Compiling with VS 2005

I was talking on irc in the #developers channel and it was suggested I try building my profile build using Visual Studio 2005 instead of with Visual Studio 2008. I'm also using the Vista SDK which might be causing a problem. Might.

Real Error
The folks on irc asked to look at the errors I received so I used pastebin to show the error and they felt that the actual error was not listed and wanted to see the lines before the error I posted. Well I had used redirection for stdout and stderr to 2 files and it turns out that some of the errors were going to stdout. As I looked through my output.txt file I noticed a huge section that was about linker errors. This is when they suggested I try using Visual Studio 2005 after I mentioned I had it.

The Error

e:\mozilla\trunk\modules\lcms\src\cmscgats.c(875) : fatal error C1001: An internal error has occurred in the compiler.
(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c[0x511953E5:0x00000008]', line 182)
To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage

Version 9.00.21022.08

ExceptionCode = C0000005
ExceptionFlags = 00000000
ExceptionAddress = 511953E5 (51030000) "e:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\c2.dll"
NumberParameters = 00000002
ExceptionInformation[ 0] = 00000000
ExceptionInformation[ 1] = 00000008

CONTEXT:
Eax = 00000000 Esp = 0012ED18
Ebx = 02D5D215 Ebp = 0012ED2C
Ecx = 02D96601 Esi = 02D5D280
Edx = 02DAAE12 Edi = 00000305
Eip = 511953E5 EFlags = 00010246
SegCs = 0000001B SegDs = 00000023
SegSs = 00000023 SegEs = 00000023
SegFs = 0000003B SegGs = 00000000
Dr0 = 00000000 Dr3 = 00000000
Dr1 = 00000000 Dr6 = 00000000
Dr2 = 00000000 Dr7 = 00000000


Mozilla Community
I like how helpful the Mozilla community is and as a student that is not an avid irc user I forget about the culture and community. I had logged out and switched OS's so I could compile with Visual Studio 2005 and when I jumped back on irc it was about 30 minutes later. I had messaged one of the guys to let them know I was now compiling and he/she didn't seem to remember me. He/she was probably busy and I need to learn how to better discern what is relevant and what is not.

And I cannot worry about making such mistakes. Better to fall and learn then to never jump.

Close but no Cigar

As suggested by Ted, in a comment, I built Firefox with disable debug and tests. I was able to open and close Firefox without any assertions during the profiling, since they were not compiled, but it still failed to compile the optimized build.

After talking to a few guys in the #seneca channel on irc://moznet.org I decided to ask on #developers channel for any help. Unfortunately when I asked it was getting late and the channel was pretty quiet. I plan on asking again to get some help since I cannot really go forward without help compiling or debugging the cryptic errors I'm getting.

Thursday, September 25, 2008

Mozilla Source - Looking for Find in This Page...

The Search
Chinmay and I decided to look for how "Find in This Page...", on a Mac it is just "Find", works.
Searching mxr.mozilla.org for "Find in This Page..." found only a test xml file, strangely enough. So we looked for "Edit".

We found a DTD file that had a label and a accesskey for Find, the entity was called findcmd. A search on findcmd found a XUL file for the overlay of the Edit Menu. The overlay XUL file had an element for findcmd entity and a command attribute with the value of key_find. The key_find is a key element in the same XUL file. Its command attribute is cmd_find.

A search for cmd_find found a findbar.xml file. The cmd_find is associated with a method called onFindCommand. This method calls startFind method. The startFind method calls the open command which generates the findbar at the bottom of the screen. In the startFind method after the bar has been opened it then populates the text box with any selected text and enables the findbar buttons if any text is in the textbox.

That is how we found the "Find in This Page..." code.

Tuesday, September 23, 2008

PGO Build Problems

Failed to Build
Last night I worked on creating a profile build of Firefox. From the comment on this bug suggest others were able to successfully to build Firefox using pgo, unfortunately I am having issues.

Initial Build Successful
I was able to complete the initial profile build of Firefox. This build adds extra instructions to Firefox to watch for: the functions that are used the most, which branches of if/else or switches get hit the most and anything else that can be used to optimize the build. The data collected gets stored in files. To gather the data, the client.mk file runs a script after the initial build to run scenario's to gather the data.

Errors and Crashes
The script I used only opened the browser. I tried to go to a website but an assertion was triggered. I chose to retry which brought me into debug mode so I chose to continue and the browser closed. The make file proceeded to compile the optimized build using the profile data but failed with errors. I tried the process again but this time I closed the browser after it opened and an assertion was triggered on closure and the optimized build failed again.

Output and Help
I have posted the build output here. I'm going to look at some newsgroups to find out if my experience is expected since others have created successful pgo builds. I might need to disable more features to be able to create a successful build. More research is needed.

Saturday, September 20, 2008

Microsoft's PGO really improved my Program

My project for OSD is to investigate bugs and crashes in Firefox when it has been built using profile guided optimizations.

Working with PGO
I am unfamiliar with pgo's so I decided to use it on one of my old class assignments. First a program is built to include extra code to monitor the activity in the program and spit out a file with possible optimizations. To best optimize the program, the program should be run through multiple scenario's to generate more files with optimizations for the program. Then all the optimizations are to be merged into the program to created an optimized build. Of course there are many options to choose what to optimize and what optimizations should be merged.

The Optimize Program
I choose to test my assignment from my course Data Structures and Algorithymes.

The excerpt below is from my Project Page.

The program loads 15,000 random records from a text file into 4 tables each using a different method for storage and searching.
  1. Simple Table: Uses an array and a linear search.
  2. Chain Table: Uses an array of link lists. Search is done with a Hash Key.
  3. Hash Table: Uses an array and searches with linear probing. Also uses a Hash Key.
  4. Tree Table: Uses a binary search tree.
After the data is loaded into a table, 30 different tests are run against it. The same 30 tests for each table. Here are the Results.

Non-PGO PGO Improved By
Simple Table: 28 Secs 4 Secs 7x
Chain Table: 0.109 Secs 0.047 Secs 2.3x
Hash Table: 0.141 Secs 0.047 Secs 2.3x
Tree Table: 0.287 Secs 0.078 Secs 3.6x



I'm very impressed with the results. I tried to look at the files to see if I could determine what it decided on optimizing but of course it is in some machine language I don't understand. Probably references to memory locations and such.

So I'm still not sure how to tackle my project. I think I'll mess around with the PGO settings and other optimizations. I can also do this from the command line with I might try. I'll need to talk to ted on IRC or someone about how to compile with pgo and debugging it.

Thursday, September 18, 2008

Firefox Lab

I built firefox yestarday ( Sept 17th ) and created my FireFox build page today. I didn't understand the directions for making my build page so I called it Firefox build and then realized I should call it cbishop Firefox build and created a new page. Now I can't figure out how to delete Firefox build page and tried to move it to cbishop Firefox build page 2. I'm gonna get kicked off the wiki if I keep this up. HAHA!

The build went pretty smooth for me. I wrote down the steps I took to build FireFox on Windows XP with Visual Studio 2008 compiler. I haven't gone through the steps to verify if they are complete. I'll do that soon.

Class

I have been spending a lot of time just writing up on my progress. I spent two hours this evening doing up my Firefox build page and updating all the necessary pages. I think I'll have to cut back on the detail because I cannot keep this up with all my other classes and projects that I have on the go.

I am a little surprised at the lack of direction in the Open Source class. I did expect a little more hand holding. Today we went over how to build Firefox which was good but I feel there needs to be a little more help with getting started.

What I would have like to have seen was jumping into compiling Firefox in the first week or two with information focused on how to get around Mozilla and find information and documentation then how to reach the community through IRC.

But that's just my two cents.

Tuesday, September 16, 2008

Moz Dev Days - Not what I expected

Mozilla Developer Day - Tuesday

On Tuesday I was at the second day of the Mozilla Developer Day and it was not what I had expected. After looking at the schedule I had assumed that I would be shown, taught and walked-through how to create addons using XUL in the XUL add-on workshop. Now, I have never been to a conference or to a workshop at a conference. I probably should not have had any expectations but I did. What ended up happening was more of a free-for-all. The people in the group expressed what they were interested in and the Mozilla Guys tried to work with each person to help them progress in these areas. This was not what I had expected but I enjoyed the approach.

What Happened in the Workshop

I was interested in learning about XUL and how to use it to create an application. Mark Finkle explained how to get started on the creating a bare bones application in XUL. More importantly he explained where to find information on how to get started cause that's half the battle.

Getting Started with XULRunner


Meeting with Ted Mielczarek

My project for OSD ( Open Source Development ) course is looking at the bugs found during the PGO ( profile guided optimization ) builds. Ted was fun to talk to and with in five minutes gave me some direction to start with. I will start with building Firefox on my Windows computer and then add the profile guided optimizations and then we'll go from there. After meeting and talking with Ted I feel better about tackling this project.

The Mozilla Guys

I really enjoyed have the Mozilla guys at Seneca. It was great having so many knowledgable and experienced developers in one room. The main thing I noticed was how down to earth the guys are. I don't know the really cool technology they are developing and at no time did I feel as if they were talking over my head. I would definitely go to another conference with these guys.

Friday, September 12, 2008

Added Preview to the Directions Command

I was able to add a preview of the directions map from Google in the preview pane for ubiquity. I wanted to add some more customization to the preview pane to pretty it up but I was having difficulties.

I'm still don't understand the flow of control or changing of scoping in JavaScript. Or I do understand but I forget and get lost inside the whirlwind of event handlers, callbacks and anonymous functions.

The ubiquity channel on irc has been very helpful. I suggest poking your head in there if you need any assistance with ubiquity.

Discovery Channel Commercial

My wife and I just love this Commercial.

http://www.youtube.com/watch?v=V5BxymuiAxQ

Now that is good Branding. I know that it is the Discovery Channel when that song enters my head randomly.

Thursday, September 11, 2008

Ubiquity Bug Ticket Submitted

So today I submitted my first ticket for a bug I found in Ubiquity.

I was trying to add an iframe to the preview pane in Ubiquity but it would stall or crash ubiquity. The error doesn't happen right away all the time but eventually it does happen. A restart of Firefox fixes the problem.

Problem Code

CmdUtils.CreateCommand({
name: "testIframe",
takes: {"word": noun_arb_text},
execute: function(directObj) {
},
preview: function( pblock, directObj )
{


var iframe = pblock.ownerDocument.createElement("iframe");
iframe.setAttribute("src","http://www.jslint.com");
pblock.innerHTML = "";
pblock.appendChild(iframe);
}

})
When I discovered this bug I jumped on the ubiquity channel on irc and started asking if this should be submitted as a ticket. Two people tried my code saw the problem and agreed that it should be posted as a ticket.

It was nice to have some one agree that it should be a ticket since I'm new to the process and didn't want to submit a ticket that should be submitted.

Exciting new ground for me.

Wednesday, September 10, 2008

Ubiquity To the Rescue!!!

I am a computer person and I like short-cuts. I am not a command line freak that just loves typing commands instead I prefer pointing and clicking. I'm lazy. I do the lazy thing. I'll never love VI. Not true, one day our eyes will meet and it will be love but not while my mouse is so fuzzy and warm.

Ubiquity helps combine my love of pointing and clicking with command typing. I enjoy the define function. Double click a word then ctrl+space ( on Windows ) and we have that word's definition.

I liked the map command but I really wanted to be able to put in multiple addresses and get the directions to those addresses. So I created one. It can be found on my Projects Page on the Seneca Wiki.

The command does not give a preview map. I might spend some time trying to ratify that. I would like to add some window dressing to the preview section also. Pretty it up some.

I have a few ideas on how to implement a pasteBin command. In the preview page add a textbox or editable field that the user can paste code into and a button to convert to a pasteBin url. I might give it a whirl.

Back to drowning in the sea of code.......

Monday, September 8, 2008

Project Candidates

After reading the potential projects list on the Seneca wiki I chose 4 candidates for my Open Source Development project.

  1. gdb Symbol Server Support
    Adding support for gdb to grab symbols from a server. Mozilla points out in a bug thread that it has no plans on fixing this. It also points out that this would be a great student project.
  2. Profile the Build System
    The building of Firefox on Windows takes longer than on Linux or Mac. This project would be profiling the performance of the build to determine performance problems.
  3. Mercurial History Browsing
    To create nice graphical interface for the changes made to the software.
  4. Research PGO Related Bugs
    Mozilla is using profile guided optimizations on Windows but some of the builds have bugs. This project would find and fix some or all of these bugs.

I'm excited about these projects and cannot wait to finally pick one and get working. If anyone in ODS600/DPS909 would like to partner up on one of these projects you can post here.

Wednesday, September 3, 2008

Open Source

The essay by Eric Raymond "Cathedral and Bazaar" and the movie "Revolution OS" are quite interesting. I didn't realize that people are willing to work hard and passionately for software that they will never see a dime from.

I don't believe that we would be under the rule of Microsoft right now if was not for Richard Stallman creating the GNU license or Linus Torvalds for creating Linux. Some one, some where would of realized the same things and created such a license or Operating System.

I do agree that how software is being made has changed. No longer is it a small team working hard to release poorly documented and tested software but people from all around the world working together to develop, patch, and release well documented and tested software.

I'm excited to see where this community will take us or how it will evolve.

Tuesday, September 2, 2008

Test

This should not appear on planet seneca.

First post!

Hi! I am Chris Bishop and I am a CPA Student with Seneca College in North York. This is my first personal blog. I currently am blogging on a site for a project I am working on. www.c3dl.org, this project is about creating a library in JavaScript to support the native OpenGL calls in the Firefox browser.

I am excited to be in the Open Source Development class and cannot wait to see what project I will be tackling.