From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.bugs Subject: bug#46881: 28.0.50; pdumper dumping causes way too many syscalls Date: Fri, 5 Mar 2021 15:12:31 +0000 Message-ID: References: <83r1kw6b06.fsf@gnu.org> <90e99fc5-280d-63bb-9bc4-3efe89b9f9e2@dancol.org> <83a6riysnv.fsf@gnu.org> <83zgzixcfy.fsf@gnu.org> <83v9a5yfc0.fsf@gnu.org> <83k0qly7io.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="000000000000904de305bccb854b" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30394"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46881@debbugs.gnu.org, eggert@cs.ucla.edu To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 05 16:37:00 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lICVf-0007hm-IY for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 16:36:59 +0100 Original-Received: from localhost ([::1]:42346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICVe-00028j-Kq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Mar 2021 10:36:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIC9S-0002YN-Ll for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 10:14:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIC9S-0001DP-DT for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 10:14:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lIC9S-0003nR-7V for bug-gnu-emacs@gnu.org; Fri, 05 Mar 2021 10:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Pip Cet Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Mar 2021 15:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46881 X-GNU-PR-Package: emacs Original-Received: via spool by 46881-submit@debbugs.gnu.org id=B46881.161495719914528 (code B ref 46881); Fri, 05 Mar 2021 15:14:02 +0000 Original-Received: (at 46881) by debbugs.gnu.org; 5 Mar 2021 15:13:19 +0000 Original-Received: from localhost ([127.0.0.1]:35147 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIC8k-0003mG-Gg for submit@debbugs.gnu.org; Fri, 05 Mar 2021 10:13:18 -0500 Original-Received: from mail-ot1-f44.google.com ([209.85.210.44]:37170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lIC8g-0003m1-BZ for 46881@debbugs.gnu.org; Fri, 05 Mar 2021 10:13:17 -0500 Original-Received: by mail-ot1-f44.google.com with SMTP id g8so2095752otk.4 for <46881@debbugs.gnu.org>; Fri, 05 Mar 2021 07:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OQTY154O0EtOUQUT7wNx89gDq8dxgiLLXu6sCbODzzk=; b=oGc8CEfJH5tRP/RiLKVBo6Ijs/VujGqcx598ZIRWuHWbZPpMMrqMdXZ56BOMoGTqKa +Oseq3JtiTWwFAHRTqiTd+pJXriL9c97rKbFXZ1UXRmA6Mw1+xo9RUwTiXqr0XFxdKXL 5ZkWeKixKwfrx/FhA24/dxb9si+IKbSoX0/tFkgBXyQZSeCP3AgC6VYnJVL0ZcByDE09 gkyEFoxOe8ElXDwxrkvqCg3FDoXZ76qQDG8xVbis5ydGcdPTUC1U8uryJ8bPk3kzQdwP 9OFgBOOVuIBTNLmu/TQc1haKGj4BtpMzXEgaIk6UYQrwIIxnuZIEJhF3XKTZC68yHUW1 a1gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OQTY154O0EtOUQUT7wNx89gDq8dxgiLLXu6sCbODzzk=; b=Twhf5Dvq50xmqwrLTEviVgBmGqfl0JE+aCFoQoV8KJ/P3C7X6soFLvXGonz1aCQiuN 7D8JCXNpP38SpSBz8kX5s40socYhK5lY/8/tmAF38KqQmKBD7cvtNMFCLmVFKTYg99nB Sz9H0FdR3/AGwt4Cm2KL4THxU51HHia3dhPelqUKw7NLCrH9ubUD4EcUabK4DRrHF7H3 4k5T1sIFt/3tBzOPijVs1p6RhgbBOqbVt3+QwL9ZusnJ2J9eAvj1CBnCogQCXBMXZuiz wf6xplOw4JqctAuCot2XEe4ttnMeMUtNnyb5WRv44w0lKt5gK6NIamfTpl6NKipjVEZr 8u+Q== X-Gm-Message-State: AOAM531EhcKloSoguuFe+OF3Mj/uSWVRKG6qwNWEvIJinIMqEwVAlDiF Dve01Ndn1NyPD0GL4de80jYN1oU0EEol/ObNGcU= X-Google-Smtp-Source: ABdhPJzCJOV5QJXeztbeX45TAXrhTvu5bmySqL3Pxf+hLit6HLeBxjbyMSlfFl5hYuZ5CBmLAPVl8pE8Gdih1pNV6x0= X-Received: by 2002:a05:6830:1e51:: with SMTP id e17mr8383116otj.292.1614957188753; Fri, 05 Mar 2021 07:13:08 -0800 (PST) In-Reply-To: <83k0qly7io.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201554 Archived-At: --000000000000904de305bccb854b Content-Type: text/plain; charset="UTF-8" On Fri, Mar 5, 2021 at 2:56 PM Eli Zaretskii wrote: > > From: Pip Cet > > Date: Fri, 5 Mar 2021 14:02:33 +0000 > > Cc: Daniel Colascione , eggert@cs.ucla.edu, 46881@debbugs.gnu.org > > > > However, there's open_memstream > > That's glibc-only, AFAIK. Not portable enough for us. POSIX.1-2008. Not portable enough to require, certainly, but portable enough to use? Pip --000000000000904de305bccb854b Content-Type: text/x-patch; charset="UTF-8"; name="0001-Use-stdio-memstreams-if-available-for-pdumper-Bug-46.patch" Content-Disposition: attachment; filename="0001-Use-stdio-memstreams-if-available-for-pdumper-Bug-46.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_klwfpc7y0 RnJvbSBiNjAwYzQ0NGUwNDZkMzg4OGY1NjgzOWRiZTcwZDZkMjA5YTZiYTI5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaXAgQ2V0IDxwaXBjZXRAZ21haWwuY29tPgpEYXRlOiBUdWUs IDIgTWFyIDIwMjEgMjA6Mzg6MjMgKzAwMDAKU3ViamVjdDogW1BBVENIXSBVc2Ugc3RkaW8sIG1l bXN0cmVhbXMgaWYgYXZhaWxhYmxlIGZvciBwZHVtcGVyIChCdWcjNDY4ODEpCgoqIGNvbmZpZ3Vy ZS5hYzogQ2hlY2sgZm9yIG9wZW5fbWVtc3RyZWF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