From owner-freebsd-threads@FreeBSD.ORG Mon Jul 5 11:07:05 2010 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E94DB1065672 for ; Mon, 5 Jul 2010 11:07:04 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D7C0A8FC14 for ; Mon, 5 Jul 2010 11:07:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o65B74V3079346 for ; Mon, 5 Jul 2010 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o65B74tr079344 for freebsd-threads@FreeBSD.org; Mon, 5 Jul 2010 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 5 Jul 2010 11:07:04 GMT Message-Id: <201007051107.o65B74tr079344@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-threads@FreeBSD.org X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2010 11:07:05 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o threa/141721 threads rtprio(1): (id|rt)prio priority resets when new thread o threa/141198 threads [libc] src/lib/libc/stdio does not properly initialize o threa/136345 threads Recursive read rwlocks in thread A cause deadlock with o threa/135673 threads databases/mysql50-server - MySQL query lock-ups on 7.2 o threa/133734 threads 32 bit libthr failing pthread_create() o threa/128922 threads threads hang with xorg running o threa/127225 threads bug in lib/libthr/thread/thr_init.c o threa/122923 threads 'nice' does not prevent background process from steali o threa/121336 threads lang/neko threading ok on UP, broken on SMP (FreeBSD 7 f threa/118715 threads kse problem o threa/116668 threads can no longer use jdk15 with libthr on -stable SMP o threa/116181 threads /dev/io-related io access permissions are not propagat o threa/115211 threads pthread_atfork misbehaves in initial thread o threa/110636 threads [request] gdb(1): using gdb with multi thread applicat o threa/110306 threads apache 2.0 segmentation violation when calling gethost o threa/103975 threads Implicit loading/unloading of libpthread.so may crash o threa/101323 threads [patch] fork(2) in threaded programs broken. s threa/100815 threads FBSD 5.5 broke nanosleep in libc_r s threa/94467 threads send(), sendto() and sendmsg() are not correct in libc s threa/84483 threads problems with devel/nspr and -lc_r on 4.x o threa/80992 threads abort() sometimes not caught by gdb depending on threa o threa/79887 threads [patch] freopen() isn't thread-safe o threa/79683 threads svctcp_create() fails if multiple threads call at the s threa/76694 threads fork cause hang in dup()/close() function in child (-l s threa/76690 threads fork hang in child for -lc_r f threa/72953 threads fork() unblocks blocked signals w/o PTHREAD_SCOPE_SYST s threa/69020 threads pthreads library leaks _gc_mutex s threa/49087 threads Signals lost in programs linked with libc_r s threa/48856 threads Setting SIGCHLD to SIG_IGN still leaves zombies under s threa/40671 threads pthread_cancel doesn't remove thread from condition qu s threa/39922 threads [threads] [patch] Threaded applications executed with s threa/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwrite() need wra s threa/34536 threads accept() blocks other threads s threa/32295 threads [libc_r] [patch] pthread(3) dont dequeue signals s threa/30464 threads pthread mutex attributes -- pshared s threa/24632 threads libc_r delicate deviation from libc in handling SIGCHL s threa/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVTIMEO socket o 37 problems total. From owner-freebsd-threads@FreeBSD.ORG Wed Jul 7 15:43:31 2010 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B645B106564A for ; Wed, 7 Jul 2010 15:43:31 +0000 (UTC) (envelope-from Vikash.Badal@is.co.za) Received: from morpheus.is.co.za (morpheus.is.co.za [196.35.45.229]) by mx1.freebsd.org (Postfix) with ESMTP id AD3BC8FC1B for ; Wed, 7 Jul 2010 15:43:30 +0000 (UTC) Received: from morpheus.is.co.za (localhost.is.co.za [127.0.0.1]) by morpheus.is.co.za (Postfix) with ESMTP id 5AE19F21FF for ; Wed, 7 Jul 2010 17:26:40 +0200 (SAST) Received: from rs-beta.mfw.is.co.za (rs-beta.mfw.is.co.za [196.26.2.114]) by morpheus.is.co.za (Postfix) with ESMTP id C490AF219C for ; Wed, 7 Jul 2010 17:26:39 +0200 (SAST) Received: from root by rs-beta.mfw.is.co.za with local (Exim 4.71) (envelope-from ) id 1OWWVr-000MdA-66 for freebsd-threads@freebsd.org; Wed, 07 Jul 2010 17:26:15 +0200 Received: from exim by rs-beta.mfw.is.co.za with split (Exim 4.71) (envelope-from ) id 1OWWVk-000Mcm-3a for freebsd-threads@freebsd.org; Wed, 07 Jul 2010 17:26:08 +0200 Received: from [196.26.2.110] (helo=ZABRYSVISMFW3) by rs-beta.mfw.is.co.za with esmtp (Exim 4.71) (envelope-from ) id 1OWWVk-000Mcj-2d for freebsd-threads@freebsd.org; Wed, 07 Jul 2010 17:26:08 +0200 Received: from zabrysvisexhub2.af.didata.local (Not Verified[10.1.8.39]) by ZABRYSVISMFW3 with MailMarshal (v6,7,2,8378) id ; Wed, 07 Jul 2010 17:26:28 +0200 Received: from ZABRYSVISEXMBX1.af.didata.local ([fe80::914a:a14c:13c1:d279]) by zabrysvisexhub2.af.didata.local ([fe80::486:fd5b:97f4:6b92%10]) with mapi; Wed, 7 Jul 2010 17:26:50 +0200 From: Vikash Badal To: "freebsd-threads@freebsd.org" Date: Wed, 7 Jul 2010 17:26:27 +0200 Thread-Topic: syslog strangeness on freebsd 8.0 and 8.1-RC when using threads Thread-Index: AcscVUwUgFjM35LBSLueGudXz3ZdTgBk2TYQ Message-ID: <9B425C841283E0418B1825D40CBCFA613D9E525940@ZABRYSVISEXMBX1.af.didata.local> Accept-Language: en-US, en-ZA Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-ZA Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Recipient-Count: 1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: syslog strangeness on freebsd 8.0 and 8.1-RC when using threads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jul 2010 15:43:31 -0000 Can someone please assist me with some strangeness on FreeBSD 8.0 and 8.1= -RC2 using a threaded test code code, I see the that freebsd 8.x seems to be u= sing more memory when using the syslog() call from a c program: Results: 7.2 without syslog =20 PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMA= ND 26872 vikashb 1001 8 0 128M 14236K RUN 0:00 0.00% a.out with syslog =20 PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMA= ND 26881 vikashb 1001 44 0 128M 26236K RUN 0:00 0.00% a.out 8.0-RELEASE-p3 without syslog =20 PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMA= ND 61529 vikashb 1001 44 0 129M 14840K RUN 0:01 0.00% a.out with syslog =20 PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMA= ND 61507 vikashb 1001 44 0 257M 42708K RUN 0:30 0.00% a.out 8.1-RC2 without syslog =20 PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMA= ND 33062 vikashb 1001 44 0 129M 14804K RUN 0:00 0.00% a.out with syslog =20 PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMA= ND 33056 vikashb 1001 44 0 257M 42708K RUN 0:03 0.00% a.out I have not been able to find any reasonable information via google. Why does syslog result in more memory being consumed on 8.x as opposed to= =207.2 ? #include #include #include #include #include #include #include #include #include char *ProgramName =3D "WTF"; int loop =3D 0; int LogToSTDOUT =3D 1; void LogMessage(int debug, const char *fmt,...) { =20 extern int LogToSTDOUT; =20 char message[8192]; =20 memset(message, 0, sizeof(message)); =20 va_list args; =20 va_start(args, fmt); =20 vsnprintf(message, sizeof(message), fmt, args); =20 va_end(args); =20 if ( LogToSTDOUT ) =20 { =20 printf("%s\n", message); =20 } =20 syslog(LOG_NOTICE, "%s", message); } unsigned long int getTimeNow() { =20 struct timeval tv; =20 if ( gettimeofday(&tv, NULL) =3D=3D -1 ) =20 { =20 LogMessage(0, "ERROR(%d) %s\n", errno, strerror(errno)); =20 tv.tv_sec =3D 0; =20 } =20 return tv.tv_sec; } void HandleSignal(int sig) { =20 loop =3D 0; =20 LogMessage(0, "loop =3D %d\n", loop); =20 signal(sig, SIG_IGN); =20 usleep(1000); } void *worker(int n) { =20 while ( loop ) =20 { =20 LogMessage(0, "worker #%d logging", n); =20 usleep(1000); =20 } =20 pthread_exit(0); } int main(int argc, char* argv[]) { =20 pthread_t* tpool; =20 int workers =3D 1000, i, rc; =20 openlog(ProgramName, LOG_PID, LOG_MAIL); =20 unsigned long int duration =3D 120, StartTime, TimeNow; =20 signal(SIGINT, HandleSignal); =20 signal(SIGTERM, HandleSignal); =20 signal(SIGHUP, HandleSignal); =20 signal(SIGQUIT, HandleSignal); =20 StartTime =3D getTimeNow(); =20 tpool =3D (pthread_t*)malloc(workers * sizeof(pthread_t)); =20 if ( tpool =3D=3D NULL ) =20 { =20 LogMessage(0, "malloc failed \n"); =20 closelog(); =20 exit(-1); =20 } =20 memset(tpool, 0, sizeof(pthread_t) * workers); =20 loop =3D 1; =20 for ( i =3D 0; i < workers; i++ ) =20 { =20 rc =3D pthread_create(&tpool[i], NULL, (void *(*)(void*))&worker,= =20(void*)i); =20 if ( rc !=3D 0 ) =20 { =20 LogMessage(0, "pthread_create #%d failed\n", i ); =20 pthread_cancel(tpool[i]); =20 } =20 else =20 { =20 pthread_detach(tpool[i]); =20 } =20 } =20 LogMessage(0, "loop =3D %d\n", loop); =20 while ( loop ) =20 { =20 TimeNow =3D getTimeNow(); =20 if ( ( TimeNow - StartTime ) > duration ) =20 { =20 loop =3D 0; =20 } =20 usleep(1000); =20 } =20 for ( i =3D 0; i < workers; i++ ) =20 { =20 pthread_cancel(tpool[i]); =20 } =20 for ( i =3D 0; i < workers; i++ ) =20 { =20 pthread_join(tpool[i], NULL); =20 } =20 free(tpool); =20 closelog(); =20 exit(0); } Please note: This email and its content are subject to the disclaimer as = displayed at the following link http://www.is.co.za/legal/E-mail+Confiden= tiality+Notice+and+Disclaimer.htm. Should you not have Web access, send a= =20mail to disclaimers@is.co.za and a copy will be emailed to you. _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" Please note: This email and its content are subject to the disclaimer as = displayed at the following link http://www.is.co.za/legal/E-mail+Confiden= tiality+Notice+and+Disclaimer.htm. Should you not have Web access, send a= =20mail to disclaimers@is.co.za and a copy will be emailed to you.