cmogstored dev/user discussion/issues/patches/etc
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] cmogstored 1.4.3 - mostly non-GNU/Linux fixups
  @ 2015-03-09 23:02  4% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-03-09 23:02 UTC (permalink / raw)
  To: cmogstored-public, mogile

For all platforms, the startup device scanning thread at startup
may not handle EINTR properly.  This bug only manifested at
startup and does not affect running instances.  However, this
bug is also readily apparent on newer versions of FreeBSD
which support the ppoll function call.

Thanks to Mykola Golub <trociny@FreeBSD.org> for the bug report
which led to this release.

For systems lacking epoll_pwait (older GNU/Linux, all *BSDs),
there is also a bugfix for systems which experience signal spam
leading to errno clobbering in the main thread.  This bug was
only noticed due to a bug report against Ruby:

  https://bugs.ruby-lang.org/issues/10866

There is no need to upgrade if 1.4.1 is already running well
on modern GNU/Linux systems capable of epoll_pwait.  But then
again nginx-style SIGUSR2 upgrades are transparent to clients.

shortlog since 1.4.2:

      Makefile.am: fix publish rule for website
      Fix assertion failure during startup
      avoid relying on ppoll as a cancellation point
      preserve errno when inside sig handler for self-pipe

http://bogomips.org/cmogstored/files/cmogstored-1.4.3.tar.gz
SHA-1 b06b62f9c17a4e082920b57c4036233df80a8601

* homepage: http://bogomips.org/cmogstored/README
* git clone git://bogomips.org/cmogstored.git
* cgit: http://bogomips.org/cmogstored.git
* gitweb: http://repo.or.cz/w/cmogstored.git
* list: cmogstored-public@bogomips.org (subscription optional)
* archives: http://bogomips.org/cmogstored-public/

^ permalink raw reply	[relevance 4%]

* [PATCH 2/2] avoid relying on ppoll as a cancellation point
  @ 2015-03-09 20:49  7%   ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2015-03-09 20:49 UTC (permalink / raw)
  To: cmogstored-public

While glibc supports ppoll, ppoll is not standardized and
apparently is not a cancellation point in some versions FreeBSD
based on Mykola Golub's bug report.

Reported-by: Mykola Golub <trociny@FreeBSD.org>
ref: <20150309151851.GC2195@gmail.com>
---
 sig.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/sig.c b/sig.c
index cfbffc2..7e1c200 100644
--- a/sig.c
+++ b/sig.c
@@ -27,27 +27,14 @@ void mog_intr_enable(void)
 	CHECK(int, 0, pthread_sigmask(SIG_SETMASK, &mog_emptyset, NULL));
 }
 
-/*
- * favor ppoll if available since this is our only pselect user and
- * would increase the size of the executable
- */
-#ifdef HAVE_PPOLL
-static int sleeper(struct timespec *tsp, const sigset_t *sigmask)
-{
-	int err = 0;
-
-	if (ppoll(NULL, 0, tsp, sigmask) < 0) {
-		err = errno;
-		assert((err == EINTR || err == ENOMEM) &&
-		       "BUG in ppoll usage");
-	}
-	return err;
-}
-#else /* PSELECT */
 static int sleeper(struct timespec *tsp, const sigset_t *sigmask)
 {
 	int err = 0;
 
+	/*
+	 * pselect is a cancellation point,
+	 * ppoll is not POSIX and is only a cancellation point on glibc.
+	 */
 	if (pselect(0, NULL, NULL, NULL, tsp, sigmask) < 0) {
 		err = errno;
 		assert((err == EINTR || err == ENOMEM) &&
@@ -55,7 +42,6 @@ static int sleeper(struct timespec *tsp, const sigset_t *sigmask)
 	}
 	return err;
 }
-#endif /* PSELECT */
 
 /* thread-safe, interruptible sleep, negative seconds -> sleep forever */
 int mog_sleep(long seconds)
-- 
EW


^ permalink raw reply related	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-03-06  2:37     [ANN] cmogstored 1.4.2 - log unlink failures Eric Wong
2015-03-09 23:02  4% ` [ANN] cmogstored 1.4.3 - mostly non-GNU/Linux fixups Eric Wong
2015-03-09 20:35     FreeBSD: sleeper using ppoll does not sleep forever Eric Wong
2015-03-09 20:49     ` [PATCH 1/2] Fix assertion failure during startup Eric Wong
2015-03-09 20:49  7%   ` [PATCH 2/2] avoid relying on ppoll as a cancellation point Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/cmogstored.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).