[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#21602: closed (25.0.50; coding system seg fault)

From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#21602: closed (25.0.50; coding system seg fault)
Date: Sat, 03 Oct 2015 10:49:02 +0000

Your message dated Sat, 03 Oct 2015 13:48:38 +0300
with message-id <address@hidden>
and subject line Re: bug#21602: 25.0.50; coding system seg fault
has caused the debbugs.gnu.org bug report #21602,
regarding 25.0.50; coding system seg fault
to be marked as done.

(If you believe you have received this mail in error, please contact

21602: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21602
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.0.50; coding system seg fault Date: Thu, 01 Oct 2015 22:32:02 -0400
When I try to send the following buffer with Mail mode,
I get a seg fault within write_region as it tries to handle
'us-ascii' as the mime charset.

If I delete the Content-Type header line, there is no problem.

From: Richard Stallman <address@hidden>
To: address@hidden, Aubrey Colter <address@hidden>
Subject: Please don't promote Amazon!
Reply-to: address@hidden
Date: Wed, 30 Sep 2015 22:23:49 -0400
X-Received-From: 2001:4830:134:3::e
Content-Type: text/plain; charset="us-ascii"
--text follows this line--
Please don't use Amazon gift cards as a reward.
That promotes a company that does nasty things to its customers,
its employees, and nearly everyone else it deals with.

------- Start of forwarded message -------
From: Aubrey Colter <address@hidden>
Date: Tue, 29 Sep 2015 12:27:20 -0400
To: address@hidden
Subject: [csail-related] Seeking Usability Study Participants for MIT App

The MIT App Inventor team is evaluating the MIT App Inventor user interface
through usability testing. The project is being lead by Aubrey Colter for
her Master of Engineering thesis.

We are inviting novice and hobbyist programmers who have little or no
experience with MIT App Inventor to participate in a one-on-one session to
evaluate the application. The MIT IS&T Usability Team will be conducting
these 30 to 45 minute evaluations at MIT (Building W92) or remotely via
WebEx, based on your preference.

If you are interested in participating in this evaluation, please complete
the brief survey found at https://goo.gl/UBasVm. The survey asks some
general questions to determine your eligibility to participate in the

Once you have completed the survey, Aubrey Colter or a member of the
Usability Team will contact you to confirm your participation and provide
further details.

Usability testing participants will be entered into a drawing to receive
one of 15 $10 Amazon gift cards as a thank you for your participation in
this evaluation.

Thank you,
Aubrey Colter
MIT App Inventor Team
Csail-related mailing list
------- End of forwarded message -------

Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.

In GNU Emacs (i686-pc-linux-gnu, GTK+ Version 2.24.23)
 of 2015-08-12 on freetop
Repository revision: 79a169684dfad2c0bbb9fdbae539c1f30d9f0ac3
System Description:     Trisquel GNU/Linux 7.0, Belenos

Configured using:
 `configure 'CFLAGS=-g -O0''

Configured features:

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

Major mode: Mail

Minor modes in effect:
  shell-dirtrack-mode: t
  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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent messages:
Mark set [3 times]
C-c C-g is undefined
Wrote /home/rms/outgoing/out-136
Undo! [2 times]
Mark set [2 times]
File /home/rms/foo1 already exists; overwrite anyway? (y or n) y
Wrote /home/rms/foo1

Load-path shadows:
None found.

(shadow emacsbug mule-diag mailcap wid-edit jka-compr grep compile
shell pcomplete comint ansi-color epa-mail rect dired-aux etags
thingatpt xref project ring dabbrev sgml-mode rmailkwd epa derived epg
url-util url-parse auth-source cl-seq eieio byte-opt bytecomp
byte-compile cl-extra seq cconv eieio-core cl-macs gv gnus-util
password-cache url-vars shr dom subr-x browse-url qp mailalias
misearch multi-isearch rmailsum rmailout rmailmm message sendmail
format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader mail-parse rfc2231 rmail rfc2047
rfc2045 ietf-drums mm-util help-fns help-mode cl-loaddefs pcase cl-lib
mail-prsvr mail-utils dired t-mouse view time-date paren cus-start
cus-load advice finder-inf package easymenu epg-config mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame 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 charscript case-table
epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded
nadvice loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind gfilenotify
dynamic-setting system-font-setting font-render-setting move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 8 279423 61018)
 (symbols 24 25213 15)
 (miscs 20 1806 3185)
 (strings 16 38673 16011)
 (string-bytes 1 1512693)
 (vectors 8 25793)
 (vector-slots 4 1433588 41156)
 (floats 8 292 510)
 (intervals 28 47705 446)
 (buffers 520 159)
 (heap 1024 15828 1217))
[[[ 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
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.

--- End Message ---
--- Begin Message --- Subject: Re: bug#21602: 25.0.50; coding system seg fault Date: Sat, 03 Oct 2015 13:48:38 +0300
> From: Richard Stallman <address@hidden>
> CC: address@hidden
> Date: Fri, 02 Oct 2015 21:37:48 -0400
> I can reproduce the failure in emacs -Q with the code below.  The code
> in my-send-1 is responsible for passing specifying the coding system,
> but even if that value is wrong, write-region should not crash.

Thanks.  For the record, here's a simpler way of triggering the same

  emacs -Q

Type in *scratch*:

  (let ((coding-system-for-write (intern "\"us-ascii\"")))
    (write-region 1 10 "/tmp/SEGV"))

Evaluate this sexp, and you get the same segfault.

The problem here is that we don't check the validity of the
coding-system the user forced on us, until it's too late.

I found a couple more cases of missing validation like this one, and
fixed them all in commit 658f2c4.  The diffs are below.

diff --git a/src/fileio.c b/src/fileio.c
index e4b255a..65aaf57 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3470,7 +3470,10 @@ by calling `format-decode', which see.  */)
       mtime = time_error_value (save_errno);
       st.st_size = -1;
       if (!NILP (Vcoding_system_for_read))
-       Fset (Qbuffer_file_coding_system, Vcoding_system_for_read);
+       {
+         CHECK_CODING_SYSTEM (Vcoding_system_for_read);
+         Fset (Qbuffer_file_coding_system, Vcoding_system_for_read);
+       }
       goto notfound;
@@ -4526,6 +4529,7 @@ choose_write_coding_system (Lisp_Object start, 
Lisp_Object end, Lisp_Object file
   else if (!NILP (Vcoding_system_for_write))
       val = Vcoding_system_for_write;
       if (coding_system_require_warning
          && !NILP (Ffboundp (Vselect_safe_coding_system_function)))
        /* Confirm that VAL can surely encode the current region.  */
@@ -4574,6 +4578,9 @@ choose_write_coding_system (Lisp_Object start, 
Lisp_Object end, Lisp_Object file
          using_default_coding = 1;
+      if (!NILP (val))
+       CHECK_CODING_SYSTEM (val);
       if (! NILP (val) && ! force_raw_text)
          Lisp_Object spec, attrs;

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]