From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: pthread_getattr_np() vs explicit runtime loader
Date: Sun, 20 Sep 2015 14:27:28 -0400 [thread overview]
Message-ID: <20150920182728.GM17773@brightrain.aerifal.cx> (raw)
In-Reply-To: <20150920172237.GR12087@example.net>
[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]
On Sun, Sep 20, 2015 at 07:22:37PM +0200, u-wsnj@aetey.se wrote:
> On Sun, Sep 20, 2015 at 12:34:05PM -0400, Rich Felker wrote:
> > On Sun, Sep 20, 2015 at 08:39:09AM +0200, u-wsnj@aetey.se wrote:
> > > Would you comment on whether this guess is correct and hopefully make
> > > pthread_getattr_np() work even with the explicit loader?
> >
> > I reviewed the code and there are no assumptions about how the program
> > is loaded made there. And the original test program I used to test
> > pthread_getattr_np runs fine both normally and with an explicit loader
> > command. So I think the actual problem must be elsewhere, likely in
> > whatever the application is doing right after pthread_getattr_np.
>
> Thanks for checking, sorry that the hypothesis seems to be wrong.
>
> May I run a test with that program of yours?
Test program attached. It's just a very basic functionality check.
> > What triggered the crash to start happening? Upgrading musl? Upgrading
>
> It is the behaviour of gcc 5. This was the case when I built 5.1.0 but
> 5.2.0 was supposed to be more compatible with musl, so I did not research
> 5.1.0. Now gcc 5.2.0 behaves identically in this respect.
And both musl and the crashing app were compiled with gcc 5? If so the
problem could be on either side.
> > gcc? Have you used gdb to get a backtrace and see where the program
> > actually crashes?
>
> Not yet, going to. Rebuilding gcc with '-g', this takes some time.
Unless gcc is the program crashing I don't see why you need to rebuild
gcc with -g...
Rich
[-- Attachment #2: getstack.c --]
[-- Type: text/plain, Size: 599 bytes --]
#define _GNU_SOURCE
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
void *start(void *p)
{
for (;;) pause();
}
void printstack(pthread_attr_t *a)
{
void *base;
size_t size;
pthread_attr_getstack(a, &base, &size);
printf("%p - %p (%zu)\n", base, (char *)base+size, size);
}
char buf[12345];
int main()
{
pthread_t td;
pthread_attr_t a;
pthread_attr_init(&a);
pthread_attr_setstack(&a, buf, sizeof buf);
printf("buf = %p\n", buf);
pthread_create(&td, &a, start, 0);
pthread_getattr_np(td, &a);
printstack(&a);
pthread_getattr_np(pthread_self(), &a);
printstack(&a);
}
next prev parent reply other threads:[~2015-09-20 18:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-20 6:39 u-wsnj
2015-09-20 16:34 ` Rich Felker
2015-09-20 17:22 ` u-wsnj
2015-09-20 18:27 ` Rich Felker [this message]
2015-09-20 19:30 ` u-wsnj
2015-09-20 19:41 ` Rich Felker
2015-09-21 7:57 ` u-wsnj
2015-09-30 15:43 ` u-uy74
2015-09-30 20:35 ` Update: [musl] " u-uy74
2015-10-06 11:34 ` musl bug or not, real or not? (Was: [musl] Update: [musl] pthread_getattr_np() vs explicit runtime) loader u-uy74
2015-10-06 14:36 ` Isaac Dunham
2015-10-07 6:48 ` u-uy74
2015-10-06 17:07 ` Rich Felker
2015-10-07 7:27 ` u-uy74
2015-10-07 7:43 ` Timo Teras
2015-10-07 10:59 ` u-uy74
2015-10-08 16:48 ` Rich Felker
2015-10-09 5:39 ` Timo Teras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150920182728.GM17773@brightrain.aerifal.cx \
--to=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).