[gnu.emacs.bug] Trouble with malloc

jkp@SAUNA.HUT.FI (Jyrki Kuoppala) (04/15/89)

I'm afraid this isn't a very good bug report, but has anyone else
experienced trouble with GNU malloc when compiled with gcc ?

When compiling emacs with gcc, temacs crashes in malloc.  Also, I've
compiled tcsh (it's malloc looks like it's derived from the same code)
with gcc and also had trouble.  With tcsh, nmalloc.c works when
compiled with cc, with emacs it doesn't.  As emacs works fine if it's
linked with malloc from libc.a I suspect the trouble is caused by
malloc.c.

Environment: gcc 1.34.91, emacs 18.53 with patch from jr@bbn.com,
Altos 3068 running SVR2.2.

Here's the backtrace from gdb 3.1.2:

./temacs -batch -l inc-vers
Loading inc-vers...
make[1]: *** Bus Error (core dumped)
make[1]: Target `all' not remade because of errors.
make: *** Error 1
make: Target `all' not remade because of errors.
jkp@lupu 'src' 532:

(gdb) bt
#0  0x3de2c in malloc (n=3744) (malloc.c line 491)
#1  0x3df54 in realloc (mem=(char *) 0xc0428 "", n=3744) (malloc.c line 622)
#2  0x154a0 in make_gap (k=3744) (insdel.c line 209)
#3  0x199fc in Finsert_file_contents (filename=51124352, visit=17577996) (fileio.c line 1509)
#4  0x2d32e in Feval (form=84709932) (eval.c line 1394)
#5  0x32fd0 in readevalloop (readcharfun=17590604, stream=(FILE *) 0xba2cc, evalfun=(int (*)()) 0x2ce0c, printflag=0) (lread.c line 409)
#6  0x32bbe in Fload (str=51124252, missing_ok=17577996, nomessage=17577996, nosuffix=17577996) (lread.c line 224)
#7  0x2d380 in Feval (form=84709924) (eval.c line 1402)
#8  0xd080 in top_level_2 () (keyboard.c line 439)
#9  0x2c676 in internal_condition_case (bfun=(int (*)()) 0xd070, handlers=17578236, hfun=(int (*)()) 0xcd6c) (eval.c line 996)
#10 0xd10c in top_level_1 () (keyboard.c line 447)
#11 0x2c1e0 in internal_catch (tag=17578216, func=(int (*)()) 0xd0e6, arg=17577996) (eval.c line 814)
#12 0xcffa in command_loop () (keyboard.c line 412)
#13 0xcce6 in Frecursive_edit () (keyboard.c line 301)
#14 0xc65a in main (argc=4, argv=(char **) 0xffe714, envp=(char **) 0xffe728) (e
macs.c line 468)
(gdb)

//Jyrki