From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: MPS: a random backtrace while toying with gdb Date: Mon, 01 Jul 2024 21:23:58 +0300 Message-ID: <86cynxdl8h.fsf@gnu.org> References: <87bk3jh8bt.fsf@localhost> <87wmm6rcv1.fsf@gmail.com> <86le2mhhsj.fsf@gnu.org> <875xtqramd.fsf@gmail.com> <86cynyhfsn.fsf@gnu.org> <87v81qp91g.fsf@gmail.com> <86tthafbix.fsf@gnu.org> <87plry6sv3.fsf@localhost> <86le2lfjqv.fsf@gnu.org> <87jzi5ibbe.fsf@localhost> <864j99fg0a.fsf@gnu.org> <87msn18225.fsf@localhost> <86le2ldn2t.fsf@gnu.org> <87h6d97zzm.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, eller.helmut@gmail.com, pipcet@protonmail.com, emacs-devel@gnu.org To: Gerd =?iso-8859-1?Q?M=F6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 01 20:24:21 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sOLhM-0009jz-I3 for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jul 2024 20:24:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOLh6-0007rJ-Gz; Mon, 01 Jul 2024 14:24:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOLh5-0007qr-5W for emacs-devel@gnu.org; Mon, 01 Jul 2024 14:24:03 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOLh4-0001KQ-9J; Mon, 01 Jul 2024 14:24:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=aH3oS8Zai4UiFMfFg0DIx7okEpLrO3qDFI/PFYrR/d0=; b=h58J1zlzKjTTDPx2PdU5 czidoJ5Pa4tYgL8SFIDvlsUkbryG1DIVJTxf4btICpRtsrISj3M8B3OClcLJpoOuD5oagc0cPHFt8 9JePnz8/tRHGp97x5hrO2u6vW9veisGfc/2Km5+VCDu5UReV98oxsLxJLZvHrKFyayX9TITQUlfY9 W8a3OyrecK1iLVvzCJvlpHOKEPjkceyTSm9+/JJ+QUsNrYvkiC2YmZU4/boXkZ91TyAsvU82zO2nN ePT9NvQ9y3lt2pT+L3mhmjnnvkkixCUWgsiSEfT8lr4NPd/dO8plzHltRQENjxM+o6UnlwhNO7PCI YW1P2i7Pk2G0yA==; In-Reply-To: (message from Gerd =?iso-8859-1?Q?M=F6llmann?= on Mon, 01 Jul 2024 20:19:09 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321053 Archived-At: > From: Gerd Möllmann > Cc: Eli Zaretskii , eller.helmut@gmail.com, > pipcet@protonmail.com, emacs-devel@gnu.org > Date: Mon, 01 Jul 2024 20:19:09 +0200 > > Ihor Radchenko writes: > > >> If you really mean malloc, then there usually is not problem because > >> signal handlers cannot safely call malloc. And if malloc causes GC, > >> see above. > > > > I do not mean calling malloc. I mean, what happens if a signal arrives > > _while_ malloc is still in the process of allocating data? > > One would have to consult the malloc implementation. Portably, it's not > safe to call malloc in a signal handler. Right. Also, keep in mind that as long as malloc didn't finish its job of serving a call, the memory it was requested to allocate is not yet available to the program, and thus no one except malloc itself can access that memory.