From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 130D03858D32 for ; Fri, 10 Nov 2023 13:34:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 130D03858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 130D03858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1033 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699623245; cv=none; b=jHAMtvePqQ+hX3kH38OjWlAe610kzHlowuEhC8LNG32J4EefijnO6sfLBqlO2oJGHTG74J8riCpEASOXH+Wkl7uSCjy6+bt1EepHV84Op2JihoOob2CHTPZnIZ4g5/ENu4uX09p7aYLf/EdXFf73hcVmk/pU0z3LeaUkEbGZZ2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699623245; c=relaxed/simple; bh=Qt1kyjOfHj1OdxWaSVupF182ZlGzQia1GHuqyueTw18=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=obWdHYDSmqYflQ8G59z3fBJryI0TItA5fxXKK5wKnFDA6XhqD4Ycqni0vh6c7s7AKdf8wHQkwn3jtr6RkX6HhgiYVWKNoyB++C29nfyONhJhqP7Y4EYyGoIvdO0QJljOZfvtgS0H4/n8FIMemx9b6d+MbOJR2ERRZoiqnFVXzV0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-27ff7fe7fbcso1759906a91.1 for ; Fri, 10 Nov 2023 05:34:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699623243; x=1700228043; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=W0wZdpGZ6oMbo0bbhgXIZRMwJo3dpzuMrBQWWYjjvp0=; b=qKNNrIVPLohkuSqu4nuPXmFsM5gC6KBwH7Dwn28SZAEByM893g1492TR3seEfl5dp/ oKnuG4JEF83m0fHBJMKam8YrzxN627yWhG27EjvaLSJfVmHvaMYsot7pAyclNvl4mhBG sq29J5eRqsf01ETagGXIw8trq6NCZPSJpiuUiSbYaD3yLlgka6dSBmh89NaLiGMN89Z+ CbQk8/5g6mtILZ935DPRmCzy5DDzdOlJ4iSoIUVpzMnF+SKhPkZhefwM2I+5U0AaH9BQ 8ZOvdjf6gP5V8y5R/qa7gS2k9zT7gsMSmLBPl06TG1xMwUtyCXms+Wg2FueWw1lUbDRm n9dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699623243; x=1700228043; 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=W0wZdpGZ6oMbo0bbhgXIZRMwJo3dpzuMrBQWWYjjvp0=; b=o4t+foFW/hdhgDjzvn+cJaWElkfLVggVLfRQtzhWTjFNty2DPCanlYxBAIzPsFu/bh 4jnYC4D8P2aEz6hfGxB3W/eAIm1D0fnX4BgiIrStio61gz2jdh1778b9zVENWDTzq/4o C84KJf+KXPNdScNan8cMCPo2f6/efepI0vclb6wYyVHSnEDTWvNb+KGvSBF47bkRyU/b ydzgxGznu64+CAhajcUGtE/XexRcji0AVDsz8Xvp9EP9ZKvLV7PbirvXiOufgDk12kpu L9Dyqo04uqL+WqTzo5KaLAG5gv+XcSN/fZP/MThzFsDzaCvepbnmYCYnGLlqpmI8QaTT 0mgA== X-Gm-Message-State: AOJu0Yw45+aOyQzB0Tstb0pbIzCGSXLsFHCselF5KWtJZGWHleXG1mJc FoeqhV/TDGhgroPerLgAjdSbtMqABmvuywQbF6/NMJMGx0hJe8qm4jg= X-Google-Smtp-Source: AGHT+IFU+sEc9cVKnIhh/xqiIN420eS5GOxmsKk+4I80WLDMHzjWNLbvz3iUsNLXMW0sXaGVsfWxR+i4AjOaKuQ2l3I= X-Received: by 2002:a17:90b:4d07:b0:280:c4be:3c85 with SMTP id mw7-20020a17090b4d0700b00280c4be3c85mr5170508pjb.23.1699623242862; Fri, 10 Nov 2023 05:34:02 -0800 (PST) MIME-Version: 1.0 References: <20231108214813.1569-1-takashi.yano@nifty.ne.jp> <20231109192624.8fd1d42b4123b444b095f81f@nifty.ne.jp> <20231110003602.909efa12752d9365403db70a@nifty.ne.jp> <20231110203401.577de1e4d71037afd9642657@nifty.ne.jp> In-Reply-To: <20231110203401.577de1e4d71037afd9642657@nifty.ne.jp> From: Christophe Lyon Date: Fri, 10 Nov 2023 14:33:57 +0100 Message-ID: Subject: Re: [PATCH v5] newlib: libc: Fix crash on fprintf to a wide-oriented stream. To: Takashi Yano Cc: newlib@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On Fri, 10 Nov 2023 at 12:34, Takashi Yano wrote: > > On Fri, 10 Nov 2023 11:18:57 +0100 > Christophe Lyon wrote: > > Hi! > > > > On Thu, 9 Nov 2023 at 16:36, Takashi Yano wrote: > > > > > > On Thu, 9 Nov 2023 13:49:41 +0100 > > > Corinna Vinschen wrote: > > > > On Nov 9 19:26, Takashi Yano wrote: > > > > > On Thu, 9 Nov 2023 11:08:03 +0100 > > > > > Corinna Vinschen wrote: > > > > > > Looks good, please push. > > > > > > > > > > Thanks. Should this also be applied to cygwin-3_4-branch? > > > > > > > > Tricky question. It's a bugfix, yeah, but a bugfix for an undefined > > > > situation. And it's also a behavioral change. So, from my POV we > > > > shouldn't backport it. > > > > > > I see. I'll push it only for master branch. > > > > > > > But if you have another POV, we can discuss it. It occured to me that > > > > you didn't mention where the testcase is coming from. Was that a > > > > real-world problem? If so, where and in which circumstances? > > > > > > No. It was discovered by an accidental mistake while writing > > > a test case for another problem. > > > > > > > After this patch, our automated CI has detected regressions on arm-none-eabi > > with GCC configured with: > > --disable-multilib --with-mode=thumb --with-cpu=cortex-m33 --with-float=hard > > (all these options are probably not mandatory, we have other > > configurations pending in the build queue) > > > > The regressions appear in the libstdc++ tests: > > Running libstdc++:libstdc++-dg/conformance.exp ... > > FAIL: 27_io/objects/wchar_t/12048-1.cc -std=gnu++17 execution test > > FAIL: 27_io/objects/wchar_t/12048-2.cc -std=gnu++17 execution test > > FAIL: 27_io/objects/wchar_t/12048-3.cc -std=gnu++17 execution test > > FAIL: 27_io/objects/wchar_t/12048-4.cc -std=gnu++17 execution test > > XPASS: 27_io/objects/wchar_t/12048-5.cc -std=gnu++17 execution test > > FAIL: ext/stdio_sync_filebuf/wchar_t/1.cc -std=gnu++17 execution test > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-1.cc -std=gnu++17 execution test > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-2.cc -std=gnu++17 execution test > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-3.cc -std=gnu++17 execution test > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-4.cc -std=gnu++17 execution test > > > > the logs show: > > /libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc:37: void > > test01(): Assertion 'std::wcin.good()' failed. > > FAIL: 27_io/objects/wchar_t/12048-1.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc:34: void > > test01(): Assertion 'std::wcin.good()' failed. > > FAIL: 27_io/objects/wchar_t/12048-2.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc:34: void > > test01(): Assertion 'std::wcin.rdbuf()->sgetn(buf, 2) == 2' failed. > > FAIL: 27_io/objects/wchar_t/12048-3.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc:31: void > > test01(): Assertion 'std::wcin.rdbuf()->sgetn(buf, 2) == 2' failed. > > FAIL: 27_io/objects/wchar_t/12048-4.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc:43: void > > test01(): Assertion 'traits_type::to_char_type(wsbuf.sgetc()) == > > w_lit[0]' failed. > > FAIL: ext/stdio_sync_filebuf/wchar_t/1.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc:31: > > void test02(): Assertion 'c1 != WEOF' failed. > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-1.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc:31: > > void test03(): Assertion 'c1 != WEOF' failed. > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-2.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc:31: > > void test04(): Assertion 'sbuf.sgetn(buf, 2) == 2' failed. > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-3.cc -std=gnu++17 execution test > > /libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc:31: > > void test05(): Assertion 'sbuf.sgetn(buf, 2) == 2' failed. > > FAIL: ext/stdio_sync_filebuf/wchar_t/12948-4.cc -std=gnu++17 execution test > > > > I haven't dug further yet, does that ring a bell? > > Thanks for the report. Are these all of the additional failure? Yes. > I checked the previous patch and found the cause. I'll submit > a patch to fix this. > > I confirmed the above errors are resolved with the new patch. Great! Nice that you could reproduce and fix the problem so quickly! Christophe > > -- > Takashi Yano