bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set_labels_identifiers_target -fsanitize=undefined error


From: Sam James
Subject: Re: set_labels_identifiers_target -fsanitize=undefined error
Date: Sat, 04 Nov 2023 13:10:47 +0000
User-agent: mu4e 1.10.7; emacs 30.0.50

John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> writes:

> Hi Gavin!
>
> On Sat, 2023-11-04 at 11:00 +0000, Gavin Smith wrote:
>> The line in question is:
>> 
>>   memcpy (targets, list_of_labels, labels_number * sizeof(LABEL));
>> 
>> - again, the second argument of memcpy.
>> 
>> However, main/targets.c was only introduced after Texinfo 7.1 so
>> this is not the original problem.
>
> I'll provide a backtrace as well as the commit that introduced the regression
> on SPARC within the next days. Need to set up two new SPARC servers next week
> first.
>

OK, I tried this out on sparc with Gavin's fix on master, and got...

export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1
./autogen.sh;  ./configure PERL_EXT_CFLAGS="-O2 -ggdb3
-fsanitize=undefined" CFLAGS="-O2 -ggdb3 -fsanitize=undefined"   ; make
-j$(nproc) ; make check -j$(nproc)

parsetexi/tree.c:77:11: runtime error: member access within misaligned address 
0x0100010e9744 for type 'struct ELEMENT', which requires 8 byte alignment
0x0100010e9744: note: pointer points here
  00 00 01 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 
00 00 00 00 00 00 00
              ^
    #0 0xfff8000102fc12ec in new_element parsetexi/tree.c:77
    #1 0xfff8000102fc12ec in new_element parsetexi/tree.c:77
    #2 0xfff8000102fabee4 in setup_document_root_and_before_node_section 
parsetexi/parser.c:521
    #3 0xfff8000102fbc584 in parse_texi_document parsetexi/parser.c:532
    #4 0xfff8000102f84338 in parse_file parsetexi/api.c:231
    #5 0xfff8000102f73f28 in XS_Texinfo__Parser_parse_file 
parsetexi/Parsetexi.c:239
    #6 0xfff80001004563bc  (/usr/lib64/libperl.so.5.38+0x1563bc)
    #7 0xfff800010044ae64 in Perl_runops_standard 
(/usr/lib64/libperl.so.5.38+0x14ae64)
    #8 0xfff800010037a2b4 in perl_run (/usr/lib64/libperl.so.5.38+0x7a2b4)
    #9 0x10000000d10 in main (/usr/bin/perl+0xd10)
    #10 0xfff800010092a894 in __libc_start_call_main 
../sysdeps/nptl/libc_start_call_main.h:58
    #11 0xfff800010092a99c in __libc_start_main_impl 
/usr/src/debug/sys-libs/glibc-2.37-r3/glibc-2.37/csu/libc-start.c:360
    #12 0x10000000d74 in _start (/usr/bin/perl+0xd74)

The test suite logs have loads of the same violation with ELEMENT, so I
suspect this is the root problem (before I built the perl modules with
PERL_EXT_CFLAGS with UBSAN, I got the Bus Error originally reported.)

I have not tried to reproduce the alignment problem on amd64 with 
PERL_EXT_CFLAGS.

> Adrian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]