unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Crash in tparam.c on OpenBSD
@ 2004-01-01 22:54 Casper Gripenberg
  2004-01-02  9:25 ` Eli Zaretskii
       [not found] ` <mailman.868.1073039641.868.bug-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Casper Gripenberg @ 2004-01-01 22:54 UTC (permalink / raw)


Hi,

I'm running OBSD 3.3 with a recently compiled 
GNU Emacs 21.3.1 (i386-unknown-openbsd3.3, X toolkit, Xaw3d 
scroll bars). This is compiled straight from the original
emacs source:

 > ls 
 ... 20399831 Mar 19  2003 emacs-21.3.tar.gz

Emacs works fine, except if I happen to run emacs with
TERM set, but not TERMCAP set. This situation arises when
I run emacs with sudo, as sudo cleans out the TERMCAP
variable for security reasons (yeah I know..what 
security, when emacs is run as root..but that's beside
the point :)).

When I run without TERMCAP (manually unset TERMCAP or
through sudo) emacs will dump core when there is anything
it is about to highlite. I.e. if I do an i-search and
emacs finds a match then BOOM..instant core. 

If I set TERM to vt100 then it seems to work OK, but
for example TERM=linux or xterm-xfree86 and I get the
crash. When I gdb the core I see an abort() call being
made in tparam.c on line 298:

	    case 'D':		/* %D means weird Delta Data transformation.  */
	      argp[0] -= 2 * (tem % 16);
	      break;

	    default:
>	      abort ();
	    }
	}


The reason for the abort call is in the arguments to the
method tparam1:

(gdb) up
#1  0x86ec8 in fatal_error_signal (sig=6) at emacs.c:354
(gdb) up
#2  0x4015f004 in ?? ()
(gdb) up
#3  0x123bd5 in tparam1 (string=0x49b105 "\e[3%p1%dm", 
    outstring=0x5904c0 "\e[3", len=0, up=0x0, left=0x0, argp=0xcfbfc088)
    at tparam.c:298
(gdb) 

See the string "\e[3%p1%dm". This string conains %p, which
seems to me is not recognized by the parsing algorithm in
tparam1(). Hence the abort() call.

Now going up two levels we get here:

(gdb) up
#4  0x123709 in tparam (string=0x49b105 "\e[3%p1%dm", outstring=0x0, len=0, 
    arg0=6, arg1=2496000, arg2=1, arg3=8) at tparam.c:105
(gdb) up
#5  0x4b3a9 in turn_on_face (f=0x261600, face_id=11) at term.c:2107
(gdb) 

Which looks like this:

      if (fg >= 0 && TS_set_foreground)
	{
>	  p = tparam (TS_set_foreground, NULL, 0, (int) fg);
	  OUTPUT (p);
	  xfree (p);
	}

Where TS_set_foreground is the "\e[3%p1%dm" string.

I have no idea what all this means, or what the tparam method
does, or anything about TERMCAP...so I'm not going to draw
any conclusions :) But it makes me interested..where does
the %p come from, and why does emacs not know what to do
with it (should it know? probaby not?).

I put the termcap as well as the full 'gdb where' here:

http://zoidberg.homeip.net/emacsbug/

Regards,
  Casper

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

end of thread, other threads:[~2004-01-04  2:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-01 22:54 Crash in tparam.c on OpenBSD Casper Gripenberg
2004-01-02  9:25 ` Eli Zaretskii
2004-01-02 13:43   ` Casper Gripenberg
     [not found] ` <mailman.868.1073039641.868.bug-gnu-emacs@gnu.org>
2004-01-02 11:01   ` Thomas Dickey
2004-01-03 11:48     ` Eli Zaretskii
     [not found]     ` <mailman.897.1073134721.868.bug-gnu-emacs@gnu.org>
2004-01-04  2:25       ` Thomas Dickey

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).