Finally some progress on my 0.2!

December 3, 2007 by r3ap3r

So I think I’ve finally made some progress on my 0.2 release of the plugin watcher. I have successfully been able to detect the cpu time given to a specific plugin. I had originally asked for help from Roc in IRC and he had pointed me towards a macro called NS_TRY_SAFE_CALL_*.

For the past week, I had taken his information the wrong way. I began looking through the code and I saw that this macro was called a from many differant places in the code. So I decided to try and find out where they were called in the code by using the visual studio debugger and stepping through the code. Now, a combination of both me not understanding exactly what macros are or how to use them, and the fact that the visual studio debugger did nothing except go to the next line when I used the “step in” command, I assumed that this macro was actually setting some kind of flag somewhere, and that the code I was looking for actually followed one of these calls somewhere. So I spent many hours hunting down all the plugin loading code which was a massive web of calls left and right. Finally after another frustrating day of getting nowhere I read up a bit more on macros, and learned that they are actually defined with… well…. a #define. So instead of searching mxr for NS_TRY_SAFE I searched for #define NS_TRY_SAFE and sure enough I came across quite an interesting block of code, and learned that NS_TRY_SAFE_* is actually the exact function that gives the plugins cpu.

So after hitting my head off of a desk for a few minutes, I then looked up an object called PRIntervalTime. Which seems to be an interested object used for finding the amount of time passed between calls. It has a very high resolution and is very cpu friendly. I decided to place this function at the beginning and end of the macro call.

Now there is one small thing I need to look into. The problem is that there are two different macros:
NS_TRY_SAFE_CALL_RETURN
NS_TRY_SAFE_CALL_VOID

What I have gathered so far from my printouts is a few conditions:
Upon testing a flash video on newgrounds and youtube:
a) while the video is loading, NS_TRY_SAFE_CALL_RETURN was called mostly
b) After the video is loaded it seems to call both equally although if I move my mouse on over the video or I do things like drag the browser window around RETURN seems to get called much more

It seems to me like RETURN gets called when the user is causing a possible event on the plugin, and void is called when a plugin is just doing it’s thing. Although because return is also called while a plugin is loading I am not 100% sure how this works because even if I provide no event return is still called.

Anyway, it’s late and time for bed, but it seems to me like I finally have something to work with.

Posting a new bug

December 3, 2007 by r3ap3r

I have located a bug within the build system of firefox. Seems like it would be a fairly common bug but upon searching I was not able to find it posted. It seems that when running: make -f client.mk build after having checked out client.mk and copying your .mozconfig to the mozilla directory, but not checking out all the source itself causes the build system to loop over your .mozconfig over and over without giving the user any idea as to what they actually did wrong. This could be quite confusing for new developers and should be addressed soon.

The bug can be found here.

Cathy’s Contrib

December 3, 2007 by r3ap3r

So as one of my contribs I gave Cathy a hand in testing her 3d web application. I downloaded and installed her extension: Canvas 3D and installed it into my minefield. I attempted to run one of the samples but it did not work. Eventually it was found out that that extension was not turned on by default. So I went into the extension options turned it on and voila it worked. Even the more complex full 3d rendering sample ran fine.

The systems that I tested the extension on were both laptops:
Dell XPS
Geforce 7400 Go 256 mb
2.0Ghz Dual core
1 gig ram
and:
Dell XPS gen 2
2.13 ghz
Geforce 7900 GTX 512mb
2 gig ram

Both system ran the extension just fine.

Fixing a bug in Thunderbird

November 18, 2007 by r3ap3r

So there was a bug in Thunderbird with converter certain string of text into a mailto link. Saying something such as, “Meet me at S@Y…Near the flag pole” would get changed into a mail to link. Using Dave’s hint I took a look at mozTXTtoHTMLconv.cpp I saw that all it does is check if a) there is an @ symbol the string and then b) that there is a ‘.’ following it. I decided that because there are far too many domain names that the code could not check for all possible domains and keep up with new ones. So I introduced the idea that if the ‘.’ is found then there but also not be a ‘..’ in the string. If there is, it does not convert the string to a mailto link. I posted the bug to mozilla landfill, and posted my patch. I got mmullin to take a look at my patch and he approved it. There were no comments, I’m guessing my patch was just THAT good:P My patch is located here: Thunderbird Patch and my bug was posted here: Bug

Considering the huge amount of users that may be fixing bugs at any one time, this system is fairly organized and seems to have the proper systems in place to prevent abuse. It was interesting to fully go through the steps of fixing a bug in Mozilla and I thought this lab was a pretty good learning experience.

FSOSS Reviews

November 10, 2007 by r3ap3r

Facebook Thrift

Facebook Thrift really seems to be a very powerful tool that I would most definitely love to see turn into a type of standard. It was created for allowing easy connectivity between different programming languages. It seems to be really well though out and seems to really make development time faster and all sorts of cross language problems seem to disappear. It generates code that is very similar to the programming languages used and is an easy tool to learn how to use and understand. One thing I thought was pretty cool was how they can use it to simulate millions of clients on the server. How it can serialize all the objects and run through them as though all the users were connected seems like a very powerful tool for big companies to use to make testing and optimizing a much easier tool. I really like that they decided to go the open source route with this tool. Too many companies develop in house tools such as these but they never see the light of day outside of the company and I am sure that eventually with tons of people working on this system, making it better, branching off to make it work for all different types of scenarios, this tool has the potential to grow into something very big and useful and hopefully we will see some cool things happen in the near future.

Miro

The people at Miro see a large problem with today’s centralized video hosts as tv is beginning to move online. They do not agree with these companies forcing themselves between the content and the user. Miro is a cross platform application that gives the user a central platform to access video content from all around the internet. It uses RSS feeds to allow users to subscribe to all sorts of different channels of video. It allows the use of HD video and it also fully supports bit torrent to subscribe to channels and download all sorts of video via bit torrent. I think it is pretty cool that Miro is able to download each of the videos to your hard drive especially since things like youtube don’t necessarily support this. Hopefully as this system catches on, videos that have been removed off the internet will see many copies still existing on peoples hard drives. A downside is I could see this system killing a lot of hard drive space fairly quickly. In my personal opinion I think that Miro still has a lot of work to do. Something about it seems a little off. It just doesn’t feel yet that it’s features are enough that really makes me want to install this software and use it on a daily basis. While some of it’s features are nice, it seems more like a little gimmick that the average user won’t really begin to use all the time enough to see this software grow up to it’s potential. I think it needs better integration with actual tv, it may be a bit before it’s time.

My Thoughts on FSOSS in General

Personally I thought FSOSS was wonderfully put together and organized. It had people that work together all the time across the world come together, face to face, talk to each other, meet new people, and discuss ideas and what they’ve been working on. The amount of conferences that took place was very high and for each hour I found no problem finding a conference that would interest me. This FSOSS really showed me how important open source is to our world today. Tons of people coming together and trying to solve problems for everyone, without charging them an arm and a leg to do it. All these people are very passionate about what they do, they care about their projects and it really shows in their work. The ability to have many people working on projects, and getting input from all around the world definitely helps software be successful.

Personal Highlight
My personal highlight of the event was the free lunch:P Joking, well somewhat…:P But really, my personal highlight was seeing the real world of open source in action. Seeing how the people work together, their motives behind what they do and I just thought the whole event really opened my eyes to all sorts of new and exciting technologies as well as new and exciting ideas about software in general.

Modifying the Browser Lab (Extension Version)

November 9, 2007 by r3ap3r

The steps to creating and extension like this do not seem very difficult. The concepts of how the folders layout and where everything goes seems pretty straight forward. Where I had a problem though was it certainly seems a lot more difficult to write an extension vs injecting code into the tree. It seems like you need to create a lot of work arounds and the overall code is a lot more difficult to figure out where you place it and what functions you should use then it is when just changing the source code. Also you need to rely on the fact that the code you are trying to change has these “hooks” otherwise editing the code seems almost impossible through an extension. Seems kind of silly to me but I’m sure there must be very good reasons for why the system is the way it is. Personally I think extensions should somehow have the ability to to possibly run a sort of “patch” on the build and a “remove patch” when the extension is turned off. I’m guessing unless the user has the source on their computer this is practically impossible, but it certainly would make things much nicer.

Finally up and running again

November 9, 2007 by r3ap3r

Recently I have been running into a very weird problem where my only computer, a top of the line XPS, decided that it no longer enjoyed building Firefox.  Hunting around IRC the best response that I could find was that I needed to obtain a new computer. This seems to be a very serious bug, that has been affecting numerous machines and nobody seems to know why, the best solution seriously does seem to be to get a new computer. So I did, my school so generously provided me with a new lightweight XPS and I have a dual boot of Linux and Windows, with all build working perfectly. A shout out to anyone that can give me any kind of information as to what could be causing this bug, I’m sure a number of people would like to know the answer.

0.1 Release of Leaky Plugin

November 3, 2007 by r3ap3r

So we finally completed our 0.1 release and it certainly proved a little more confusing then we had anticipated.

Our first job was to get a plug in up and running that would leak memory. There were a number of different plug in toolkits that we were able to find as part of the Mozilla source but we ended up running into many problems with each of them. Such as, only running in Linux, not compiling, not loading with our minefield etc. Finally we were able to get our leaky plug in working and instructions on how to use it can be found here.

Modifying the Browser Lab

October 22, 2007 by r3ap3r

In class we have been giving the assignment to modify Minefield so that tabs open to the right of the current working tab. Here’s my experience in completing this assignment.We did a number of searches through MXR for code that opened a new tab and were led through a number of functions until we found that the main tab loading code happened inside of tabbrowser.xml. It seemed that as a new tab needed to be opened the function this.mTabContainer.appendChild(t); was called. Upon further inspection we found that there was also an InsertBefore(); function. My first thought here was that there must also be an InsertAfter() function and I could call InsertAfter() on the current window. Much to my surprise this function does not exist.

At this point we hit a bit of a roadblock until I realized, well we have an append function and an insertBefore function so I decided to try my luck with the following :
if (this.mCurrentTab._tPos == this.mTabContainer.childNodes.length-1){
this.mTabContainer.appendChild(t);
}
else{
this.mTabContainer.insertBefore(t, this.mTabContainer.childNodes[this.mCurrentTab._tPos+1]);
}

At first glance, it seemed that this code worked! However we were disapointed to find that now these newly opened windows did not respond to their close event and clicking the “x” did nothing. Back to the drawing board.

So we looked a bit further and saw that these opened tabs needed to be registered to an event. It all seemed very confusing but eventually I realized that the variable “position” seemed to be used to registering the events of newly opened tabs. However this is where I got stuck, I managed to make some progress by adding position into my if statement, like so:
var position;
if (this.mCurrentTab._tPos == this.mTabContainer.childNodes.length-1){
this.mTabContainer.appendChild(t);
position = this.mCurrentTab._tPos+1;
}
else{
this.mTabContainer.insertBefore(t, this.mTabContainer.childNodes[this.mCurrentTab._tPos+1]);
position = this.mCurrentTab._tPos+1;
}

This did seem to help, it seems many times the close event does get called, but under all sorts of random tests of opening and closing all sorts of tabs the “x” sometimes began closing the wrong tab, or firing an error in the console. I tried many differant combinations of how to set position with no 100% luck. At this point I’ve decided to move on and maybe someone could look at the posted patch file and let me know where I’ve gone wrong. Thanks! Patch File

Running into a problem…

October 10, 2007 by r3ap3r

I have been fevourously looking for a way to make a plugin that leaks memory as a helper for my plugin watcher. I cannot find any information on making a plugin anywhere! People have been telling me time and time again the plugins are NOT the same thing as extensions, yet everywhere I search for how to make a basic plugin I am getting pointed to how to make extensions! I am really confused, could someone please shed some light on this for me?