mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Cc: Rich Felker <dalias@libc.org>
Subject: Re: musl pthread/tls issue.
Date: Wed, 22 Oct 2014 09:45:37 +0200	[thread overview]
Message-ID: <20141022074536.GF16659@port70.net> (raw)
In-Reply-To: <54474F9D.3090306@i-soft.com.cn>

* ?????? <jianzhong.huang@i-soft.com.cn> [2014-10-22 14:33:01 +0800]:
> These days, I finished build a bootable x86_64 system(rpm based) include
> musl/systemd/dracut/gcc-4.9.1/gcc-5/clang-3.5 and wayland/Xorg and the
> whole GNOME-3.14 desktop(except webkit js segfault issue I mentioned
> before) with a lot of patches(I will release all of them someday until
> it reach a stable state.)
> 
> After a simple try, I found gnome-shell will segfault If I triggered the
> app list(not always but often).
> 
> The dmesg report "pool [<some pid>] segfault xxxxxxxxxxx
> libpixman-xxxxx", That's to say, it segfault in pixman library(A common
> library used by Xorg and cairo),
> gdb report it's a thread issue(a thread of gnome-shell) and segfault at
> the beginning of general_composite_rect function in pixman-general.c,
> the pointer of argument can not be accessed.
> 

that's not enough info..

both the webkit js and this crash sounds like thread stack overflow

> That's to say, there must be a problem exist in musl pthread/tls
> implementation and can be triggered under certain circumstances. Please
> help to solve it.
> 

i don't believe that without evidence: general_composite_rect itself
allocates >24k on the stack, that is about a third of the musl default
stack size

you can verify it by checking the diff of the top and bottom of the stack
(gdb backtrace prints the stack pointer, if the diff is >56k when that
func was entered then this was the problem) or looking at /proc/pid/maps
and if the crash happened in a guard page after a thread stack

to fix: make the application create a larger thread stack eg 1M
(pthread_attr_setstacksize, but gnome* will use gthread most likely
which has different api)


  parent reply	other threads:[~2014-10-22  7:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22  6:33 黄建忠
2014-10-22  7:08 ` Luca Barbato
2014-10-22  7:17   ` 黄建忠
2014-10-22  7:27 ` Jens Gustedt
2014-10-22  7:45 ` Szabolcs Nagy [this message]
2014-10-24  7:35   ` 黄建忠
2014-10-24 11:32     ` Szabolcs Nagy
2014-10-22  7:58 ` 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=20141022074536.GF16659@port70.net \
    --to=nsz@port70.net \
    --cc=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).