mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Milan P. Stanić" <mps@arvanta.net>
To: musl@lists.openwall.com
Subject: Re: [musl] [PATCH v2] MT fork
Date: Fri, 30 Oct 2020 00:00:07 +0100	[thread overview]
Message-ID: <20201029230007.GA23855@arya.arvanta.net> (raw)
In-Reply-To: <20201029222153.GB2947641@port70.net>

[-- Attachment #1: Type: text/plain, Size: 3148 bytes --]

On Thu, 2020-10-29 at 23:21, Szabolcs Nagy wrote:
> * Milan P. Stanić <mps@arvanta.net> [2020-10-29 21:55:41 +0100]:
> > On Thu, 2020-10-29 at 17:13, Szabolcs Nagy wrote:
> > > * Milan P. Stanić <mps@arvanta.net> [2020-10-29 00:06:10 +0100]:
> > > >  
> > > > Applied this patch on top of current musl master, build it on Alpine and
> > > > installed.
> > > > 
> > > > Tested by building ruby lang. Works fine.
> > > > Also tested building zig lang, works fine.
> > > > But crystal lang builds fine, but running it hangs. strace shows:
> > > > -------------
> > > > [pid  5573] futex(0x7efc50fba9e4, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
> > > > [pid  5568] futex(0x7efc5118f984, FUTEX_REQUEUE_PRIVATE, 0, 1, 0x7efc514b67a4) = 1
> > > > [pid  5568] futex(0x7efc514b67a4, FUTEX_WAKE_PRIVATE, 1) = 1
> > > > [pid  5571] <... futex resumed>)        = 0
> > > > [pid  5568] futex(0x7efc511099e4, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
> > > > [pid  5571] futex(0x7efc510409e4, FUTEX_WAIT_PRIVATE, 2, NULL
> > > > -------------
> > > > where it hangs.
> > > 
> > > try to attach gdb to the process that hang and do
> > > 
> > > thread apply all bt
> > > 
> > > (make sure musl-dbg is installed)
> > 
> > I cannot attach gdb for running process because my Alpine development
> > boxes are lxc containers where CAP_SYS_PTRACE is not enabled afaik.
> 
> there should be a way to config lxc to allow ptrace.
> 
> > I installed musl-dbg and run program with 'gdb .build/crystal' and result is:
> > ----------
> > Reading symbols from .build/crystal...
> > (gdb) run
> > Starting program: /home/mps/aports/community/crystal/src/crystal-0.35.1/.build/crystal
> > 
> > Program received signal SIGSEGV, Segmentation fault.
> 
> hm segfault is not a hang..
> 
> libgc tries to find stack bounds by registering a segfault handler
> and walking stack pages until it triggers.
> 
> gdb stops at signals, this one is harmless, you should just continue
> until you see a hang, then interrupt and bt.
 
I did continue now and stopped it when it hangs. Attached is gdb log
produced by 'thread apply all bt'

> > 0x00007ffff401c463 in GC_find_limit_with_bound () from /usr/lib/libgc.so.1
> > (gdb) bt
> > #0  0x00007ffff401c463 in GC_find_limit_with_bound () from /usr/lib/libgc.so.1
> > #1  0x00007ffff401c522 in GC_init_linux_data_start () from /usr/lib/libgc.so.1
> > #2  0x00007ffff401b2e0 in GC_init () from /usr/lib/libgc.so.1
> > #3  0x00005555555668d8 in init () at
> > /home/mps/aports/community/crystal/src/crystal-0.35.1/src/gc/boehm.cr:127
> > #4  main () at /home/mps/aports/community/crystal/src/crystal-0.35.1/src/crystal/main.cr:35
> > #5  main () at /home/mps/aports/community/crystal/src/crystal-0.35.1/src/crystal/main.cr:114
> > (gdb)
> > ----------
> > 
> > Same with 'thread apply all bt'.
> > 
> > gc lib (garbage collector, https://hboehm.info/gc/) version is
> > gc-dev-8.0.4-r1 on Alpine.
> > 
> > I can't test this on native machine because currently I don't have any
> > x86_64 with enough resources to build crystal. On aarch64 it even can't
> > be built with mt-fork patch, hangs always during build.
> > 
> > -- 
> > Regards

[-- Attachment #2: gdb.txt.gz --]
[-- Type: application/gzip, Size: 1322 bytes --]

  reply	other threads:[~2020-10-29 23:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  0:50 [musl] Status report and " Rich Felker
2020-10-26  0:59 ` Rich Felker
2020-10-26  3:29   ` Rich Felker
2020-10-26 18:44     ` Érico Nogueira
2020-10-26 19:52       ` Rich Felker
2020-10-26 20:11         ` Érico Nogueira
2020-10-27 21:17   ` Rich Felker
2020-10-28 18:56     ` [musl] [PATCH v2] " Rich Felker
2020-10-28 23:06       ` Milan P. Stanić
2020-10-29 16:13         ` Szabolcs Nagy
2020-10-29 16:20           ` Rich Felker
2020-10-29 20:55           ` Milan P. Stanić
2020-10-29 22:21             ` Szabolcs Nagy
2020-10-29 23:00               ` Milan P. Stanić [this message]
2020-10-29 23:27                 ` Rich Felker
2020-10-30  0:13                   ` Rich Felker
2020-10-30  7:47                   ` Milan P. Stanić
2020-10-30 18:52                     ` Milan P. Stanić
2020-10-30 18:57                       ` Rich Felker
2020-10-30 21:31                         ` Ariadne Conill
2020-10-31  3:31                           ` Rich Felker
2020-11-06  3:36                             ` Rich Felker
2020-11-08 16:12                               ` Szabolcs Nagy
2020-11-09 17:07                                 ` Rich Felker
2020-11-09 18:01                                   ` Érico Nogueira
2020-11-09 18:44                                     ` Rich Felker
2020-11-09 18:54                                       ` Érico Nogueira
2020-11-09 21:59                                   ` Szabolcs Nagy
2020-11-09 22:23                                     ` Rich Felker
2020-11-11  0:52                                       ` Rich Felker
2020-11-11  6:35                                         ` Alexey Izbyshev
2020-11-11 11:25                                           ` Szabolcs Nagy
2020-11-11 14:56                                             ` Rich Felker
2020-11-11 16:35                                         ` Rich Felker
2020-10-31  7:22                           ` Timo Teras
2020-10-31 13:29                             ` Szabolcs Nagy
2020-10-31 13:35                               ` Timo Teras
2020-10-31 14:41                                 ` Ariadne Conill
2020-10-31 14:49                                   ` Rich Felker
2020-10-31 14:48                                 ` Rich Felker
2020-10-31 14:47                             ` Rich Felker
2020-10-29 23:32                 ` Szabolcs Nagy

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=20201029230007.GA23855@arya.arvanta.net \
    --to=mps@arvanta.net \
    --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).