From unknown Sun Aug 10 09:47:19 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18458 <18458@debbugs.gnu.org> To: bug#18458 <18458@debbugs.gnu.org> Subject: Status: Wrapper binary (.libs/lt-PROG.c) corrupts wide character arguments Reply-To: bug#18458 <18458@debbugs.gnu.org> Date: Sun, 10 Aug 2025 16:47:19 +0000 retitle 18458 Wrapper binary (.libs/lt-PROG.c) corrupts wide character argu= ments reassign 18458 libtool submitter 18458 Pavel Raiskup severity 18458 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 12 04:26:20 2014 Received: (at submit) by debbugs.gnu.org; 12 Sep 2014 08:26:20 +0000 Received: from localhost ([127.0.0.1]:38845 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XSMBQ-0000VT-67 for submit@debbugs.gnu.org; Fri, 12 Sep 2014 04:26:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51916) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XSMBO-0000VL-8x for submit@debbugs.gnu.org; Fri, 12 Sep 2014 04:26:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSMBE-0006mR-To for submit@debbugs.gnu.org; Fri, 12 Sep 2014 04:26:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSMBE-0006mN-Qf for submit@debbugs.gnu.org; Fri, 12 Sep 2014 04:26:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSMB8-0001zW-Kr for bug-libtool@gnu.org; Fri, 12 Sep 2014 04:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSMB2-0006lg-Gl for bug-libtool@gnu.org; Fri, 12 Sep 2014 04:26:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSMB2-0006lb-9b for bug-libtool@gnu.org; Fri, 12 Sep 2014 04:25:56 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8C8PrM6015504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 12 Sep 2014 04:25:54 -0400 Received: from nb.usersys.redhat.com (unused-4-133.brq.redhat.com [10.34.4.133]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8C8PrTt017898 for ; Fri, 12 Sep 2014 04:25:53 -0400 From: Pavel Raiskup To: bug-libtool@gnu.org Subject: Wrapper binary (.libs/lt-PROG.c) corrupts wide character arguments Date: Fri, 12 Sep 2014 10:25:52 +0200 Message-ID: <1895523.UWpBuUkueD@nb.usersys.redhat.com> User-Agent: KMail/4.13.3 (Linux/3.15.10-201.fc20.x86_64; KDE/4.13.3; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello, recently I got a bug report in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=3D1124436 Short summary: On windows, the 'argv' in main() function is filled by "preprocessed" content. When `./wrapper.exe I =E2=99=A5 lt`, the ar= gv gets filled by ["./wrapper.exe", "I", "?", "lt"]. Libtool wrapper parses th= is argv[] content and based on this broken arguments it spawns the origina= l binary. That way, original binary has different arguments and it complicates testing, for example. I tried to look at how it is done in the wrapper; and I believe the possible fix is non-trivial enough. We need probably use the GetcommandLineW and CommandLineToArgvW functions to obtain wide version= of argv. That way, however, after removing --lt* arguments, you need to escape the wide argv same way as for non-wide version (and pass it into= the _wspawnv call, instead of _spawnv). I am not familiar with windows= api, so if you see that there is simpler/better solution, please say. Firstly, I would like to know whether upstream is interested in such fi= x and whether there is somebody interested in patch-review. Secondly, TB= H, I'm not perfect example of guy to do such change (I could give it a try= , thought, through wine the problem seems to be reproducible). If there = was somebody familiar with windows who wanted to write the patch, I would b= e glad to do the review and testing. Thanks for ideas! Pavel