[Nut-upsdev] upsd segfault.

Kjell Claesson kjell.claesson at epost.tidanet.se
Mon Dec 22 00:28:25 UTC 2008


Den Sunday 21 December 2008 22.57.14 skrev Arjen de Korte:
> Citeren Charles Lepple <clepple at gmail.com>:
Hi Arjen,
> >> This is strange. I have no debugging info but i built it with -g , but
> >> it would
> >> not give me anything but ??:0 as output. So i built it with -gstabs, and
> >> guess what.... it does not segfault.
> >
I was to fast about this. Made some more tests and guess what.

If I start the upsd when the ups is on, I can set it in standby and start
it up without segfault. Tested this several times and no segfault. 

But if I start the upsd when it is in standby, then it segfault when i go to
online. Don't care if I compiled with -gstabs. And it does it every time.

The only thing I can think of is that it is sending a alarm when i start
the upsd in standby.
-----------------
ups.alarm: LOAD_DUMPED
ups.firmware: Cont:02.03 Inve:02.03
ups.load:   0.0
ups.model: PW5125     1000VA
ups.power.nominal: 1000
ups.serial: GB282A0427
ups.status: ALARM OFF
-----------------
When online it dont set the alram line
-----------
output.voltage.nominal: 230
ups.firmware: Cont:02.03 Inve:02.03
ups.load:   0.0
ups.model: PW5125     1000VA
ups.power.nominal: 1000
ups.serial: GB282A0427
ups.status: OL
----------------------

> > Well, it sort of sounds like it might be related to the compiler -
> > using a different debugging option shouldn't change how the code is
> > generated, unless it isn't optimizing as much with -gstabs.
>
This falls as stated above.

> Another thing to try is to run it through valgrind. This works best if
> you switch of optimization ('-O0', which should be read as -O<zero>),
> but usually will also give usable info with optimized code ('-O2' or
> even 'O3') as well.

Can't get the debug symbols in. Looks like it don't care about the -g or 
-gstabs on the flag line. I can see that it use it during compile. But
when I test for symbols (nm or valgrind) it say no symbols.
Think I have to build some more with debug flag.

Then I can not get it to run with valgrind. It exits. Any howto on this
would be nice.

Switched over to my PW5115 and it is the same. If it is in standby when
I start upsd, it segfault when i go to online. But if I start upsd when it is
online. I can switch it off and on whitout segfault.

So normaly you don't notice this as it have to be online if it supports the 
computer running NUT. But if you have one more ups that is in standby
and is connected to the NUT server and you put it online after the server is
started it would segfault the upsd.

Regards
/Kjell




More information about the Nut-upsdev mailing list