From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6848 Path: news.gmane.org!not-for-mail From: Sebastian Gottschall Newsgroups: gmane.linux.lib.musl.general Subject: Re: pthreads broken (freeradius testcase) Date: Fri, 16 Jan 2015 01:11:36 +0100 Message-ID: <54B85738.1040503@dd-wrt.com> References: <54B844B4.1000500@dd-wrt.com> <20150115231037.GT4574@brightrain.aerifal.cx> <20150115234218.GU4574@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------030700020505030005080309" X-Trace: ger.gmane.org 1421367116 20533 80.91.229.3 (16 Jan 2015 00:11:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2015 00:11:56 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6861-gllmg-musl=m.gmane.org@lists.openwall.com Fri Jan 16 01:11:52 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YBuW0-0007vG-9T for gllmg-musl@m.gmane.org; Fri, 16 Jan 2015 01:11:52 +0100 Original-Received: (qmail 13457 invoked by uid 550); 16 Jan 2015 00:11:50 -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 13438 invoked from network); 16 Jan 2015 00:11:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dd-wrt.com; s=mikd; h=Subject:Content-Type:In-Reply-To:References:To:MIME-Version:From:Date:Message-ID; bh=EoLYjccStOkGNx18hRKsytgv0cAUMOfT5MJNo7tjdNE=; b=cbsAtP+HNNGG6uudZGYbSgl9xZbPlXmTG1yMbzAjJrVELwz5kBTw53489SrrQoQq2kOHN6DdS7obFk3D4HADC8yKZvf/nBRLU3lGebTTCDKfaTpItdtfOqVPUzJL6pMTtt3OlVVqcw2QsQgymSobJVI9ZEkQc5GvxbwKLNIiH44=; User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 In-Reply-To: <20150115234218.GU4574@brightrain.aerifal.cx> X-SA-Exim-Connect-IP: 93.195.14.51 X-SA-Exim-Mail-From: s.gottschall@dd-wrt.com X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on webmail.newmedia-net.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=4.0 tests=ALL_TRUSTED,BAYES_00, DNS_FROM_AHBL_RHSBL,HTML_40_50,HTML_MESSAGE,RATWARE_GECKO_BUILD autolearn=no version=3.1.9, No X-SA-Exim-Version: 4.2.1 (built Thu, 26 May 2011 15:22:33 +0200) X-SA-Exim-Scanned: Yes (on webmail.newmedia-net.de) X-NMN-MailScanner-Information: Please contact the ISP for more information X-NMN-MailScanner-ID: 1YBuVj-0001Hd-NJ X-NMN-MailScanner: Found to be clean X-NMN-MailScanner-From: s.gottschall@dd-wrt.com X-Received: from [93.195.14.51] (helo=[10.88.193.128]) by webmail.newmedia-net.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1YBuVj-0001Hd-NJ for musl@lists.openwall.com; Fri, 16 Jan 2015 01:11:36 +0100 Xref: news.gmane.org gmane.linux.lib.musl.general:6848 Archived-At: This is a multi-part message in MIME format. --------------030700020505030005080309 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit sorry i forgot the full content. of the message. the first attemt failed due a too big attachment i can help you more. because i found the deadlocking function. its setresuid which hangs forever. (i know that you submitted a patch recently which is related to that function, but i dont know if this will help here) debugging is more complicated with gdb here. its a embedded system without any remote debugging support its exact the same problem which is described here, but without any further solution or problem cause http://freeradius.1045715.n5.nabble.com/Hack-way-to-compile-freeradius-causing-freeradius-to-hang-under-multithread-mode-td2794760.html distribution is simply dd-wrt (router os). so maybe hard for you to work with. i can provide you the full configs used which can be directly executed using radiusd -d /directory to config the full configure line for freeradius, just taken out of my buildsystem (you likelly need to adjust some paths) cd freeradius && \ sys_lib_dlsearch_path_spec="mips-uclibc" \ sys_lib_search_path_spec="mips-uclibc" \ MYSQL_CONFIG="no" \ ac_cv_lib_readline=no \ ac_cv_lib_ssl_SSL_new=yes \ ac_cv_lib_crypto_DH_new=yes \ ac_cv_func_strncasecmp=yes \ ac_cv_func_strcasecmp=yes \ ac_cv_lib_crypt_crypt=yes \ ac_cv_func_gettimeofday=yes \ ac_cv_func_getnameinfo=yes \ ac_cv_func_getaddrinfo=yes \ ac_cv_func_setlinebuf=yes \ ac_cv_host=mips-uclibc-linux \ ./configure --target=mips-linux --host=mips CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -msoft-float -fno-caller-saves -mno-branch-likely -minterlink-mips16 -mips16 -I/home/seg/DEV/pb42/src/router/openssl/include " LDFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -msoft-float -fno-caller-saves -mno-branch-likely -minterlink-mips16 -mips16 -L/home/seg/DEV/pb42/src/router/openssl" --enable-shared \ --program-prefix="" \ --program-suffix="" \ --prefix=/usr \ --exec-prefix=/usr \ --bindir=/usr/bin \ --datadir=/usr/share \ --includedir=/usr/include \ --infodir=/usr/share/info \ --libdir=/usr/lib \ --libexecdir=/usr/lib \ --with-raddbdir=/etc/freeradius2 \ --with-radacctdir=/var/db/radacct \ --with-logdir=/var/log \ --localstatedir=/var \ --mandir=/usr/share/man \ --sbindir=/usr/sbin \ --sysconfdir=/etc \ --enable-shared \ --disable-static \ --disable-developer \ --with-threads \ --with-ltdl-include="/home/seg/DEV/pb42/src/router/freeradius/libltdl/.libs" \ --with-ltdl-lib="/home/seg/DEV/pb42/src/router/freeradius/libltdl" \ --with-openssl-includes="/home/seg/DEV/pb42/src/router/openssl/include" \ --with-openssl-libraries="/home/seg/DEV/pb42/src/router/openssl" \ --enable-strict-dependencies \ --with-raddbdir=/etc/freeradius \ --without-edir \ --without-snmp \ --with-experimental-modules \ --without-rlm_attr-rewrite \ --without-rlm_checkval \ --without-rlm_counter \ --without-rlm_dbm \ --without-rlm_ldap \ --without-edir \ --without-snmp \ --with-rlm_expr \ --with-rlm_eap \ --without-rlm_eap_sim \ --without-rlm_example \ --without-rlm_ippool \ --without-rlm_krb5 \ --without-rlm_pam \ --without-rlm_perl \ --without-rlm_python \ --without-rlm_smb \ --with-rlm_sql \ --with-rlm_sqlcounter \ --without-rlm_sql_db2 \ --without-rlm_sql_freetds \ --without-rlm_sql_iodbc \ --without-rlm_sql_oracle \ --without-rlm_sql_sybase \ --without-rlm_sql_unixodbc \ --without-rlm_x99-token \ --without-rlm_eap_ikev2 \ --without-rlm_eap_tnc \ --without-rlm_opendirectory \ --without-rlm_wimax \ --with-rlm_eap_peap \ --with-rlm_eap_tls \ --with-rlm_eap_ttls \ --with-rlm_expiration \ --with-rlm_logintime \ --with-rlm_attr-rewrite \ --without-rlm_otp \ --without-rlm_smsotp \ --without-rlm_sqlhpwippool \ --without-rlm_sqlippool \ --without-rlm_sql_db2 \ --without-rlm_sql_firebird \ --without-rlm_sql_freetds \ --without-rlm_sql_iodbc \ --without-rlm_sql_oracle \ --without-rlm_sql_sybase \ --without-rlm_sql_unixodbc \ --without-rlm_sql_log \ --without-rlm_sql_sqlite \ --without-rlm_caching \ --without-rlm_redis \ --without-rlm_rediswho \ --without-rlm_eap_tnc \ --without-rlm_eap_ikev2 \ --without-rlm_opendirectory \ --without-rlm_wimax \ --without-rlm_ruby \ --without-rlm_sql_mysql \ --without-rlm_sql_postgresql c Am 16.01.2015 um 00:42 schrieb Rich Felker: > On Thu, Jan 15, 2015 at 06:10:37PM -0500, Rich Felker wrote: >> On Thu, Jan 15, 2015 at 11:52:36PM +0100, Sebastian Gottschall wrote: >>> following test case >>> >>> configure freeradius with --with-threads (which is on by default) >>> if you start radiusd with your radius configuration you will see >>> that radius does not listen on any ports. it will hang in the >>> listener thread which creates the socket. >>> if you configure it as --without-threads, it works >>> >>> >>> tested with musl 1.1.6 on a mips (big endian) system using kernel 3.10 >> Thanks for the report. I'm not terribly familiar with freeradius. Can >> you tell where it's hung, e.g. get a backtrace in gdb, and possibly >> strace -f leading up to the hang? > Short of that, a minimal procedure to reproduce the bug (build > configuration, runtime config files, which distro (if any) you're > using, and anything else needed in the environment, etc.) would be > helpful. > > Rich > --------------030700020505030005080309 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit
sorry i forgot the full content. of the message. the first attemt failed due a too big attachment


i can help you more. because i found the deadlocking function.
its setresuid which hangs forever.  (i know that you submitted a patch recently which is related to that function, but i dont know if this will help here)
debugging is more complicated with gdb here. its a embedded system without any remote debugging support

its exact the same problem which is described here, but without any further solution or problem cause

http://freeradius.1045715.n5.nabble.com/Hack-way-to-compile-freeradius-causing-freeradius-to-hang-under-multithread-mode-td2794760.html

distribution is simply dd-wrt (router os). so maybe hard for you to work with.
i can provide you the full configs used which can be directly executed using radiusd -d /directory to config


the full configure line for freeradius, just taken out of my buildsystem (you likelly need to adjust some paths)

cd freeradius && \
sys_lib_dlsearch_path_spec="mips-uclibc" \
sys_lib_search_path_spec="mips-uclibc" \
MYSQL_CONFIG="no" \
ac_cv_lib_readline=no \
ac_cv_lib_ssl_SSL_new=yes \
ac_cv_lib_crypto_DH_new=yes \
ac_cv_func_strncasecmp=yes \
ac_cv_func_strcasecmp=yes \
ac_cv_lib_crypt_crypt=yes \
ac_cv_func_gettimeofday=yes \
ac_cv_func_getnameinfo=yes \
ac_cv_func_getaddrinfo=yes \
ac_cv_func_setlinebuf=yes \
ac_cv_host=mips-uclibc-linux \
./configure  --target=mips-linux --host=mips CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -msoft-float  -fno-caller-saves -mno-branch-likely -minterlink-mips16 -mips16 -I/home/seg/DEV/pb42/src/router/openssl/include " LDFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -msoft-float  -fno-caller-saves -mno-branch-likely -minterlink-mips16 -mips16 -L/home/seg/DEV/pb42/src/router/openssl" --enable-shared \
--program-prefix="" \
--program-suffix="" \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--datadir=/usr/share \
--includedir=/usr/include \
--infodir=/usr/share/info \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--with-raddbdir=/etc/freeradius2 \
--with-radacctdir=/var/db/radacct \
--with-logdir=/var/log \
--localstatedir=/var \
--mandir=/usr/share/man \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--enable-shared \
--disable-static \
--disable-developer \
--with-threads \
--with-ltdl-include="/home/seg/DEV/pb42/src/router/freeradius/libltdl/.libs" \
--with-ltdl-lib="/home/seg/DEV/pb42/src/router/freeradius/libltdl" \
--with-openssl-includes="/home/seg/DEV/pb42/src/router/openssl/include" \
--with-openssl-libraries="/home/seg/DEV/pb42/src/router/openssl" \
--enable-strict-dependencies \
--with-raddbdir=/etc/freeradius \
--without-edir \
--without-snmp \
--with-experimental-modules \
--without-rlm_attr-rewrite \
--without-rlm_checkval \
--without-rlm_counter \
--without-rlm_dbm \
--without-rlm_ldap \
--without-edir \
--without-snmp \
--with-rlm_expr \
--with-rlm_eap \
--without-rlm_eap_sim \
--without-rlm_example \
--without-rlm_ippool \
--without-rlm_krb5 \
--without-rlm_pam \
--without-rlm_perl \
--without-rlm_python \
--without-rlm_smb \
--with-rlm_sql \
--with-rlm_sqlcounter \
--without-rlm_sql_db2 \
--without-rlm_sql_freetds \
--without-rlm_sql_iodbc \
--without-rlm_sql_oracle \
--without-rlm_sql_sybase \
--without-rlm_sql_unixodbc \
--without-rlm_x99-token \
        --without-rlm_eap_ikev2 \
        --without-rlm_eap_tnc \
--without-rlm_opendirectory \
--without-rlm_wimax \
        --with-rlm_eap_peap \
        --with-rlm_eap_tls \
        --with-rlm_eap_ttls \
--with-rlm_expiration \
--with-rlm_logintime \
--with-rlm_attr-rewrite \
--without-rlm_otp \
--without-rlm_smsotp \
--without-rlm_sqlhpwippool \
--without-rlm_sqlippool \
--without-rlm_sql_db2 \
--without-rlm_sql_firebird \
--without-rlm_sql_freetds \
--without-rlm_sql_iodbc \
--without-rlm_sql_oracle \
--without-rlm_sql_sybase \
--without-rlm_sql_unixodbc \
--without-rlm_sql_log \
--without-rlm_sql_sqlite \
--without-rlm_caching \
--without-rlm_redis \
--without-rlm_rediswho \
--without-rlm_eap_tnc \
--without-rlm_eap_ikev2 \
--without-rlm_opendirectory \
--without-rlm_wimax \
--without-rlm_ruby \
--without-rlm_sql_mysql \
--without-rlm_sql_postgresql
c


Am 16.01.2015 um 00:42 schrieb Rich Felker:
On Thu, Jan 15, 2015 at 06:10:37PM -0500, Rich Felker wrote:
On Thu, Jan 15, 2015 at 11:52:36PM +0100, Sebastian Gottschall wrote:
following test case

configure freeradius with --with-threads (which is on by default)
if you start radiusd with your radius configuration you will see
that radius does not listen on any ports. it will hang in the
listener thread which creates the socket.
if you configure it as --without-threads, it works


tested with musl 1.1.6 on a mips (big endian) system using kernel 3.10
Thanks for the report. I'm not terribly familiar with freeradius. Can
you tell where it's hung, e.g. get a backtrace in gdb, and possibly
strace -f leading up to the hang?
Short of that, a minimal procedure to reproduce the bug (build
configuration, runtime config files, which distro (if any) you're
using, and anything else needed in the environment, etc.) would be
helpful.

Rich


--------------030700020505030005080309--