runtime error: load of value 4294967293, which is not a valid value for type 'const lyx::Update::flags'

Scott Kostyshak skostysh at lyx.org
Sun Jan 23 14:41:26 UTC 2022


On Sun, Jan 23, 2022 at 10:43:11AM +0100, Kornel Benko wrote:
> Am Sat, 22 Jan 2022 19:06:59 +0100
> schrieb Kornel Benko <kornel at lyx.org>:
> 
> > Am Sat, 22 Jan 2022 18:35:12 +0100
> > schrieb Kornel Benko <kornel at lyx.org>:
> > 
> > > Am Sat, 22 Jan 2022 10:04:44 -0500
> > > schrieb Scott Kostyshak <skostysh at lyx.org>:
> > >   
> > > > With Clang and fsanitize, I get the following error when I open a buffer:
> > > > 
> > > >   runtime error: load of value 4294967293, which is not a valid value for type
> > > > 'const lyx::Update::flags'
> > > > 
> > > > Attached is the backtrace (which is printed to terminal if I set 'export
> > > > UBSAN_OPTIONS=print_stacktrace=1').
> > > > 
> > > > Scott    
> > > 
> > > I see the same here. (No crash, but the messages on terminal)
> > > 
> > > 	Kornel  
> > 
> > If I understand it correctly, the routine
> > 	inline flags operator&(flags const f, flags const g)
> > gets the value f as:
> > 	(update_flags & ~Update::Force)
> > Since 32-bit-value 4294967293 is the same as '~Update::Force', which is too big for
> > 32-bit integer, we possibly have the same 'problem' as with colors.
> > 
> > BTW Update::Force is defined as '2' and the hex value of 4294967293 is FFFFFFFD.
> > 
> > 	Kornel
> 
> Here 2 possible patches which do not show the behaviour.
> (I prefer the number 2)

Why is this issue that fsanitize found not actually a "real issue"? Why
does it not lead to any potential bug? I never understood that with the
color code either. Does it depend on the compiler?

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220123/db3ba6f9/attachment.asc>


More information about the lyx-devel mailing list