From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Re: Printing to STDERR when %d is "Cannot access memory ..." Date: Wed, 13 Jun 2018 12:34:14 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1528918345 9196 195.159.176.226 (13 Jun 2018 19:32:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 13 Jun 2018 19:32:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 13 21:32:21 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fTBVD-0002Ga-Gg for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 21:32:19 +0200 Original-Received: from localhost ([::1]:36549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTBXK-0000uO-KK for ged-emacs-devel@m.gmane.org; Wed, 13 Jun 2018 15:34:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTBXB-0000t6-H1 for emacs-devel@gnu.org; Wed, 13 Jun 2018 15:34:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTBX7-0003kM-Hu for emacs-devel@gnu.org; Wed, 13 Jun 2018 15:34:21 -0400 Original-Received: from gateway34.websitewelcome.com ([192.185.148.164]:12207) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTBX7-0003jN-CO for emacs-devel@gnu.org; Wed, 13 Jun 2018 15:34:17 -0400 Original-Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway34.websitewelcome.com (Postfix) with ESMTP id 8B4EA99601 for ; Wed, 13 Jun 2018 14:34:16 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id TBX6fYGiuSjJATBX6f72PC; Wed, 13 Jun 2018 14:34:16 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Cc :To:From:Message-ID:Date:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HEAu6ka0YgXBysisnEZwF77edIf3GlFEo2oBYqghDa4=; b=F3EE+CKkPdt2WEh1rM5wWOZRIK CJtbvsuBVddUkvGVa8pp2wxUpdRSLlP03PAkdn/ZSYgHSRmxbfR84xuWvHmaktTYyEcAPyA4EWe4V GrbomCfg/YzZxenqW8fMj+CLiYjtZzAlrveHsdYie0MLmDLzbMJ5Vx1uCv9SopK1DnDZmqp0LyB/1 po8T92ngYVG/8Y5u+83w1+N+4gwNeUgDAk0A/+poXt4Hu2khRurOi4Cc34xGVZBSgRAIDTV+bi6Yv crypknSd6Jj7CnYB6kEmEmLWskkNIu478JmhzMe/KZEPksuJSvg0oTLahSOCFcd2W7oqQ/RLdDDk0 YrvhaJKQ==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:51873 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.91) (envelope-from ) id 1fTBX5-000qvv-NE; Wed, 13 Jun 2018 14:34:15 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Source-L: No X-Exim-ID: 1fTBX5-000qvv-NE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:51873 X-Source-Auth: lawlist X-Email-Count: 5 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.148.164 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226307 Archived-At: Thank you, Eli, for taking a look at this thread. The suggestion by Davi= s to deal with the STDERR message avoids the crash. My STDERR printout (with the NULL font now being assigned a 0 value) is a= s follows: it->c (120021) char (=C3=B0) w->hscroll (0) hscl (false) it->hpos (5) it->vpos (0) it->current_x (55) new_x (55) font->space_width (0) it->lnum_pixel_width (55) it->lnum_width (3) it->first_visible_x (0) relative_x (55) it->face_id (38) foreground_face (magenta) background_face (black) rc (MOVE_X_REACHED) I create the font pointer like this .... It has worked for everything so= far except this special character (U0001D4D5) on Emacs built --with-x. = I believe the face_id is correct in this example because the foreground (= magenta) and background (black) are correctly returned. struct face *face =3D mc_lookup_face (it); struct font *font =3D face->font; Lisp_Object foreground_face =3D face->lface[LFACE_FOREGROUND_INDEX]; Lisp_Object background_face =3D face->lface[LFACE_BACKGROUND_INDEX]; ... using the following function: struct face * mc_lookup_face (struct it *it) { if (!NILP (Vface_remapping_alist) && (it->face_id =3D=3D DEFAULT_FACE_ID /* Qdefault */ || it->face_id =3D=3D MODE_LINE_FACE_ID /* Qmode_line */ || it->face_id =3D=3D MODE_LINE_INACTIVE_FACE_ID /* Qmode_line_= inactive */ || it->face_id =3D=3D HEADER_LINE_FACE_ID /* Qheader_line */ || it->face_id =3D=3D TOOL_BAR_FACE_ID /* Qtool_bar */ || it->face_id =3D=3D FRINGE_FACE_ID /* Qfringe */ || it->face_id =3D=3D SCROLL_BAR_FACE_ID /* Qscroll_bar */ || it->face_id =3D=3D BORDER_FACE_ID /* Qborder */ || it->face_id =3D=3D CURSOR_FACE_ID /* Qcursor */ || it->face_id =3D=3D MOUSE_FACE_ID /* Qmouse */ || it->face_id =3D=3D MENU_FACE_ID /* Qmenu */ || it->face_id =3D=3D WINDOW_DIVIDER_FACE_ID /* Qwindow_divider= */ || it->face_id =3D=3D WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID /* Qwi= ndow_divider_first_pixel */ || it->face_id =3D=3D WINDOW_DIVIDER_LAST_PIXEL_FACE_ID /* Qwin= dow_divider_last_pixel */ || it->face_id =3D=3D VERTICAL_BORDER_FACE_ID /* Qvertical_bord= er */ || it->face_id =3D=3D INTERNAL_BORDER_FACE_ID)) /* Qinternal_bo= rder */ return FACE_FROM_ID (it->f, lookup_basic_face (it->f, it->face_id)); else return FACE_FROM_ID (it->f, it->face_id); } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATE: [06-13-2018 12:11:33] <13 Jun 2018 22:11:33 +0300> FROM: Eli Zaretskii >=20 > > Date: Wed, 13 Jun 2018 11:37:09 -0700 > > From: Keith David Bershatsky > > > > I am working on crosshairs (17684) and multiple fake cursors (22873) = and created a little problem for myself in that a character not recognize= d 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 printin= g said value to STDERR. > > > > GDB returns "Cannot access memory at address 0xa0" when printing the = value of font->space_width. >=20 > This message means that 'font' is a NULL pointer, and that is your > basic problem. You need to find out why 'font' is NULL.