[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: UBSAN errors in tinfo/read_entry.c's convert_32bits
From: |
Thomas Dickey |
Subject: |
Re: UBSAN errors in tinfo/read_entry.c's convert_32bits |
Date: |
Fri, 6 Jan 2023 16:38:32 -0500 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Fri, Jan 06, 2023 at 09:29:55AM +0000, Sam James wrote:
> Hi,
>
> When building ncurses 6.4 with UndefinedBehaviorSanitizer
> (-fsanitize=undefined),
> I got the following when running `tput capname` (it happens during various
> real world
> invocations of ncurses but this is the simplest);
> ```
> $ export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=0
> $ tput capname
> /var/tmp/portage/sys-libs/ncurses-6.4/work/ncurses-6.4/ncurses/tinfo/read_entry.c:92:24:
> runtime error: left shift of 255 by 24 places cannot be represented in type
> 'int'
> #0 0x7f7f228c1e62 in convert_32bits
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/ncurses/tinfo/read_entry.c:92
> #1 0x7f7f228fe811 in _nc_read_termtype
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/ncurses/tinfo/read_entry.c:369
> #2 0x7f7f2290078a in _nc_read_file_entry
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/ncurses/tinfo/read_entry.c:576
> #3 0x7f7f22900b96 in _nc_read_tic_entry
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/ncurses/tinfo/read_entry.c:830
> #4 0x7f7f22901ba9 in _nc_read_entry2
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/ncurses/tinfo/read_entry.c:874
> #5 0x7f7f228dddc7 in _nc_setup_tinfo
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/ncurses/tinfo/lib_setup.c:496
> #6 0x7f7f228de9d0 in _nc_setupterm
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/ncurses/tinfo/lib_setup.c:779
> #7 0x561208b281a5 in main
> /usr/src/debug/sys-libs/ncurses-6.4/ncurses-6.4/progs/tput.c:398
> #8 0x7f7f220eb64f (/usr/lib64/libc.so.6+0x2364f)
> #9 0x7f7f220eb708 in __libc_start_main (/usr/lib64/libc.so.6+0x23708)
> #10 0x561208b28a54 in _start (/usr/bin/tput+0x3a54)
> ```
>
> This is on x86_64-pc-linux-gnu w/ GCC 12.2.1_p20221231.
I see that, now (thanks)
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
signature.asc
Description: PGP signature