https://bugs.kde.org/show_bug.cgi?id=461074

            Bug ID: 461074
           Summary: valgrind: m_debuginfo/readdwarf.c:2396
                    (copy_convert_CfiExpr_tree): Assertion 'srcix >= 0 &&
                    srcix < VG_(sizeXA)(srcxa)' failed.
    Classification: Developer tools
           Product: valgrind
           Version: 3.20.0
          Platform: unspecified
                OS: Unspecified
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: memcheck
          Assignee: jsew...@acm.org
          Reporter: and...@lightoptech.com
  Target Milestone: ---

Failed assertion on Nvidia Jetson when linking a program with both the ArmPL
(Arm Performance Libraries) and Pthread libraries.

TEST CODE

#include <iostream>

int main(int argc, char *argv[]) 
{
   std::cout << "Hello, world!" << std::endl;
}


BUILD LINE

g++ -g -O0 main.cpp -L/mnt/data/opt/lib -larmpl -lpthread

VALGRIND OUTPUT

==29524== Memcheck, a memory error detector
==29524== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==29524== Using Valgrind-3.20.0-5147d671e4-20221024 and LibVEX; rerun with -h
for copyright info
==29524== Command: ./a.out
==29524== 
--29524-- Valgrind options:
--29524--    -v
--29524-- Contents of /proc/version:
--29524--   Linux version 4.9.201-tegra (buildbrain@mobile-u64-p211-d7000) (gcc
version 7.3.1 20180425 [linaro-7.3-2018.05 revision
d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP
PREEMPT Fri Jul 9 08:56:59 PDT 2021
--29524-- 
--29524-- Arch and hwcaps: ARM64, LittleEndian, v8
--29524-- Page sizes: currently 4096, max supported 65536
--29524-- Valgrind library directory: /mnt/data/opt/libexec/valgrind
--29524-- Reading syms from /mnt/data/andreac/valgrind/minimal/a.out
--29524-- Reading syms from /lib/aarch64-linux-gnu/ld-2.27.so
--29524--   Considering /lib/aarch64-linux-gnu/ld-2.27.so ..
--29524--   .. CRC mismatch (computed b15b924d wanted 3fdedb9a)
--29524--   Considering /usr/lib/debug/lib/aarch64-linux-gnu/ld-2.27.so ..
--29524--   .. CRC is valid
--29524-- Reading syms from /mnt/data/opt/libexec/valgrind/memcheck-arm64-linux
--29524--    object doesn't have a dynamic symbol table
--29524-- Scheduler: using generic scheduler lock implementation.
--29524-- Reading suppressions file:
/mnt/data/opt/libexec/valgrind/default.supp
==29524== embedded gdbserver: reading from
/tmp/vgdb-pipe-from-vgdb-to-29524-by-andreac-on-???
==29524== embedded gdbserver: writing to  
/tmp/vgdb-pipe-to-vgdb-from-29524-by-andreac-on-???
==29524== embedded gdbserver: shared mem  
/tmp/vgdb-pipe-shared-mem-vgdb-29524-by-andreac-on-???
==29524== 
==29524== TO CONTROL THIS PROCESS USING vgdb (which you probably
==29524== don't want to do, unless you know exactly what you're doing,
==29524== or are doing some strange experiment):
==29524==   /mnt/data/opt/libexec/valgrind/../../bin/vgdb --pid=29524
...command...
==29524== 
==29524== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==29524==   /path/to/gdb ./a.out
==29524== and then give GDB the following command
==29524==   target remote | /mnt/data/opt/libexec/valgrind/../../bin/vgdb
--pid=29524
==29524== --pid is optional if only one valgrind process is running
==29524== 
--29524-- REDIR: 0x4017440 (ld-linux-aarch64.so.1:strlen) redirected to
0x580ddaf8 (vgPlain_arm64_linux_REDIR_FOR_strlen)
--29524-- REDIR: 0x40171c0 (ld-linux-aarch64.so.1:strcmp) redirected to
0x580ddb4c (vgPlain_arm64_linux_REDIR_FOR_strcmp)
--29524-- REDIR: 0x40170c0 (ld-linux-aarch64.so.1:index) redirected to
0x580ddb20 (vgPlain_arm64_linux_REDIR_FOR_index)
--29524-- Reading syms from
/mnt/data/opt/libexec/valgrind/vgpreload_core-arm64-linux.so
--29524-- Reading syms from
/mnt/data/opt/libexec/valgrind/vgpreload_memcheck-arm64-linux.so
--29524-- Reading syms from /mnt/data/opt/lib/libarmpl.so
--29524-- Reading syms from /lib/aarch64-linux-gnu/libpthread-2.27.so
--29524--   Considering
/usr/lib/debug/.build-id/91/7e5291593df1ff1ac5d4db7309660570909a5d.debug ..
--29524--   .. build-id is valid
--29524-- Reading syms from /lib/aarch64-linux-gnu/libc-2.27.so
--29524--   Considering /lib/aarch64-linux-gnu/libc-2.27.so ..
--29524--   .. CRC mismatch (computed b0b5496f wanted a703a76c)
--29524--   Considering /usr/lib/debug/lib/aarch64-linux-gnu/libc-2.27.so ..
--29524--   .. CRC is valid
==29524== WARNING: new redirection conflicts with existing -- ignoring it
--29524--     old: 0x06ad8e00 (memalign            ) R-> (1011.0) 0x0484c844
memalign
--29524--     new: 0x06ad8e00 (memalign            ) R-> (1017.0) 0x0484c804
aligned_alloc
==29524== WARNING: new redirection conflicts with existing -- ignoring it
--29524--     old: 0x06ad8e00 (memalign            ) R-> (1011.0) 0x0484c844
memalign
--29524--     new: 0x06ad8e00 (memalign            ) R-> (1017.0) 0x0484c7c4
aligned_alloc
==29524== WARNING: new redirection conflicts with existing -- ignoring it
--29524--     old: 0x06ad8e00 (memalign            ) R-> (1011.0) 0x0484c844
memalign
--29524--     new: 0x06ad8e00 (memalign            ) R-> (1017.0) 0x0484c804
aligned_alloc
==29524== WARNING: new redirection conflicts with existing -- ignoring it
--29524--     old: 0x06ad8e00 (memalign            ) R-> (1011.0) 0x0484c844
memalign
--29524--     new: 0x06ad8e00 (memalign            ) R-> (1017.0) 0x0484c7c4
aligned_alloc
--29524-- Reading syms from /mnt/data/opt/lib/libamath.so
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11
--29524-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x11

valgrind: m_debuginfo/readdwarf.c:2822 (copy_convert_CfiExpr_tree): Assertion
'srcix >= 0 && srcix < VG_(sizeXA)(srcxa)' failed.

host stacktrace:
==29524==    at 0x5805274C: show_sched_status_wrk (m_libcassert.c:406)
==29524==    by 0x5805287B: report_and_quit (m_libcassert.c:477)
==29524==    by 0x580529DF: vgPlain_assert_fail (m_libcassert.c:543)
==29524==    by 0x580E7A03: copy_convert_CfiExpr_tree (readdwarf.c:2822)
==29524==    by 0x580E7DBF: summarise_context.isra.19 (readdwarf.c:2382)
==29524==    by 0x580EE75F: run_CF_instructions (readdwarf.c:4009)
==29524==    by 0x580EE75F: vgModuleLocal_read_callframe_info_dwarf3
(readdwarf.c:4565)
==29524==    by 0x58096627: vgModuleLocal_read_elf_debug_info (readelf.c:3510)
==29524==    by 0x5808B757: di_notify_ACHIEVE_ACCEPT_STATE (debuginfo.c:969)
==29524==    by 0x5808B757: vgPlain_di_notify_mmap (debuginfo.c:1435)
==29524==    by 0x580BFEA3: vgModuleLocal_generic_PRE_sys_mmap
(syswrap-generic.c:2466)
==29524==    by 0x580CE313: vgSysWrap_arm64_linux_sys_mmap_before
(syswrap-arm64-linux.c:311)
==29524==    by 0x580BA6D3: vgPlain_client_syscall (syswrap-main.c:2239)
==29524==    by 0x580B67A7: handle_syscall (scheduler.c:1211)
==29524==    by 0x580B869B: vgPlain_scheduler (scheduler.c:1529)
==29524==    by 0x5810D6DB: thread_wrapper (syswrap-linux.c:102)
==29524==    by 0x5810D6DB: run_a_thread_NORETURN (syswrap-linux.c:155)
==29524==    by 0xFFFFFFFFFFFFFFFF: ???

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable syscall 222 (lwpid 29524)
==29524==    at 0x4016D44: mmap (mmap64.c:59)
==29524==    by 0x4005627: _dl_map_segments (dl-map-segments.h:94)
==29524==    by 0x4005627: _dl_map_object_from_fd (dl-load.c:1181)
==29524==    by 0x4007C5F: _dl_map_object (dl-load.c:2460)
==29524==    by 0x400BCE7: openaux (dl-deps.c:63)
==29524==    by 0x4015A53: _dl_catch_exception (dl-error-skeleton.c:196)
==29524==    by 0x400C057: _dl_map_object_deps (dl-deps.c:249)
==29524==    by 0x40037EF: dl_main (rtld.c:1726)
==29524==    by 0x4014D6F: _dl_sysdep_start (dl-sysdep.c:253)
==29524==    by 0x40018C3: _dl_start_final (rtld.c:414)
==29524==    by 0x4001B47: _dl_start (rtld.c:523)
==29524==    by 0x40011C7: ??? (in /lib/aarch64-linux-gnu/ld-2.27.so)
client stack range: [0x1FFEFFD000 0x1FFF000FFF] client SP: 0x1FFEFFEB00
valgrind stack range: [0x1002EBC000 0x1002FBBFFF] top usage: 17056 of 1048576


Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what OS and version you are using.  Thanks.

SYSTEM INFO:

Linux jetson 4.9.201-tegra #1 SMP PREEMPT Fri Jul 9 08:56:59 PDT 2021 aarch64
aarch64 aarch64 GNU/Linux
gcc version 7.5.0
valgrind version 3.20.0
ArmPL version 21.1_Ubuntu-18.04_gcc-7.5

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to