unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fsanitize=bounds-strict caught potential error
       [not found] <87o85vp5hs.fsf.ref@yahoo.com>
@ 2021-12-05 13:04 ` Po Lu
  2021-12-05 13:55   ` Eli Zaretskii
  2021-12-05 15:35   ` Andreas Schwab
  0 siblings, 2 replies; 7+ messages in thread
From: Po Lu @ 2021-12-05 13:04 UTC (permalink / raw)
  To: emacs-devel

I don't know if this message is correct or not, but I got

xdisp.c:30394:37: runtime error: index -1 out of bounds for type 'iterator_stack_entry [5]'

After displaying the Emacs manual and building with
`-fsanitize=undefined,bounds-strict'.

Thanks.



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

* Re: fsanitize=bounds-strict caught potential error
  2021-12-05 13:04 ` fsanitize=bounds-strict caught potential error Po Lu
@ 2021-12-05 13:55   ` Eli Zaretskii
  2021-12-05 15:15     ` Andreas Schwab
  2021-12-05 15:24     ` Andreas Schwab
  2021-12-05 15:35   ` Andreas Schwab
  1 sibling, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-12-05 13:55 UTC (permalink / raw)
  To: Po Lu; +Cc: emacs-devel

> From: Po Lu <luangruo@yahoo.com>
> Date: Sun, 05 Dec 2021 21:04:47 +0800
> 
> I don't know if this message is correct or not, but I got
> 
> xdisp.c:30394:37: runtime error: index -1 out of bounds for type 'iterator_stack_entry [5]'

The compiler doesn't know enough to realize that this code can never
be executed with it->sp < 1.  This code is there since 2003, and never
gave us any trouble.



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

* Re: fsanitize=bounds-strict caught potential error
  2021-12-05 13:55   ` Eli Zaretskii
@ 2021-12-05 15:15     ` Andreas Schwab
  2021-12-05 15:23       ` Eli Zaretskii
  2021-12-05 15:24     ` Andreas Schwab
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2021-12-05 15:15 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, emacs-devel

On Dez 05 2021, Eli Zaretskii wrote:

>> From: Po Lu <luangruo@yahoo.com>
>> Date: Sun, 05 Dec 2021 21:04:47 +0800
>> 
>> I don't know if this message is correct or not, but I got
>> 
>> xdisp.c:30394:37: runtime error: index -1 out of bounds for type 'iterator_stack_entry [5]'
>
> The compiler doesn't know enough to realize that this code can never
> be executed with it->sp < 1.  This code is there since 2003, and never
> gave us any trouble.

It is a runtime error, thus the erroneous access is actually being
executed.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



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

* Re: fsanitize=bounds-strict caught potential error
  2021-12-05 15:15     ` Andreas Schwab
@ 2021-12-05 15:23       ` Eli Zaretskii
  2021-12-05 15:36         ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2021-12-05 15:23 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: luangruo, emacs-devel

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Po Lu <luangruo@yahoo.com>,  emacs-devel@gnu.org
> Date: Sun, 05 Dec 2021 16:15:15 +0100
> 
> >> xdisp.c:30394:37: runtime error: index -1 out of bounds for type 'iterator_stack_entry [5]'
> >
> > The compiler doesn't know enough to realize that this code can never
> > be executed with it->sp < 1.  This code is there since 2003, and never
> > gave us any trouble.
> 
> It is a runtime error, thus the erroneous access is actually being
> executed.

Then let's put an assertion there and find the culprit.  Maybe it's
the min-width feature, which is new on master.



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

* Re: fsanitize=bounds-strict caught potential error
  2021-12-05 13:55   ` Eli Zaretskii
  2021-12-05 15:15     ` Andreas Schwab
@ 2021-12-05 15:24     ` Andreas Schwab
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2021-12-05 15:24 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Po Lu, emacs-devel

On Dez 05 2021, Eli Zaretskii wrote:

>> From: Po Lu <luangruo@yahoo.com>
>> Date: Sun, 05 Dec 2021 21:04:47 +0800
>> 
>> I don't know if this message is correct or not, but I got
>> 
>> xdisp.c:30394:37: runtime error: index -1 out of bounds for type 'iterator_stack_entry [5]'
>
> The compiler doesn't know enough to realize that this code can never
> be executed with it->sp < 1.  This code is there since 2003, and never
> gave us any trouble.

If you put a breakpoint there, you will see it.sp == 0 most of the time
actually.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



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

* Re: fsanitize=bounds-strict caught potential error
  2021-12-05 13:04 ` fsanitize=bounds-strict caught potential error Po Lu
  2021-12-05 13:55   ` Eli Zaretskii
@ 2021-12-05 15:35   ` Andreas Schwab
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2021-12-05 15:35 UTC (permalink / raw)
  To: Po Lu; +Cc: larsi, emacs-devel

On Dez 05 2021, Po Lu wrote:

> I don't know if this message is correct or not, but I got
>
> xdisp.c:30394:37: runtime error: index -1 out of bounds for type 'iterator_stack_entry [5]'

This happens when called by display_min_width.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



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

* Re: fsanitize=bounds-strict caught potential error
  2021-12-05 15:23       ` Eli Zaretskii
@ 2021-12-05 15:36         ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2021-12-05 15:36 UTC (permalink / raw)
  To: schwab, luangruo; +Cc: emacs-devel

> Date: Sun, 05 Dec 2021 17:23:30 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
> 
> > It is a runtime error, thus the erroneous access is actually being
> > executed.
> 
> Then let's put an assertion there and find the culprit.  Maybe it's
> the min-width feature, which is new on master.

Yep, that it is.  Should be fixed now.



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

end of thread, other threads:[~2021-12-05 15:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87o85vp5hs.fsf.ref@yahoo.com>
2021-12-05 13:04 ` fsanitize=bounds-strict caught potential error Po Lu
2021-12-05 13:55   ` Eli Zaretskii
2021-12-05 15:15     ` Andreas Schwab
2021-12-05 15:23       ` Eli Zaretskii
2021-12-05 15:36         ` Eli Zaretskii
2021-12-05 15:24     ` Andreas Schwab
2021-12-05 15:35   ` Andreas Schwab

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