From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/127 Path: news.gmane.org!not-for-mail From: Solar Designer Newsgroups: gmane.linux.lib.musl.general Subject: cluts review Date: Wed, 13 Jul 2011 15:07:23 +0400 Message-ID: <20110713110723.GA22153@openwall.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1310555254 3411 80.91.229.12 (13 Jul 2011 11:07:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2011 11:07:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-211-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jul 13 13:07:30 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QgxHt-0005FF-6Q for gllmg-musl@lo.gmane.org; Wed, 13 Jul 2011 13:07:29 +0200 Original-Received: (qmail 23576 invoked by uid 550); 13 Jul 2011 11:07:27 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 23567 invoked from network); 13 Jul 2011 11:07:27 -0000 Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Xref: news.gmane.org gmane.linux.lib.musl.general:127 Archived-At: Hi Luka, Rich - I've just experimented with cluts a bit. I'll start by posting a patch containing only changes that I had to make for cluts to build (without fixing any warnings, etc. - there are still lots of them). The uses of SA_NODEFER appeared to be a bug anyway, so I am simply removing them. -std=c99 appears to be needed to get LLONG_MAX, etc. defined by glibc's header files when compiling with older gcc (I used 3.4.5). As it is, this patch is a hack. I think that extensive cleanups to the code being patched are needed. I have other observations as well (such as from actually running the tests), which I hope to post separately. diff -urp cluts.orig/cluts.c cluts/cluts.c --- cluts.orig/cluts.c 2011-07-09 11:26:23 +0000 +++ cluts/cluts.c 2011-07-13 10:13:29 +0000 @@ -1,3 +1,4 @@ +#define _BSD_SOURCE /* for scandir() and alphasort() */ #include #include #include @@ -5,6 +6,7 @@ #include #include #include +#include /* for PATH_MAX */ /* * Copyright (c) 2011 Luka Marčetić diff -urp cluts.orig/makefile cluts/makefile --- cluts.orig/makefile 2011-07-09 11:26:23 +0000 +++ cluts/makefile 2011-07-13 10:08:29 +0000 @@ -7,7 +7,7 @@ # There's ABSOLUTELY NO WARRANTY, express or implied. # -CFLAGS = -O2 -Wall -Wextra +CFLAGS = -std=c99 -O2 -Wall -Wextra LIBS = -lpthread -lrt -lm SRC = $(wildcard tests/*.c) $(wildcard *.c) BIN = $(SRC:.c=) diff -urp cluts.orig/tests/alloc.c cluts/tests/alloc.c --- cluts.orig/tests/alloc.c 2011-07-09 11:26:23 +0000 +++ cluts/tests/alloc.c 2011-07-13 10:09:50 +0000 @@ -1,3 +1,4 @@ +#define _XOPEN_SOURCE /* for sigaction() */ #include #include #include @@ -57,7 +58,7 @@ int main() sem_t sem; ///< semaphore is used for thread mutex act.sa_handler = bridge_sig_jmp; - act.sa_flags = SA_NODEFER; + act.sa_flags = 0; sigaction(SIGSEGV, &act, &oldact[0]); //make a head element for the ring-queue which will hold info about blocks: @@ -230,7 +231,7 @@ int safe_free(void *vp, char *err_msg) { struct sigaction oldact, act; act.sa_handler = bridge_sig_jmp; - act.sa_flags = SA_NODEFER; + act.sa_flags = 0; sigaction(SIGABRT, &act, &oldact); if (!setjmp(env[1])) diff -urp cluts.orig/tests/string.c cluts/tests/string.c --- cluts.orig/tests/string.c 2011-07-09 11:26:23 +0000 +++ cluts/tests/string.c 2011-07-13 10:10:25 +0000 @@ -1,3 +1,4 @@ +#define _XOPEN_SOURCE #include #include #include @@ -54,7 +55,7 @@ int main() //call bridge_sig_jmp on segmentation fault: act.sa_handler=bridge_sig_jmp; - act.sa_flags=SA_NODEFER; + act.sa_flags=0; sigaction(SIGSEGV, &act, &oldact); for (i=0; i