Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 30 Oct 2020 00:00:07 +0100
From: Milan P. Stanić <mps@...anta.net>
To: musl@...ts.openwall.com
Subject: Re: [PATCH v2] MT fork

On Thu, 2020-10-29 at 23:21, Szabolcs Nagy wrote:
> * Milan P. Stanić <mps@...anta.net> [2020-10-29 21:55:41 +0100]:
> > On Thu, 2020-10-29 at 17:13, Szabolcs Nagy wrote:
> > > * Milan P. Stanić <mps@...anta.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

Download attachment "gdb.txt.gz" of type "application/gzip" (1322 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.