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.bugs Subject: bug#74922: Fwd: bug#74922: 29.4; copy_string_contents doesn't always produce a valid utf-8 Date: Tue, 17 Dec 2024 17:10:36 +0200 Message-ID: <86zfkumjkj.fsf@gnu.org> References: <86msguo3cg.fsf@gnu.org> <8634imo0aa.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26584"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 74922@debbugs.gnu.org To: Evgeny Kurnevsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 17 16:11:34 2024 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 1tNZER-0006jH-ME for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Dec 2024 16:11:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNZE1-0008DR-6Y; Tue, 17 Dec 2024 10:11:05 -0500 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 1tNZDy-0008Ct-Qk for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 10:11:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNZDy-00034X-I2 for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 10:11:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=U2qP28LipYAo/fRPHgtKDz8o72yu9lXevF3poo+iEzM=; b=I/FEs80qHvs81NEJko0E6Fs5OhFkosqHeZ5oLi3Z1NlMYINjKFVj0yjN3CT7zNuM1oqdVXyF8C+yG8k6nH3LOUDL9Sk6ti5QuJ1ihElpaqhHzns2sPVmgF5HQqgvKiEfqxm7lOMBjua0qqbkt1pFHvpfHM7XvyAb1ygatvVkS3nh+G8brkLTxvuSNQjS5ryMix5bNTjW1lFZAosTG1dBPnNumM6ic908OUATePk+ejEwQVKVGGKdsnE+IChgz5H95MzHxcJnZdLGm5eURbXHj9AtKeHpOB4A0Qi3SkcZxgkhYGJ48EWCP+q+Uw7NQKDTsCNMj4LJPBkU4fUc7+8Osw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNZDy-00059V-DW for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2024 10:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Dec 2024 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74922 X-GNU-PR-Package: emacs Original-Received: via spool by 74922-submit@debbugs.gnu.org id=B74922.173444824619768 (code B ref 74922); Tue, 17 Dec 2024 15:11:02 +0000 Original-Received: (at 74922) by debbugs.gnu.org; 17 Dec 2024 15:10:46 +0000 Original-Received: from localhost ([127.0.0.1]:59877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNZDh-00058l-Uv for submit@debbugs.gnu.org; Tue, 17 Dec 2024 10:10:46 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNZDg-00058X-AE for 74922@debbugs.gnu.org; Tue, 17 Dec 2024 10:10:44 -0500 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 1tNZDb-00030i-0n; Tue, 17 Dec 2024 10:10:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=U2qP28LipYAo/fRPHgtKDz8o72yu9lXevF3poo+iEzM=; b=nWCd5QrrMuKa CyCRQ24Y6R2eyObISUhaEi4Lg6eGKPLgdUiQyWIolfLk/K36ExU+IZUyFqP80s0DscJww7flmqIoO SkA89ikfOM1xf6pN1dxTLZOkuFAdcPqrj0hFiVVqS0mv4/uFZuJEzvoZ46tmJP1g0z/S0O7YL+QjR J3TW6XxNVA99koXPHo9MItV9eKwnw2CYYznDNMtQw+i28tMnDG6rYYp3Sw3rpVkvs0NDRTnYCp9KP UfuAhp5kd3K/wDVmG/AxZkbfdRmr88jtDT/jSZsG3WNyjXEULy5PIZcHOyGZ4nCISL9Cko0ad45sL Ec4BcJoQyLfuiS2umRJR5A==; In-Reply-To: (message from Evgeny Kurnevsky on Tue, 17 Dec 2024 14:46:28 +0000) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297302 Archived-At: > From: Evgeny Kurnevsky > Date: Tue, 17 Dec 2024 14:46:28 +0000 > Cc: 74922@debbugs.gnu.org > > It can definitely do it, but I guess in emacs-module-rs it's not done by default because of performance > implications - it might be quite costly to check every string in some cases, and it wasn't really clear if emacs > can pass an invalid string. So currently this case causes undefined behavior there which results in emacs > crash. What do Rust programs do when they are told to read random files? This is the same situation, basically. And what would the module do if copy_string_contents *did* signal an error?