Xymon Mailing List Archive search

Getting hobbit running on FreeBSD

4 messages in this thread

list Brian Scott · Thu, 1 Sep 2005 15:05:04 +1000 ·
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.
**********************************************************************
list Henrik Størner · Thu, 1 Sep 2005 07:40:28 +0200 ·
Hi Brian,
quoted from Brian Scott

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.
quoted from Brian Scott
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
list Brian Scott · Thu, 1 Sep 2005 16:30:50 +1000 ·
quoted from Henrik Størner
 
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 ?

Ability to read. My umask by default doesn't give anything to 'others'
by default so the web server can't read the files. A way of doing this
(without making everything universally readable) is to have it set up
as:

drwxr-x---  8 hobbit  www     512 Sep  1 14:00 server

This way hobbit can change things and the web server can read them.

I guess I'm just a bit paranoid about security and like my restrictive
umask.

Thanks again.

Brian
quoted from Brian Scott
**********************************************************************
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.
**********************************************************************
list Laurent Grilli · Thu, 1 Sep 2005 12:14:20 +0200 ·
We are using hobbit for a while on FreeBSD (from the beta to the latest
4.1.1), we never encountered this problem. We are running two hobbits
servers on 5.4 stable. Do you get a core as soon as you start it ? 

What version of hobbit have you tried to install ? On the client side, we
needed to modify the hobbit client (already reported on this list) to be
able to check memory bigger than 2 gb and to avoid to report disk problem
with devfs at 100%

Laurent
quoted from Brian Scott

-----Original Message-----
From: Scott, Brian [mailto:user-df7f2d901ba1@xymon.invalid] 
Sent: Thursday, September 01, 2005 7:05 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] 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.
**********************************************************************


The information contained in this transmission may contain privileged and
confidential information.  It is intended only for the use of the
person(s) named above. If you are not the intended recipient, you are
hereby notified that any review, dissemination, distribution or
duplication of this communication is strictly prohibited. If you are not
the intended recipient, please contact the sender by reply email and
destroy all copies of the original message. This communication is from TI
Automotive.