unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Alan Third <alan@idiocy.org>,
	Emacs developers <emacs-devel@gnu.org>, raman <raman@google.com>
Subject: Re: san_ignore_object not found at link time
Date: Sat, 1 Aug 2020 21:21:01 +0200	[thread overview]
Message-ID: <CAArVCkSQ34ErQYQ_=z6YAckgvsJuxQhgZLifwc7YeHUiRP_b5w@mail.gmail.com> (raw)
In-Reply-To: <CAArVCkS2WTJOfRBE6wwr9Qt8SYx4X_Yzm06=h7QaNmfGk-sSsQ@mail.gmail.com>

Am Sa., 1. Aug. 2020 um 21:17 Uhr schrieb Philipp Stephani
<p.stephani2@gmail.com>:
>
> Am Sa., 1. Aug. 2020 um 20:35 Uhr schrieb Philipp Stephani
> <p.stephani2@gmail.com>:
> >
> > Am Sa., 1. Aug. 2020 um 20:32 Uhr schrieb Eli Zaretskii <eliz@gnu.org>:
> > >
> > > > From: Philipp Stephani <p.stephani2@gmail.com>
> > > > Date: Sat, 1 Aug 2020 20:29:29 +0200
> > > > Cc: Alan Third <alan@idiocy.org>, raman <raman@google.com>,
> > > >       Emacs developers <emacs-devel@gnu.org>
> > > >
> > > > >   alloc.c: In function 'mark_maybe_object':
> > > > >   alloc.c:4641:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> > > > >    4641 |   void *po = (char *) ((intptr_t) (char *) XLP (obj)
> > > > >         |              ^
> > > > >
> > > > > This is a 32-bit build --with-wide-int, in case it matters, where
> > > > > EMACS_INT is a 64-bit data type.
> > > >
> > > > This is due to the unrelated commit a2323c7ccb. (I just happened to
> > > > push both commits at the same time.)
> > > > It looks like LISP_WORD_TAG in a wide int build is a 64-bit number, so
> > > > that the entire expression gets widened to a 64-bit number. However,
> > > > since it's cast back to a pointer, the value has to fit in 32 bits.
> > >
> > > The pointer is there, you just cannot safely extract it by casting to
> > > a narrower data type.  You need to explicitly mask the MSBs by
> > > shifting or some other bit fiddling.
> >
> > IIUC casting between unsigned integer types is guaranteed to have the
> > same effect.
>
> I've now used INT_SUBTRACT_WRAPV, which should guarantee that the
> offset is defined and fits within an intptr_t.

However, I guess when using wide ints *and* MSB tags the subtraction
might overflow, so maybe the assertion should be conditioned on that
case.



  reply	other threads:[~2020-08-01 19:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01 14:10 san_ignore_object not found at link time T.V Raman
2020-08-01 14:37 ` Eli Zaretskii
2020-08-01 14:45   ` T.V Raman
2020-08-01 14:45   ` Eli Zaretskii
2020-08-01 15:02     ` Philipp Stephani
2020-08-01 15:38     ` Alan Third
2020-08-01 17:32       ` Philipp Stephani
2020-08-01 17:51         ` Eli Zaretskii
2020-08-01 18:02           ` Eli Zaretskii
2020-08-01 18:33             ` Philipp Stephani
2020-08-01 18:52             ` Andreas Schwab
2020-08-01 18:29           ` Philipp Stephani
2020-08-01 18:32             ` Eli Zaretskii
2020-08-01 18:35               ` Philipp Stephani
2020-08-01 19:17                 ` Philipp Stephani
2020-08-01 19:21                   ` Philipp Stephani [this message]
2020-08-01 19:21                   ` Eli Zaretskii
2020-08-01 19:26                     ` Eli Zaretskii
2020-08-01 19:40                       ` Philipp Stephani
2020-08-02 16:08                         ` Eli Zaretskii
2020-08-01 18:09         ` T.V Raman
2020-08-01 18:13         ` Alan Third
2020-08-01 16:43     ` T.V Raman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAArVCkSQ34ErQYQ_=z6YAckgvsJuxQhgZLifwc7YeHUiRP_b5w@mail.gmail.com' \
    --to=p.stephani2@gmail.com \
    --cc=alan@idiocy.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=raman@google.com \
    /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 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).