Wednesday, September 30, 2009

Hudson: Memory Leaks and Other Issues

Continuation of earlier post at http://triviaatwork.blogspot.com/2009/09/hudson-too-has-problems-subversion.html


Out of Memory
The memory usage of Hudson build system rose to 800MB or so after I left it to run for a couple of weeks. Some component seems to be causing leaks. There have been earlier complaints about memory leaks in Hudson, for example, http://www.nabble.com/hudson-memory-leak-td23221034.html but not sure whether these issues were confirmed and/or solved. As per Hudson "Memory Leak Document" at http://wiki.hudson-ci.org/display/HUDSON/I%27m+getting+OutOfMemoryError, I have restarted JVM with the suggested option of "-XX:+HeapDumpOnOutOfMemoryError". I am not running Hudson under distributed build. It is possible that some plugin is eating the memory.

Doxygen Plugin
With doxygen plugin I get:

FATAL: error

hudson.AbortException: The directory 'C:\Users\g0700201\.hudson\jobs\\workspace\docs\doxygen_html' doesn't exist.

        at hudson.plugins.doxygen.DoxygenDirectoryParser.retrieveDoxygenDirectoryFromDoxyfile(DoxygenDirectoryParser.java:278)

CCCC Plugin


I dont know how anybody ever got this plugin to work. Will cccc I get:

Parsing cccc results

hudson.AbortException: Parsing file error

        at com.thalesgroup.hudson.plugins.cccc.CccccParser.invoke(CccccParser.java:76)

        at com.thalesgroup.hudson.plugins.cccc.CccccParser.invoke(CccccParser.java:50)

Saturday, September 19, 2009

Using Thunderbird within NUS / Setting up LDAP

One of the difficult-to-use functionalities of Thunderbird (popular with Linux/Ubuntu users) seems to be the LDAP address book. The reasons for this unfriendliness may be diverse (one of them usually is MS likes to define its own standards). I tried setting up the LDAP using several combinations like the below copied from NUS Computer Center site:
  • Choose Add Dir.
  • For ldap-server, enter ldapstf.nus.edu.sg (for staff address book) or ldapstu.nus.edu.sg (for student address book)
  • For search-base, enter DC=stf,DC=nus,DC=edu,Dc=sg (for staff address book) or DC=stf,DC=nus,DC=edu,Dc=sg (for student address book) Set use-implicitly-from-compose and Pine will lookup names you type in the To: line while composing messages in the directory. If there are multiple names that match you will be prompted to select from a list of matching entries.
Believe me I tried a lot of different combinations but I could not succeed (at the time of writing). Finally the following getaround satisfactorily worked for me:

I had setup thunderbird with IMAP. I installed the add-on "Email Address Crawler" https://addons.mozilla.org/en-US/thunderbird/addon/9995 which crawls all mails and reads addresses into the address book. Then I ran the crawler on my Inbox and Sent Mail. This was enough for all the email addresses I usually use.

I also checked the option: "Preferences > Composition > Addressing >  Automatically Add Outgoing Email Addresses to My: ".

Monday, September 14, 2009

Hudson Too Has Problems (Subversion Update Mode)

Check out the updates below as well.

I was wishing that hudson would not have many bugs, as its GUI is quite sleek. But turns out it is not so. I'm facing a curious problem: although I've set to "svn update", hudson always tries to delete the workspace at the end of the build, and always fails. This problem has been reported before here: https://hudson.dev.java.net/issues/show_bug.cgi?id=86&historysort=new.

The bug report says the issue is already fixed, but I am facing the same problem even now. It may be triggered because I am using "local directory" option to check out svn code into a particular subdirectory in the workspace (then it is an another bug).

On a side note: The fix of the above bug report is scary -- just a "/" can cause such a mess -- this probably means the code is not too well written; that's why I'm facing a similar bug.

Update:  Sept 22, 2009
I am quite happy with hudson so far, although I had trouble here and there. In summary I face the following troubles currently:
  1. Hudson deletes the svn checked out code (using CMakebuilder), even when "use svn update" is marked. To work around, I've reverted to clean build, and reduced the frequency of checkout. Update: It turns out the problem was due to CMakebuilder plugin, which cleaned up the directory, not hudson.
  2. I'm not sure how to use Hudson CMakebuilder plugin on windows. To work around, I modified the shell script provided at http://schneide.wordpress.com/2009/04/07/cmake-builder-plugin-for-hudson/. Then Hudson complained that it can't execute sh, so I installed cygwin and appended its bin directory into my PATH environment variable. I don't have time to try cmakebuilder again after installing cygwin, but that might also work fine. I believe that the CMakebuilder plugin has created more problems for me than it solved. It needs to be rewritten. I will try to do it next week. 
  3. I can't install Hudson as a Windows Service through the dashboard. I'm getting AccessDenied error as below, even though the current user has Admin privileges.

    WMI.WmiException: AccessDenied
    at WMI.WmiRoot.BaseHandler.CheckError(ManagementBaseObject result)
       at WMI.WmiRoot.ClassHandler.Invoke(Object proxy, MethodInfo method, Object[] args)
       at WMI.Win32ServicesProxy.Create(String , String , String , ServiceType , ErrorControl , StartMode , Boolean , String[] )
       at winsw.WrapperService.Run(String[] args)
       at winsw.WrapperService.Main(String[] args)

But overall Hudson has worked for me quite well, and with almost no hassle.

Sunday, September 13, 2009

Installing CDash

The cmake guys have the CDash tool for producing test reports. It is difficult to find comprehensive information about the details of installing CDash (on the same lines, it is difficult to find information about using CMake).Here I am dealing with CDash 1.4.2. I did the following:

Warning: Read Conclusion at the end of this post now.


* download Apache and PHP  as described at http://public.kitware.com/Wiki/CDash:Installation. Make sure you enable the PHP modules as listed on the Kitware link.
* configure PHP and Apache as described at "Configuring PHP" and
"Running PHP 5 as an Apache Module" respectively on this page: http://www.thesitewizard.com/php/install-php-5-apache-windows.shtml
* Download CDash and copy to apache htdocs directory (remove the CDash version number if any)
*Create cdash/config.local.php as on the Kitware link.
* Now I tried to open http://localhost/CDash/login.php in my web browser. This returned "Fatal error: Allowed memory size of 134217728 bytes exhausted" at line 180 of config.local.php. Reading this file revealed that the file recursively included itself. So I commented out the lines as follows:

//$localConfig = dirname(__FILE__).'/config.local.php';
//if ( file_exists($localConfig) )
//  {
//  include($localConfig);
//  }

After this change, the url opened file. The only remaining thing now is to set up the database.
* I installed MySQL as at Kitware link. During installation I set an administrator account called 'root'. I use this account to login into MySQL. Then I run:

mysql> create database cdash;
mysql> create user 'cdash'@'localhost' identified by 'passwd';
mysql> grant all privileges on cdash.* to 'cdash'@'localhost' with grant option;

I make the corresponding changes in cdash/config.local.php to set the:

// Hostname of the database server
$CDASH_DB_HOST = 'localhost';
// Login for database access
$CDASH_DB_LOGIN = 'cdash';
// Password for database access
$CDASH_DB_PASS = 'passwd';
// Name of the database
$CDASH_DB_NAME = 'cdash';
// Database type (empty means mysql)
$CDASH_DB_TYPE = 'mysql';

There were errors even now, as I tried to register a new user. Then I tried to open http://localhost/CDash/install.php -- this indicated:

Database Type:mysql
Database Hostname:mysql
Database Login:cdash
Database Name:cdash

Admin Email: __________
Admin Password: ______

This is different from what I wanted -- I wanted the Database hostname to be "localhost". I could not figure out how CDash set it to mysql (I think this is a bug; which does not augur well for CDash. Probably it has a lot of bugs). Anyway, I proceeded with creating an Admin by filling Email and Password. This worked.

There is still some problem with opening http://localhost/CDash/index.php. This just shows some php script -- so the PHP script is probably malformed.

Conclusion: I think it would be too much effort to work with CDash as even installation is so tedious. I'll move to using Hudson for now, which from my limited previous experience was rather user-friendly.