From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 20188 invoked from network); 29 Oct 2020 20:56:00 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 29 Oct 2020 20:56:00 -0000 Received: (qmail 32551 invoked by uid 550); 29 Oct 2020 20:55:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32533 invoked from network); 29 Oct 2020 20:55:53 -0000 Date: Thu, 29 Oct 2020 21:55:41 +0100 From: Milan =?utf-8?Q?P=2E_Stani=C4=87?= To: musl@lists.openwall.com Message-ID: <20201029205541.GA13778@arya.arvanta.net> References: <20201026005028.GI534@brightrain.aerifal.cx> <20201026005912.GJ534@brightrain.aerifal.cx> <20201027211735.GV534@brightrain.aerifal.cx> <20201028185608.GG534@brightrain.aerifal.cx> <20201028230610.GA3269@arya.arvanta.net> <20201029161348.GA2947641@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201029161348.GA2947641@port70.net> Subject: Re: [musl] [PATCH v2] MT fork On Thu, 2020-10-29 at 17:13, Szabolcs Nagy wrote: > * Milan P. Stanić [2020-10-29 00:06:10 +0100]: > > On Wed, 2020-10-28 at 14:56, Rich Felker wrote: > > > On Tue, Oct 27, 2020 at 05:17:35PM -0400, Rich Felker wrote: > > > > > > > > > > > > Will follow up with draft patch for testing. > > > > > > > > > > Patch attached. It should suffice for testing and review of whether > > > > > there are any locks/state I overlooked. It could possibly be made less > > > > > ugly too. > > > > > [...] > > > > > > > > Another bug: > > > > [...] > > > > > > And an updated version of the patch with both previously reported bugs > > > fixed, for the purpose of users/distros wanting to test without > > > manually fixing up the patch. Attached. > > > > 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 > > [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 > > [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. 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. 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