GNU bug report logs - #55014
29.0.50; mml-generate-mime gets error

Previous Next

Package: emacs;

Reported by: rms <at> gnu.org

Date: Tue, 19 Apr 2022 03:48:01 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 55014 in the body.
You can then email your comments to 55014 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#55014; Package emacs. (Tue, 19 Apr 2022 03:48:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to rms <at> gnu.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 19 Apr 2022 03:48:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; mml-generate-mime gets error
Date: Mon, 18 Apr 2022 23:47:22 -0400
I had this in my *mail* buffer (in Mail mode):

======================================================================
Content-Type: text/plain; charset=Utf-8
From: Richard Stallman <rms <at> gnu.org>
To: rms
Subject: 
Reply-To: rms <at> gnu.org

Test.

<#part type="application/pdf" filename="~/foo.pdf" disposition=attachment>
<#/part>
======================================================================

I ran (mml-secure-message-sign-pgpmime), then typed C-c C-c
and got an error from mml-generate-mime, that assq returned nil here:

	(setcdr (assq 'type (cdr (car cont))) content-type))

cont contained this.

======================================================================
((multipart (sign . "pgpmime") (tag-location . 119) (part (type . "text/plain") (contents . "Test.

")) (part (type . "application/pdf") (filename . "~/foo.pdf") (disposition . "attachment") (tag-location . 152) (contents . ""))))
======================================================================

The code there is kludgy, but in the absence of a precise description
of that data structure, I can't directly tell what's wrong.

Is there a description somewhere?

The rest of the backtrace:
  setcdr(nil "text/plain; charset=Utf-8")
  (progn (setcdr (assq 'type (cdr (car cont))) content-type))
  (if (and (consp (car cont)) (= (length cont) 1) content-type) (progn (setcdr (assq 'type (cdr (car cont))) content-type)))
  (if (not cont) nil (if (and (consp (car cont)) (= (length cont) 1) content-type) (progn (setcdr (assq 'type (cdr (car cont))) content-type))) (if (fboundp 'libxml-parse-html-region) (progn (setq cont (mapcar #'mml-expand-all-html-into-multipart-related cont)))) (prog1 (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-multibyte nil) (setq message-options options) (cond (... ...) (... ...) (t ...)) (setq options message-options) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (setq message-options options)))
  (let ((cont (mml-parse)) (mml-multipart-number mml-multipart-number) (options message-options)) (if (not cont) nil (if (and (consp (car cont)) (= (length cont) 1) content-type) (progn (setcdr (assq 'type (cdr (car cont))) content-type))) (if (fboundp 'libxml-parse-html-region) (progn (setq cont (mapcar #'mml-expand-all-html-into-multipart-related cont)))) (prog1 (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-multibyte nil) (setq message-options options) (cond ... ... ...) (setq options message-options) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))) (setq message-options options))))
  mml-generate-mime(nil "text/plain; charset=Utf-8")
  message-encode-message-body()
  mml-to-mime()
  mail-send()
  mail-send-and-exit(nil)



In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, cairo version 1.16.0)
 of 2022-04-13 built on freetop
Repository revision: ed6237e039e6fb51229054d0fce74df074903f19
Repository branch: master
System Description: Trisquel GNU/Linux Nabia (10.0)

Configured using:
 'configure 'CFLAGS=-O0 -g' --with-gnutls=ifavailable'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GPM GSETTINGS HARFBUZZ JPEG LIBOTF
LIBSELINUX LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK2
ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Mail

Minor modes in effect:
  gpm-mouse-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: linux
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow dabbrev emacsbug shortdoc thingatpt misearch multi-isearch
cl-extra vc-git diff-mode easy-mmode vc-dispatcher bug-reference
help-fns radix-tree cl-print debug backtrace help-mode find-func
cus-start cus-load mailalias qp rmailmm message sendmail yank-media
rmc puny rfc822 mml mml-sec epa epg rfc6068 epg-config gnus-util
text-property-search time-date mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired-aux dired
dired-loaddefs t-mouse term/linux view derived advice finder-inf
package browse-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mailcap url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars seq gv subr-x byte-opt bytecomp
byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice simple cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet
lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese composite emoji-zwj
charscript charprop case-table epa-hook jka-cmpr-hook help abbrev
obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable
backquote threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 353614 44925)
 (symbols 48 10482 5)
 (strings 32 36669 1027)
 (string-bytes 1 1029513)
 (vectors 16 19555)
 (vector-slots 8 219774 25967)
 (floats 8 97 267)
 (intervals 56 52273 1191)
 (buffers 992 35))
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]


-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55014; Package emacs. (Tue, 19 Apr 2022 11:45:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Richard Stallman <rms <at> gnu.org>
Cc: 55014 <at> debbugs.gnu.org
Subject: Re: bug#55014: 29.0.50; mml-generate-mime gets error
Date: Tue, 19 Apr 2022 13:44:08 +0200
Richard Stallman <rms <at> gnu.org> writes:

> I had this in my *mail* buffer (in Mail mode):
>
> ======================================================================
> Content-Type: text/plain; charset=Utf-8
> From: Richard Stallman <rms <at> gnu.org>
> To: rms
> Subject: 
> Reply-To: rms <at> gnu.org
>
> Test.
>
> <#part type="application/pdf" filename="~/foo.pdf" disposition=attachment>
> <#/part>
> ======================================================================
>
> I ran (mml-secure-message-sign-pgpmime), then typed C-c C-c
> and got an error from mml-generate-mime, that assq returned nil here:
>
> 	(setcdr (assq 'type (cdr (car cont))) content-type))
>
> cont contained this.

This is because you're asking Emacs to do something impossible -- you've
put a header into the buffer saying it's a text/plain message, but
you're trying to create a multipart message.

So if you remove that Content-Type header, things will work fine.

I've now added a test for this situation so that it doesn't bug out in
Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 55014 <at> debbugs.gnu.org and rms <at> gnu.org Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 19 Apr 2022 11:45:02 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. (Wed, 18 May 2022 11:24:04 GMT) Full text and rfc822 format available.

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

Previous Next


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