GNU bug report logs - #41184
28.0.50; Crash on NS when opening text file in a possibly invalid zip archive

Previous Next

Package: emacs;

Reported by: Filipp Gunbin <fgunbin <at> fastmail.fm>

Date: Mon, 11 May 2020 02:02:02 UTC

Severity: normal

Tags: patch

Merged with 42904

Found in version 28.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41184 in the body.
You can then email your comments to 41184 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41184; Package emacs. (Mon, 11 May 2020 02:02:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Filipp Gunbin <fgunbin <at> fastmail.fm>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 11 May 2020 02:02:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Crash on NS when opening text file in a possibly invalid
 zip archive
Date: Mon, 11 May 2020 04:52:28 +0300
[Message part 1 (text/plain, inline)]
- emacs -Q
- C-x C-f <path to attached zip> RET
- RET on the first file in archive (the one with .txt extension)

TTY emacs doesn't crash with the same recipe.

Thanks.

In GNU Emacs 28.0.50 (build 14, x86_64-apple-darwin19.2.0, NS appkit-1894.20 Version 10.15.2 (Build 19C57))
 of 2020-05-09 built on fgunbin.local
Repository revision: ae3c510696f02f01d03052f070e5ce65b4018a45
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.2

[Фрейд Зигмунд. Вытеснение - royallib.com.txt.zip (application/zip, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41184; Package emacs. (Mon, 11 May 2020 14:45:02 GMT) Full text and rfc822 format available.

Message #8 received at 41184 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Filipp Gunbin <fgunbin <at> fastmail.fm>
Cc: 41184 <at> debbugs.gnu.org
Subject: Re: bug#41184: 28.0.50;
 Crash on NS when opening text file in a possibly invalid zip archive
Date: Mon, 11 May 2020 17:44:10 +0300
> From: Filipp Gunbin <fgunbin <at> fastmail.fm>
> Date: Mon, 11 May 2020 04:52:28 +0300
> 
> - emacs -Q
> - C-x C-f <path to attached zip> RET
> - RET on the first file in archive (the one with .txt extension)

Can you please show the backtrace?  Without that, the bug report is
only useful if the crash can be reproduced, and you shouldn't rely on
that (e.g, I couldn't reproduce it).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41184; Package emacs. (Mon, 11 May 2020 15:59:01 GMT) Full text and rfc822 format available.

Message #11 received at 41184 <at> debbugs.gnu.org (full text, mbox):

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Filipp Gunbin <fgunbin <at> fastmail.fm>, 41184 <at> debbugs.gnu.org
Subject: Re: bug#41184: 28.0.50; Crash on NS when opening text file in a
 possibly invalid zip archive
Date: Mon, 11 May 2020 18:57:52 +0300
Eli Zaretskii <eliz <at> gnu.org> writes:

>> - emacs -Q
>> - C-x C-f <path to attached zip> RET
>> - RET on the first file in archive (the one with .txt extension)
>
> Can you please show the backtrace?  Without that, the bug report is
> only useful if the crash can be reproduced, and you shouldn't rely on
> that (e.g, I couldn't reproduce it).

For this time not only the subject contains "NS" but also the message
body contains "Mac OS X" ;-)

Can reproduce it with those steps.  Here is backtrace:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aString != nil'
abort() called
terminating with uncaught exception of type NSException

Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff32c47d07 __exceptionPreprocess + 250
1   libobjc.A.dylib                     0x00007fff6b96b5bf objc_exception_throw + 48
2   CoreFoundation                      0x00007fff32c70ec8 +[NSException raise:format:arguments:] + 88
3   Foundation                          0x00007fff3535bf3d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4   AppKit                              0x00007fff2fe991c4 -[NSWindow setTitle:] + 185
5   Emacs-x86_64-10_14                  0x000000010b22dfb1 ns_set_name_internal + 161
6   Emacs-x86_64-10_14                  0x000000010b227e8b ns_implicitly_set_name + 475
7   Emacs-x86_64-10_14                  0x000000010b08a531 gui_consider_frame_title + 609
8   Emacs-x86_64-10_14                  0x000000010b05f9fc redisplay_internal + 1324
9   Emacs-x86_64-10_14                  0x000000010b0fdbe5 read_char + 2213
10  Emacs-x86_64-10_14                  0x000000010b0fb7aa read_key_sequence + 1722
11  Emacs-x86_64-10_14                  0x000000010b0f9fac command_loop_1 + 1340
12  Emacs-x86_64-10_14                  0x000000010b180b87 internal_condition_case + 263
13  Emacs-x86_64-10_14                  0x000000010b10a120 command_loop_2 + 48
14  Emacs-x86_64-10_14                  0x000000010b1803ab internal_catch + 267
15  Emacs-x86_64-10_14                  0x000000010b24c385 command_loop.cold.1 + 69
16  Emacs-x86_64-10_14                  0x000000010b0f9073 command_loop + 131
17  Emacs-x86_64-10_14                  0x000000010b0f8fa3 recursive_edit_1 + 115
18  Emacs-x86_64-10_14                  0x000000010b0f91fb Frecursive_edit + 347
19  Emacs-x86_64-10_14                  0x000000010b0f7dd7 main + 7431
20  libdyld.dylib                       0x00007fff6cb12cc9 start + 1


--
Andrii




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41184; Package emacs. (Mon, 11 May 2020 16:52:01 GMT) Full text and rfc822 format available.

Message #14 received at 41184 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Cc: fgunbin <at> fastmail.fm, 41184 <at> debbugs.gnu.org
Subject: Re: bug#41184: 28.0.50; Crash on NS when opening text file in a
 possibly invalid zip archive
Date: Mon, 11 May 2020 19:51:17 +0300
> From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
> Cc: Filipp Gunbin <fgunbin <at> fastmail.fm>,  41184 <at> debbugs.gnu.org
> Date: Mon, 11 May 2020 18:57:52 +0300
> 
> Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: aString != nil'
> abort() called
> terminating with uncaught exception of type NSException
> 
> Application Specific Backtrace 1:
> 0   CoreFoundation                      0x00007fff32c47d07 __exceptionPreprocess + 250
> 1   libobjc.A.dylib                     0x00007fff6b96b5bf objc_exception_throw + 48
> 2   CoreFoundation                      0x00007fff32c70ec8 +[NSException raise:format:arguments:] + 88
> 3   Foundation                          0x00007fff3535bf3d -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
> 4   AppKit                              0x00007fff2fe991c4 -[NSWindow setTitle:] + 185
> 5   Emacs-x86_64-10_14                  0x000000010b22dfb1 ns_set_name_internal + 161
> 6   Emacs-x86_64-10_14                  0x000000010b227e8b ns_implicitly_set_name + 475
> 7   Emacs-x86_64-10_14                  0x000000010b08a531 gui_consider_frame_title + 609

Looks like some NS-specific issue with showing a strange file name in
the frame title?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41184; Package emacs. (Mon, 11 May 2020 18:47:02 GMT) Full text and rfc822 format available.

Message #17 received at 41184 <at> debbugs.gnu.org (full text, mbox):

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: fgunbin <at> fastmail.fm, 41184 <at> debbugs.gnu.org
Subject: Re: bug#41184: 28.0.50; Crash on NS when opening text file in a
 possibly invalid zip archive
Date: Mon, 11 May 2020 21:46:38 +0300
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Terminating app due to uncaught exception
>> 'NSInternalInconsistencyException', reason: 'Invalid parameter not
>> satisfying: aString != nil'
>> abort() called
>> terminating with uncaught exception of type NSException
>>
>> Application Specific Backtrace 1:
>> 0   CoreFoundation                      0x00007fff32c47d07 __exceptionPreprocess + 250
>> 1   libobjc.A.dylib                     0x00007fff6b96b5bf objc_exception_throw + 48
>> 2   CoreFoundation                      0x00007fff32c70ec8 +[NSException raise:format:arguments:] + 88
>> 3 Foundation 0x00007fff3535bf3d -[NSAssertionHandler
>> handleFailureInMethod:object:file:lineNumber:description:] + 191
>> 4   AppKit                              0x00007fff2fe991c4 -[NSWindow setTitle:] + 185
>> 5   Emacs-x86_64-10_14                  0x000000010b22dfb1 ns_set_name_internal + 161
>> 6   Emacs-x86_64-10_14                  0x000000010b227e8b ns_implicitly_set_name + 475
>> 7   Emacs-x86_64-10_14                  0x000000010b08a531 gui_consider_frame_title + 609
>
> Looks like some NS-specific issue with showing a strange file name in
> the frame title?

You are absolutely right.

Actually crash can be reproduced with single step:

  (set-frame-name "\200")




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41184; Package emacs. (Mon, 11 May 2020 18:55:01 GMT) Full text and rfc822 format available.

Message #20 received at 41184 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Cc: fgunbin <at> fastmail.fm, 41184 <at> debbugs.gnu.org
Subject: Re: bug#41184: 28.0.50; Crash on NS when opening text file in a
 possibly invalid zip archive
Date: Mon, 11 May 2020 21:53:49 +0300
> From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
> Cc: fgunbin <at> fastmail.fm,  41184 <at> debbugs.gnu.org
> Date: Mon, 11 May 2020 21:46:38 +0300
> 
> >> 4   AppKit                              0x00007fff2fe991c4 -[NSWindow setTitle:] + 185
> >> 5   Emacs-x86_64-10_14                  0x000000010b22dfb1 ns_set_name_internal + 161
> >> 6   Emacs-x86_64-10_14                  0x000000010b227e8b ns_implicitly_set_name + 475
> >> 7   Emacs-x86_64-10_14                  0x000000010b08a531 gui_consider_frame_title + 609
> >
> > Looks like some NS-specific issue with showing a strange file name in
> > the frame title?
> 
> You are absolutely right.
> 
> Actually crash can be reproduced with single step:
> 
>   (set-frame-name "\200")

It probably means the APIs used by ns_set_name_internal cannot handle
invalid UTF-8 sequences.  The code there seems to naïvely encode in
UTF-8, but doesn't have any error handling for when that fails.
Someone who knows about NS programming should add some simple
workaround, like showing a string "\200" instead of a byte \200.
Or something.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41184; Package emacs. (Tue, 12 May 2020 10:45:01 GMT) Full text and rfc822 format available.

Message #23 received at 41184 <at> debbugs.gnu.org (full text, mbox):

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 41184 <at> debbugs.gnu.org
Subject: Re: bug#41184: 28.0.50; Crash on NS when opening text file in a
 possibly invalid zip archive
Date: Tue, 12 May 2020 13:44:38 +0300
On 11/05/2020 17:44 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <fgunbin <at> fastmail.fm>
>> Date: Mon, 11 May 2020 04:52:28 +0300
>>
>> - emacs -Q
>> - C-x C-f <path to attached zip> RET
>> - RET on the first file in archive (the one with .txt extension)
>
> Can you please show the backtrace?  Without that, the bug report is
> only useful if the crash can be reproduced, and you shouldn't rely on
> that (e.g, I couldn't reproduce it).

Sorry, my fault, I had it but forgot to insert.  I see Andrii posted a
similar one.




Merged 41184 42904. Request was from Mattias Engdegård <mattiase <at> acm.org> to control <at> debbugs.gnu.org. (Mon, 17 Aug 2020 16:14:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 Sep 2020 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 211 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.