From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7869 Path: news.gmane.org!not-for-mail From: Sebastian Gottschall Newsgroups: gmane.linux.lib.musl.general Subject: Re: stable 1.1.9 & current GIT broken on mips Date: Thu, 4 Jun 2015 14:14:19 +0200 Message-ID: <5570411B.40307@dd-wrt.com> References: <1433236180.2010.17.camel@xiaoka.com> <20150602093553.GA10927@port70.net> <1433243791.2010.21.camel@xiaoka.com> <20150602112410.GC10927@port70.net> <1433246655.2010.22.camel@xiaoka.com> <556DD263.5070800@dd-wrt.com> <20150602171924.GI17573@brightrain.aerifal.cx> <556DED4F.5040000@dd-wrt.com> <20150602191133.GJ17573@brightrain.aerifal.cx> <556E0B0C.200@dd-wrt.com> <20150604040402.GP17573@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1433420083 3754 80.91.229.3 (4 Jun 2015 12:14:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Jun 2015 12:14:43 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-7882-gllmg-musl=m.gmane.org@lists.openwall.com Thu Jun 04 14:14:37 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 1Z0U2d-0002Yw-K5 for gllmg-musl@m.gmane.org; Thu, 04 Jun 2015 14:14:35 +0200 Original-Received: (qmail 31906 invoked by uid 550); 4 Jun 2015 12:14:32 -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 31888 invoked from network); 4 Jun 2015 12:14:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dd-wrt.com; s=mikd; h=Subject:Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To; bh=9bPBW8v5+M5oYz5hZeponfBNyxfXN+k/Xigil+u+YcY=; b=iuxwuWZpaWfy2QnwzLKDH2rFri8tonl51/N++SSs6RuYIT5C/SUPJV/57JPkxzUDKx216FDU0s09oF4EJTo0QSt4FlJ/whfojQway9uaqg5JNqqaGfJHRE/0RIQN59Uc1lrox8mjkSdqC5gUKJgHyfaqZRBORAY9rcV6TtSDoSU=; User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0 In-Reply-To: <20150604040402.GP17573@brightrain.aerifal.cx> X-SA-Exim-Connect-IP: 87.155.253.75 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.5 required=4.0 tests=ALL_TRUSTED,BAYES_00, DNS_FROM_AHBL_RHSBL,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: 1Z0U2L-0002rE-No X-NMN-MailScanner: Found to be clean X-NMN-MailScanner-From: s.gottschall@dd-wrt.com X-Received: from [87.155.253.75] (helo=[10.88.193.128]) by webmail.newmedia-net.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.72) (envelope-from ) id 1Z0U2L-0002rE-No; Thu, 04 Jun 2015 14:14:18 +0200 Xref: news.gmane.org gmane.linux.lib.musl.general:7869 Archived-At: nbd gave me the following patch he found in the IRC. i tested it and its working diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 42930ad..f498327 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -270,6 +270,8 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri for (; rel_size; rel+=stride, rel_size-=stride*sizeof(size_t)) { if (skip_relative && IS_RELATIVE(rel[1])) continue; type = R_TYPE(rel[1]); + if (!type) + continue; sym_index = R_SYM(rel[1]); reloc_addr = (void *)(base + rel[0]); if (sym_index) { Am 04.06.2015 um 06:04 schrieb Rich Felker: > On Tue, Jun 02, 2015 at 09:59:08PM +0200, Sebastian Gottschall wrote: >> Am 02.06.2015 um 21:11 schrieb Rich Felker: >>> On Tue, Jun 02, 2015 at 07:52:15PM +0200, Sebastian Gottschall wrote: >>>> Am 02.06.2015 um 19:19 schrieb Rich Felker: >>>>> On Tue, Jun 02, 2015 at 05:57:23PM +0200, Sebastian Gottschall wrote: >>>>>> Hello >>>>>> >>>>>> i tested today the current 1.1.9 (and later also current git so see >>>>>> if its the same behaviour) >>>>>> build on a mipsr2 big endian target (atheros ar7xxx) based on my >>>>>> dd-wrt firmware. >>>>>> i found out that mips seems to be broken on musl right now. the >>>>>> behaviour is >>>>>> that a call using execvp will not result in calling the desired >>>>>> application. >>>>>> on a second call and a following return call, the userspace will >>>>>> lock up with no way todo anything anymore. >>> What do you mean by "the userspace will lock up"? The process hangs? >>> Or the whole system? Is there any way to observe what's going on with >>> strace? >> no serial input anymore, looks like system hangs. but sometimes a >> kernel message still may race up. ([81.730000] random: nonblocking >> pool is initialized for instance) >> so its not completelly dead, but its not possible >> to interface from userspace anymore with serial console etc. > Can you provide me with the libc.so binary that's failing? > >>> And can you clarify what you mean about execvp? Are you saying the >>> first call to execvp returns with an error? I don't get what you mean >>> about "a second call and a following return call". On success execvp >>> does not return. >> i never checked for a return value. i just can say that the programm >> was never called. >> see the function i provided >> _eval("devinit"); //returns, but app never gets called >> _eval("sysinit"); //app never gets called, _eval hangs complete >> system on return call of _eval >>> If you're trying to start a dynamic-linked application, it's likely >>> that something is going wrong in the dynamic linker after execvp >>> succeeds but before execution passes into the main program. You could >>> try running a program with global constructors and see if they run. >>> There's a jump at the end of dynamic linking which is not compatible >>> with calling into mips16 code, but as long as crt1.o is not mips16 >>> (and it shouldn't be; on mips it's still built from a .s file, and you >>> said you're not using mips16 in libc) this should not be a problem. >>> >>> Another possibility I should mention since this is DD-WRT is that >>> you've got an ancient kernel that's not compatible with TLS. As of >>> 1.1.0 musl deprecated running without a valid thread pointer, but >>> still worked if you happened not to invoke code that needs it. 1.1.9 >>> removed the last remnants of support for no-thread-pointer and now >>> aborts with SIGSEGV or SIGILL in the startup code if setting the >>> thread pointer fails, which will be the case on 2.4 kernels. >> its kernel 3.18 and kernel 3.10 which is mainly used. in the >> testcase 3.18 was used >> dont think that dd-wrt still used 2.4 (this is only the case for old >> wrt54g devices, but these devices are uclibc based) >> musl is the standard for all mips and armbe/le based devices in >> dd-wrt only y86,x64,powerpc and mips64 devices are still using >> uclibs since mips64 doesnt work with musl and power >> wasnt working months ago. may have changed in between. never tested so far. >> but target is to use musl on all cpu architectures in future, once >> its working on all. > OK, that's not the issue then. > > Rich >