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=-1.6 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1667 invoked from network); 26 Oct 2020 19:53:02 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 26 Oct 2020 19:53:02 -0000 Received: (qmail 22479 invoked by uid 550); 26 Oct 2020 19:52:59 -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 22461 invoked from network); 26 Oct 2020 19:52:58 -0000 Date: Mon, 26 Oct 2020 15:52:46 -0400 From: Rich Felker To: musl@lists.openwall.com Message-ID: <20201026195246.GN534@brightrain.aerifal.cx> References: <20201026032943.GK534@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Status report and MT fork On Mon, Oct 26, 2020 at 03:44:51PM -0300, Érico Nogueira wrote: > On Sun Oct 25, 2020 at 8:29 PM -03, Rich Felker wrote: > > > + for (i=0; ictor_visitor->tid < 0) { > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > Invalid access as-is, should be queue[i]->ctor_visitor && ... > > > > > + error("State of %s is inconsistent due to multithreaded fork\n", > > > + queue[i]->name); > > > + free(queue); > > > + if (runtime) longjmp(*rtld_fail, 1); > > > + } > > > > > > return queue; > > > } > > As a warning, don't install the resulting libc.so on your system without > the above fix! It segfaulted even with simple applications here. Yep, sorry about that. I'd rebased out an older version with queue[i]->ctor_visitor being the tid itself rather than the pthread_t, and hadn't retested it since adding the ->tid. > Re. the patches, I am now able to import an image into gscan2pdf (a Perl > GTK application) - though it required building Perl with a bigger thread > stack size. With musl 1.2.1 it simply hung on a futex syscall. Great to hear! Was it "working" in earlier musl though? The crash (as discussed on irc) was clearly a stack overflow but it seems odd that it would be newly introduced, unless it was just really borderline on fitting before. Rich