unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* emacs-22.1 coredumps on HPUX 11i
@ 2007-08-15 15:51 Dimitry Kloper
  2007-08-16  0:43 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Dimitry Kloper @ 2007-08-15 15:51 UTC (permalink / raw)
  To: bug-gnu-emacs

Hello

I apologise in case this bug was already reported.

Setup:
HPUX 11i
gcc 3.3.3
Source snapshot from http://ftp.gnu.org/gnu/emacs/emacs-22.1.tar.gz
./configure --prefix=/usr/local/emacs-22.1 --with-x-toolkit=lucid

[src]$ ./emacs -nw
Segmentation fault (core dumped)
[src]$ rm core
[src]$ gdb emacs
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "hppa2.0n-hp-hpux11.00"...
TERM = vt100
Breakpoint 1 at 0x17ebd8
(gdb) r -nw
Starting program: /usr/local/devel/dimka/emacs/emacs-22.1/src/emacs -nw

Program received signal SIGSEGV, Segmentation fault.
0x002a92a4 in _free_internal ()
(gdb) where
#0  0x002a92a4 in _free_internal ()
#1  0x002aa274 in free ()
#2  0x001ed49c in emacs_blocked_free ()
#3  0x002aa264 in free ()
#4  0x001eca98 in xfree ()
#5  0x000ee6b0 in tty_default_color_capabilities ()
#6  0x000ef650 in term_init ()
#7  0x0003e680 in init_display ()
#8  0x00150f24 in main ()
#9  0x77ee3460 in _start () from /usr/lib/libc.2
(gdb) k
Kill the program being debugged? (y or n) y
(gdb)

The problem appears to be in the uninitialized static pointers
default_orig_pair, default_set_foreground, default_set_background at the very
beginning of function  tty_default_color_capabilities() in term.c.

Indeed, simply initializing those to NULL values solves the core dump.
Here is the beginning of the fixed function:

static void
tty_default_color_capabilities (save)
     int save;
{
  static char
    *default_orig_pair = NULL,
    *default_set_foreground = NULL,
    *default_set_background = NULL;
....

Hope that helps

--
Dimitry Kloper
dimitry point kloper at gmail point com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: emacs-22.1 coredumps on HPUX 11i
  2007-08-15 15:51 emacs-22.1 coredumps on HPUX 11i Dimitry Kloper
@ 2007-08-16  0:43 ` Glenn Morris
  2007-08-17  7:25   ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Glenn Morris @ 2007-08-16  0:43 UTC (permalink / raw)
  To: Dimitry Kloper; +Cc: bug-gnu-emacs

"Dimitry Kloper" wrote:

> I apologise in case this bug was already reported.

Actually it was, but this is a very timely re-posting, so never mind! :)

> The problem appears to be in the uninitialized static pointers
> default_orig_pair, default_set_foreground, default_set_background at
> the very beginning of function tty_default_color_capabilities() in
> term.c.
>
> Indeed, simply initializing those to NULL values solves the core dump.

Can you test a different fix please: rather than initializing to NULL,
move the declarations of the six static variables above the function,
ie so it looks like:

static int default_max_colors;
static int default_max_pairs;
static int default_no_color_video;
static char *default_orig_pair;
static char *default_set_foreground;
static char *default_set_background;

static void
tty_default_color_capabilities (save)
     int save;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: emacs-22.1 coredumps on HPUX 11i
  2007-08-16  0:43 ` Glenn Morris
@ 2007-08-17  7:25   ` Glenn Morris
  0 siblings, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2007-08-17  7:25 UTC (permalink / raw)
  To: bug-gnu-emacs


For the record, I received this reply off-list:

  Thanks for the answer. I have tested your fix with moving static
  variables out of the function and it works. Emacs does not crash.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-08-17  7:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 15:51 emacs-22.1 coredumps on HPUX 11i Dimitry Kloper
2007-08-16  0:43 ` Glenn Morris
2007-08-17  7:25   ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).