OpenCSW Bug Tracker


Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005216 [apcupsd] regular use minor always 2014-11-14 22:06 2014-12-02 11:46
Reporter zdima View Status public  
Assigned To laurent
Priority normal Resolution fixed  
Status resolved  
Summary 0005216: apctest dump core
Description While running apctest it is dumping a core.

Configuration:
# uname -a
SunOS freenas 5.11 omnios-10b9c79 i86pc i386 i86pc

# pkginfo -l SUNWlibusb | grep VER
   VERSION: 11.11.0,REV=2013.03.05.02.28

# grep -v "^#" /etc/opt/csw/apcupsd/apcupsd.conf | grep -v "^$"
UPSNAME UPS
UPSCABLE usb
UPSTYPE usb
DEVICE
LOCKFILE /var/spool/locks
SCRIPTDIR /etc/opt/csw/apcupsd
PWRFAILDIR /etc
NOLOGINDIR /etc
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 0
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 127.0.0.1
NISPORT 3551
EVENTSFILE /var/opt/csw/apcupsd/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/opt/csw/apcupsd/apcupsd.status
LOGSTATS off
DATATIME 0

# /opt/csw/sbin/apctest


2014-11-14 16:01:24 apctest 3.14.12 (29 March 2014) sun
Checking configuration ...
sharenet.type = Network & ShareUPS Disabled
cable.type = USB Cable
mode.type = USB UPS Driver
Setting up the port ...
Doing prep_device() ...

You are using a USB cable type, so I'm entering USB test mode
Hello, this is the apcupsd Cable Test program.
This part of apctest is for testing USB UPSes.

Getting UPS capabilities...Segmentation Fault (core dumped)

Additional Information
Tags No tags attached.
Attached Files ? file icon apctest.out [^] (16,351 bytes) 2014-11-18 02:05

- Relationships
has duplicate 0005217closedlaurent apctest dump core 

-  Notes
(0010961)
laurent (manager)
2014-11-16 01:00

I can reproduce, I don't remember seeing this before, it's probably a relatively recent regression.
I've posted it to upstream's M/L.
(0010962)
laurent (manager)
2014-11-16 23:32

Upstream has pointed out that it is an incorrect use of apctest in the first place: it should be run with apcupsd *not* running.

The crash is a failure, though. They provided a patch that fixes it, displays a proper error message instead. I'll try to push an updated package this week.
(0010963)
zdima (reporter)
2014-11-17 00:43

I have checked and the daemon was not in memory.
When I start the daemon (not sure if it actually able to detect UPS), the apctest report error and exit (see below).
I suspect that there is an issue with configuration and this is where it is crashing.

# ./apctest


2014-11-16 18:39:04 apctest 3.14.12 (29 March 2014) sun
Checking configuration ...
sharenet.type = Network & ShareUPS Disabled
cable.type = USB Cable
mode.type = USB UPS Driver
apctest FATAL ERROR in apctest.c at line 335
Unable to create UPS lock file.
  If apcupsd or apctest is already running,
  please stop it and run this program again.
apctest error termination completed
(0010964)
laurent (manager)
2014-11-17 10:21

Can you send the output of:
ps -edf | grep apc
ls -l /var/spool/locks
(0010965)
laurent (manager)
2014-11-17 12:57

Also, I just pushed an updated package that includes the fix proposed by upstream, could you upgrade and test it?
(0010967)
laurent (manager)
2014-11-17 22:42

Ah, let's not forget:
truss apctest >& /tmp/apctest.out

and attach the file please.
(0010968)
zdima (reporter)
2014-11-18 02:03

Laurent, I am new to OpenCSW. How do i update CSWapcupsd from upstream?
(0010969)
zdima (reporter)
2014-11-18 02:03

root@freenas:/opt/csw/sbin# ps -ef| grep apc
    root 28741 27542 0 20:02:37 pts/1 0:00 grep apc
root@freenas:/opt/csw/sbin# ls -l /var/spool/locks
total 4
-rw-r--r-- 1 root root 11 Nov 17 19:34 LCK..
-rw-r--r-- 1 root root 5 Nov 16 18:45 netatalk
(0010970)
laurent (manager)
2014-11-18 09:38

Run pkgutil -UC, it will show you that an updated apcupsd is available, then run pkgutil -u
(0010972)
zdima (reporter)
2014-11-18 12:55

# /opt/csw/bin/pkgutil -UC=> Fetching new catalog and descriptions (http://mirror.opencsw.org/opencsw/testing/i386/5.11) [^] if available ...
==> 3614 packages loaded from /var/opt/csw/pkgutil/catalog.mirror.opencsw.org_opencsw_testing_i386_5.11
package installed catalog
# /opt/csw/bin/pkgutil -u
Looking for packages that can be upgraded ...
Solving needed dependencies ...
Solving dependency order ...

Nothing to do.
# /opt/csw/bin/pkgutil -l
CSWapcupsd
CSWcas-initsmf
CSWcas-migrateconf
CSWcas-preserveconf
CSWcommon
CSWggettext-data
CSWiconv
CSWlibcharset1
CSWlibiconv2
CSWlibintl8
CSWlibncurses5
CSWlibwrap1
CSWpkgutil
CSWterminfo
CSWvim
CSWvimrt


Do I have to edit configuration file to specify from where to fetch catalog and packages?
(0010973)
laurent (manager)
2014-11-18 13:55

Yes, the update is pushed to "unstable", so you have to point there to get it.
(0010978)
zdima (reporter)
2014-11-20 14:02

The apctest is not crashing anymore.
However, it is reporting error:
Checking source i found that more useful debug messages are at much higher value and run with -d 500.
The information that lead to understanding is:
libusbugen.so.1: libusb_init() returned 0
plugin rev is 1
wrapper rev is 1
winfo.ploaded is 1
completed usb init()
usb_bus ptr = 0x80ce548
busp is 0x80ce548
0.001 apcupsd: generic-usb.c:416 Found 1 USB busses
0.025 apcupsd: generic-usb.c:418 Found 4 USB devices
0.025 apcupsd: generic-usb.c:429 /dev/usb:4f2.111/0 - 04f2:0111
0.025 apcupsd: generic-usb.c:304 Not an APC device.
0.025 apcupsd: generic-usb.c:429 /dev/usb:764.501/0 - 0764:0501
0.025 apcupsd: generic-usb.c:304 Not an APC device.

My UPS is known as /dev/usb:764.501/0 - 0764:0501, and it is not considered as known UPS.
This is CyberPower Intelligent LCD CP1000AVRLCD.

I think we can close this ticket.
One suggestion is to print in apctest output a proper reason for a failure if possible.

Thanks for all your help.
(0010985)
laurent (manager)
2014-12-01 09:42

There's definitely a bug: after boot, even though the daemon is properly started without error, the lock files is absent. Restarting the service, they're present.
So there's something wrong with the service start process, maybe a conflict with some other. I have to investigate.
(0010986)
laurent (manager)
2014-12-02 11:46

The lock file was moved to /var/run by default, since it appears it's simply not working as it was supposed to, and not used by anything else than apcupsd.
Locking of the devices is handled by other means than this, except for apctest.

An update package has been pushed.
MB: The change will NOT be done automatically on existing installations, the LOCKFILE value must be modified manually in /etc/opt/csw/apcupsd/apcupsd.conf


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker