all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Printing to STDERR when %d is "Cannot access memory ..."
Date: Wed, 13 Jun 2018 11:37:09 -0700	[thread overview]
Message-ID: <m2in6mh6sq.wl%esq@lawlist.com> (raw)

I am working on crosshairs (17684) and multiple fake cursors (22873) and created a little problem for myself in that a character not recognized by the font (U0001D4D5) [aka a pretty letter f] on a line all by itself does not have a font->space_width and causes Emacs to crash when printing said value to STDERR.

GDB returns "Cannot access memory at address 0xa0" when printing the value of font->space_width.

This came about by using the following setting for a Form Feed character:

(setq buffer-display-table (make-display-table))
(aset buffer-display-table
      ?\014
      (vector (make-glyph-code ?\U0001D4D5 'font-lock-warning-face)))

I am by passing the problem by not using ?\U0001D4D5.  However, I would like to come up with programmatic solution to avoid crashing Emacs when printing values to STDERR.

I tried:

fprintf (stderr, "(%d)", (font->space_width == NULL
                          ? 0
                          : font->space_width);

However, that didn't fix the problem.

Thanks,

Keith



             reply	other threads:[~2018-06-13 18:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 18:37 Keith David Bershatsky [this message]
2018-06-13 18:50 ` Printing to STDERR when %d is "Cannot access memory ..." Davis Herring
2018-06-13 19:11 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2018-06-13 19:34 Keith David Bershatsky
2018-06-13 19:34 Keith David Bershatsky
2018-06-13 19:46 ` Eli Zaretskii
2018-06-13 21:37 Keith David Bershatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2in6mh6sq.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.