[comp.emacs] Fatal error

lius@beach.cis.ufl.edu (Scott Liu) (05/08/88)

Emacs always gave me the following message when I tried to simulate 
the function "tr - translate characters".

	       Error message from emacs:

	Fatal error (4).Illegal instruction (core dumped)

The steps I did were:
  1. echo "abcd" > test         #generate a test file
  2. /usr/local/emacs -q test 	#invoke emacs without loading my init file.
  3. In emacs, do the following command:

       M-x replace-regexp RET \(a\)\|\(b\) RET \1Z\2Y RET

	(Trying to translate "a" to "Z" and "b" to "Y".
	This can be done by "tr ab ZY".
	Actually, I was trying to translate control characters
	to normal characters, for example, from \C-x to x.)	
	
  4. A fatal error was issued by emacs.  Emacs died after that message.

Is this an emacs bug?

news@uflorida.cis.ufl.EDU (USENET Master) (05/08/88)

From: lius@beach.cis.ufl.edu (Scott Liu)
Path: beach.cis.ufl.edu!lius

-------------------------------------------

Sying-Syang Liu
Dept. of Computer and Information Sciences
University of Florida
UUCP: {ihnp4,rutgers}!codas!ufcsv!lius
Internet mail: lius@ufl.edu

jr@PEBBLES.BBN.COM (John Robinson) (05/10/88)

You didn;t say which version; my tests apply to version 18.50

I couldn't reproduce the crash, but I did get inconsistent results.
the trouble seems to be with trying to insert a match number (\2 in
your example) before it has ever matched anything.  Since I got more
than one result, I suspect it is possible that this causes a null
pointer dereference, or dereference of uninitialized storage.  In
particular, I repeated your experiment by (1) starting a fresh emacs
(with .emacs) and (2) your example exactly.  The results were similar
between these two cases:

>>        M-x replace-regexp RET \(a\)\|\(b\) RET \1Z\2Y RET

For me, this turned "abcd" into "aY2ZYbZcd".  Weird, huh?  Here's how
this happens.  First match is "a".  This is replaced by "aY2Z", where
the "2" should be empty (* but see below) since the second substring
matched nothing.  Next, match the "b", and replace it by "YbZ".  this
is right, as the first substring matched nothing.

* in fairness to emacs, the result of \2 is never defined in the
documentation (in info) of regular expressions.  It seems that the
matches ought to be preset to empty strings, but apparently they
are preset to the corresponding numbers.

At any rate, the replace doesn't have the intended effect as you can
see.  The \1 and \2 in the replacement do not act as conditionals as
you wanted.  regexp-replace cannot really do the function of tr in a
straightforward way.  The best way (in my book) to use emacs and Unix
is to call tr on the thing you are interested in (surprised?).  For
example, consider:

 (defun rot13-region ()
   (interactive)
   (call-process-region (point) (mark) "tr" t t nil "A-Za-z" "N-ZA-Mn-za-m"))

Why to replicate tr(1) when you can just use it?

/jr
jr@bbn.com or bbn!jr

mrh@sys.uea.ac.uk (M.R. Hinds CMP) (06/04/90)

I am trying to compile 18.55 for a Sun 360 running os4.1 

I have set confih.h to

#include "s-sunos4.h"
#include "m-sun3.h"

when this was compiled it gave errors which reffered to FNDELAY, after
a short investigation it appears that the define needed to be changed to-

#define O_NDELAY       _FNDELAY /* Non-blocking I/O (4.2 style) */


Emacs now compilied without error or warnings but the resulting emacs
stops with :

Fatal error (6).Abort (core dumped)

Any Help will be usefull,

BTW 18.52 which was compiled on a sun 360 with os 3.5 works fine under 
0s 4.1 ????

Thanks in advance.

             Mike "Cyril" Hinds     O O        |Post:
                                     ^         |   School of Info. Systems
             mrh@sys.uea.ac.uk      \_/        |   University of East Anglia
      JANET: mrh@uk.ac.uea.sys                 |   The Plain
   Internet: mrh%sys.uea.ac.uk@cunyvm.cuny.edu |   Norwich, UK
EARN/BITNET: mrh%sys.uea.ac.uk@UKACRL          |   NR4 7TJ
       UUCP: mrh%sys.uea.ac.uk@ukc.uucp        |Phone: +44 603 56161 Ext 2319

wisner@hayes.fai.alaska.edu (Bill Wisner) (06/06/90)

This is a known problem with GNU Emacs under SunOS 4.1. It was
reported in a recent issue of the Sun Software Technical Bulletin. The
problem is with the GNU malloc() routine. A quick workaround is to
define SYSTEM_MALLOC in your config.h file and recompile.

Bill Wisner <wisner@hayes.fai.alaska.edu> Gryphon Gang Fairbanks AK 99775
/* you are not meant to understand this */

ralph@laas.fr (Ralph P. Sobek) (08/24/90)

What are the other possible cases of `Fatal Error (11).'?  I get that
message from time to time, and I'm under 8 Mb.

--
Ralph P. Sobek			  Disclaimer: The above ruminations are my own.
ralph@laas.fr				   Addresses are ordered by importance.
ralph@laas.uucp, or ...!uunet!laas!ralph		
If all else fails, try:				      sobek@eclair.Berkeley.EDU
===============================================================================
Reliable software should kill people reliably! -Andy Mickel, Pascal News #13,78