From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 3FAB63858C52 for ; Wed, 4 Oct 2023 20:16:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3FAB63858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696450588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aR91mw2GxsIW0LrLwmbwIdxG/Y4ZQds/VWTwmHnEDMQ=; b=buatUAznyISqnFO2ZMQSxmz3S9N+Eqs/lNMEEdqNtL0EghLmSbTL5l7gAqFyiwKSxhTBCO lwtbc/IZ66sA4WELZlsNSqTr3RgYg/mAd/yDI+C8prQbvUbMt3DXRTYLUQtu7tAjFnaB7Q rDsmHYrwjkE8uUutCKwBY4FGXd53g+s= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-e-NvihA9O6WDONYJasa6pw-1; Wed, 04 Oct 2023 16:16:27 -0400 X-MC-Unique: e-NvihA9O6WDONYJasa6pw-1 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5361af5eb40so29636a12.0 for ; Wed, 04 Oct 2023 13:16:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696450585; x=1697055385; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aR91mw2GxsIW0LrLwmbwIdxG/Y4ZQds/VWTwmHnEDMQ=; b=dilydmjKPtb1xQN+4dd+PeMsxsE0hDoz2eS1ctETCCU85AbzPL6SZAzLTwiudvz+qi frgosuPgfwkEbeLxjsDlrSZJ/ht8b//5+ISDfjlVdsNBInSH5xMnwdnNa43taM/68zL5 FDiz2dT6JsPq4bRUG2cvSlAwlrIzqEVrCF4FpuudP9R0w6BOFAdtwOxmrH6v6nejecEj pdre8JI3FMBZmjTEcfBjnQxe6Z6kwCyQ9RkMRzy7t1fSh8xEZiGfjuM3ahWuISP4Mo1O gZJzLMG8QeXNhdDyVnhHDXLqHbn8DCo5ZOWMnS1qLecb7h5aiFhwyWDaj79EOM/Kvb+l 7VEQ== X-Gm-Message-State: AOJu0Yzv9BSilM1IygYnogXDdRb07/yqJTwZFQ8DYfOtAZJ1rz08R5Yb psysnmVhGsoY4ELVOr59Ou1AtH8SJKHyxE4DoG3ktysX2/zV1y8e2GLJcRa7GL8DnTFcAv3JPta ilasGpfr4LTpyF4TDXRGbZE6+mqjPggefDDTpUoM= X-Received: by 2002:a05:6402:1d53:b0:51a:4d46:4026 with SMTP id dz19-20020a0564021d5300b0051a4d464026mr3555091edb.0.1696450585124; Wed, 04 Oct 2023 13:16:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9uShIzKInvqTKSRoViaJoeOJ+pmfDfe5LRIBVN0XtSKjMDNa23ZXBVTN7hbB/G5eDEqlkObls015l8PNQ68Y= X-Received: by 2002:a05:6402:1d53:b0:51a:4d46:4026 with SMTP id dz19-20020a0564021d5300b0051a4d464026mr3555081edb.0.1696450584856; Wed, 04 Oct 2023 13:16:24 -0700 (PDT) MIME-Version: 1.0 References: <20230926124147.a4dd18b495c6e0347a64fec0@nifty.ne.jp> <20230928125827.b63798bf217baf45c6a5dd22@nifty.ne.jp> In-Reply-To: <20230928125827.b63798bf217baf45c6a5dd22@nifty.ne.jp> From: Jeff Johnston Date: Wed, 4 Oct 2023 16:16:13 -0400 Message-ID: Subject: Re: fprintf() crashes on wide-oriented stream. To: Takashi Yano Cc: newlib@sourceware.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000007d62cb0606e9ae1e" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --0000000000007d62cb0606e9ae1e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Takashi, I finally took a look at this. The issue is whether POSIX compliance is desired. Corinna would have strong opinions that it is desired and thus, I think she should have her say when she gets back. I personally believe that newlib should have behaved like glibc. I also think the test snippet is invalid and should have performed an fwide call on stdout to reset the wide-orientation and have the code work properly in all cases. -- Jeff J. On Wed, Sep 27, 2023 at 11:58=E2=80=AFPM Takashi Yano wrote: > On Tue, 26 Sep 2023 12:41:47 +0900 > Takashi Yano wrote: > > With this patch, __sfputs_r/__sprint_r is split into two versions, one > > is for vfprintf which does not handle wide string, and the other (newly > > introduced __sfputws_r/__swprin_r) is for vfwprintf which handles wide > > string. Please note that fprintf gets working for wide orient stream > > just like BSD libc, which behaves differently from GNU libc. > > I confirmed musl libc also behaves as BSD libc. > > In the GNU libc (glibc), fprintf() returns -1 with no errno set if the > stream is wide-oriented. > > -- > Takashi Yano > > --0000000000007d62cb0606e9ae1e--