Getting hobbit running on FreeBSD
Hello all, I've just had a try at installing hobbit on various versions (5.3, 5.4) of FreeBSD. I was getting segvs whenever hobbitd started. After a little work with gdb I found that allocating some buffers was based on hostcount when hostcount was zero. I presume that on some other platforms a zero sized malloc returns some useful amount of memory but not on FreeBSD (it claims to return some storage rather than NULL depending on /etc/malloc.conf but apparently not enough). I patched hobbitd.c to increase the size (without bothering to look at the code in any detail) and now it doesn't segv on me. I hope this helps someone else trying to make it run. BTW: I also had to change the group of most of the installation to my web server group after installation. I possibly could have created the hobbit user in the web group to get arround this but somehow it seems tacky. Thanks for the nice software, Brian --- hobbit-4.1.1.orig/hobbitd/hobbitd.c Tue Jul 26 00:55:43 2005 +++ hobbit-4.1.1/hobbitd/hobbitd.c Thu Sep 1 13:18:04 2005 @@ -2122,7 +2122,7 @@ if (lastboardsize == 0) { /* A guesstimate - 8 tests per hosts, 1KB/test (only 1st line of msg) */ - bufsz = hostcount*8*1024; + bufsz = (hostcount+1)*8*1024; } else { /* Add 10% to the last size we used */ @@ -2274,7 +2274,7 @@ if (lastboardsize == 0) { /* A guesstimate - 8 tests per hosts, 2KB/test (only 1st line of msg) */ - bufsz = hostcount*8*2048; + bufsz = (hostcount+1)*8*2048; } else { /* Add 10% to the last size we used */ ********************************************************************** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. **********************************************************************
Hi Brian,
On Thu, Sep 01, 2005 at 03:05:04PM +1000, Scott, Brian wrote:
I've just had a try at installing hobbit on various versions (5.3, 5.4) of FreeBSD. I was getting segvs whenever hobbitd started. After a little work with gdb I found that allocating some buffers was based on hostcount when hostcount was zero. I presume that on some other platforms a zero sized malloc returns some useful amount of memory but not on FreeBSD (it claims to return some storage rather than NULL depending on /etc/malloc.conf but apparently not enough).
Thanks! Doing a "malloc(0)" is apparently undefined behaviour, so it should be avoided, and your solution is a reasonable way of doing that.
Someone else reported problems with Hobbit on OpenBSD - it could be that this is the same problem.
BTW: I also had to change the group of most of the installation to my web server group after installation.
That should not be needed - the only directories that need to be writable by the web server group are the "www/rep" and "www/snap" directories used when generating reports. What problems did you have that necessitated this ?
Regards, Henrik
participants (2)
-
Brian.Scott@det.nsw.edu.au
-
henrik@hswn.dk