Re: [Apcupsd-users] FATAL ERROR in smart.c at line 213
Brought to you by:
adk0212
From: Andrey S. <ash...@gm...> - 2009-03-03 09:49:17
|
There is one more hotfix patch that solves unclean termination issue. It prevents exit on signal 11 and core dumps in some circumstances. P.S. Now I'm using apcupsd-3.14.5, that was built with debug symbols included and trying to catch as more bugs as possible. 2009/3/3 Adam Kropelin <akr...@ro...>: > Committed, thanks! > > ----- Original Message ----- > From: "Andrey Sharandakov" <ash...@gm...> > To: "Apcupsd Discussion List" <apc...@li...> > Sent: Sunday, March 01, 2009 6:53 PM > Subject: Re: [Apcupsd-users] FATAL ERROR in smart.c at line 213 > > > Finally I have fixed it and test it. No core dumps, works 100%. > > 2009/3/1 Andrey Sharandakov <ash...@gm...>: >> 2009/3/1 Adam Kropelin <akr...@ro...>: >>> From: "Andrey Sharandakov" <ash...@gm...> >>>> FreeBSD 7.1-RELEASE-p3 i386 SMP >>>> apcupsd 3.14.5 (compiled only with apcsmart support) >>>> >>>> Sometimes on exiting (after receiving signal 15) there is an error: >>>> >>>> apcupsd FATAL ERROR in smart.c at line 213 >>>> Select error on UPS FD. Bad file descriptor >>>> >>>> The reason of this issue is that ups->fd is already "closed" by >>>> apcsmart_ups_close in smartsetup.c. >>>> >>>> I have supplied quick fix patch to avoid those annoying error messages >>> >>> Thanks for the patch. I've applied a slightly modified version of it, >>> shown >>> below. Could you test and verify that this version also works for you? >> >> Unfortunately after testing I have found out that both my and your >> patches resulted in core dump >> (termination on signal 11, segmentation fault). You should rollback >> changes. I'm trying to fix it in quite another way. >> This issue is much more complicated as I expected before. >> >>> >>>> but I think that this issue should be solved in quite another way. >>>> >>>> I think that apcupsd exit should be handled by getline function in >>>> smart.c. >>> >>> We definitely need to do better in our termination sequence. It is rife >>> with >>> bugs and races currently. I'll tackle this in apcupsd-3.15.x since the >>> overall architecture will be changing quite a lot. >> >> When 3.15 will be available? >> >>> >>> --Adam >>> >>> >>> diff -u -r1.27.2.2 smart.c >>> --- smart.c 10 Feb 2009 23:39:29 -0000 1.27.2.2 >>> +++ smart.c 1 Mar 2009 14:53:35 -0000 >>> @@ -209,9 +209,10 @@ >>> case -1: >>> if (errno == EINTR || errno == EAGAIN) { /* assume SIGCHLD >>> */ >>> continue; >>> + } else if (ups->driver_internal_data) { >>> + Error_abort1("Select error on UPS FD. %s\n", strerror(errno)); >>> } >>> - Error_abort1("Select error on UPS FD. %s\n", strerror(errno)); >>> - break; >>> + return FAILURE; /* We're probably shutting down */ >>> default: >>> break; >>> } >>> >>> >>> ------------------------------------------------------------------------------ >>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >>> CA >>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>> Enterprise >>> -Strategies to boost innovation and cut costs with open source >>> participation >>> -Receive a $600 discount off the registration fee with the source code: >>> SFAD >>> http://p.sf.net/sfu/XcvMzF8H >>> _______________________________________________ >>> Apcupsd-users mailing list >>> Apc...@li... >>> https://lists.sourceforge.net/lists/listinfo/apcupsd-users >>> >> > > > > -------------------------------------------------------------------------------- > > >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H > > > -------------------------------------------------------------------------------- > > >> _______________________________________________ >> Apcupsd-users mailing list >> Apc...@li... >> https://lists.sourceforge.net/lists/listinfo/apcupsd-users >> > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Apcupsd-users mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apcupsd-users > |