Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7931 Discussions

debug info with dwarf split not avaiable

Frank_R_1
Beginner
651 Views

Dear support,

We use Intel oneAPI 2023.1.0 on LINUX RHEL8.7 and have encountered a problem with debug info when using -gsplit-dwarf compiler option in icx compiler.
The classic icc works as expected.
We are using Totalview 2023.6.1 as debugger and get the message no source file available.

Consider the following example file a.c:

#include<stdio.h>

int main() {
printf("TEST");
return 0;
}

Compile the example with:
icx -O0 -g -gsplit-dwarf -fuse-ld=lld -Wl,--gdb-index a.c
objdump --syms a.out
a.out: Found separate debug object file: /data/a.dwo


a.out: file format elf64-x86-64

SYMBOL TABLE:
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c_end
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c.hot
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c_end.hot
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c.unlikely
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c_end.unlikely
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c.startup
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c_end.startup
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c.exit
000000000020160f l .text 0000000000000000 .hidden .annobin_init.c_end.exit
0000000000201610 l .text 0000000000000000 .hidden .annobin_static_reloc.c
000000000020160f l .text 0000000000000000 .hidden .annobin_static_reloc.c_end
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c.hot
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.hot
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c.unlikely
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.unlikely
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c.startup
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.startup
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c.exit
0000000000201615 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.exit
0000000000201610 l .text 0000000000000000 .hidden .annobin__dl_relocate_static_pie.start
0000000000201615 l .text 0000000000000000 .hidden .annobin__dl_relocate_static_pie.end
0000000000201610 l F .text 0000000000000005 .hidden _dl_relocate_static_pie
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
00000000002039a8 l O .tm_clone_table 0000000000000000 __TMC_LIST__
0000000000201620 l F .text 0000000000000000 deregister_tm_clones
0000000000201650 l F .text 0000000000000000 register_tm_clones
0000000000201690 l F .text 0000000000000000 __do_global_dtors_aux
00000000002039c8 l O .bss 0000000000000001 completed.0
00000000002027d0 l O .fini_array 0000000000000000 __do_global_dtors_aux_fini_array_entry
00000000002016c0 l F .text 0000000000000000 frame_dummy
00000000002027d8 l O .init_array 0000000000000000 __frame_dummy_init_array_entry
00000000002004d0 l O .rodata 0000000000000000 .hidden __dso_handle
0000000000000000 l df *ABS* 0000000000000000 a.c
0000000000201700 l .text 0000000000000000 .hidden .annobin_elf_init.c
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c_end
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c.hot
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.hot
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c.unlikely
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.unlikely
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c.startup
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.startup
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c.exit
0000000000201775 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.exit
0000000000201700 l .text 0000000000000000 .hidden .annobin___libc_csu_init.start
0000000000201765 l .text 0000000000000000 .hidden .annobin___libc_csu_init.end
0000000000201765 l .text 0000000000000000 .hidden .annobin___libc_csu_fini.start
0000000000201775 l .text 0000000000000000 .hidden .annobin___libc_csu_fini.end
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
0000000000200518 l O .eh_frame 0000000000000000 __FRAME_END__
00000000002039a8 l O .tm_clone_table 0000000000000000 .hidden __TMC_END__
00000000002039a8 l .got.plt 0000000000000000 .hidden _GLOBAL_OFFSET_TABLE_
00000000002027d8 l .init_array 0000000000000000 .hidden __init_array_start
00000000002027e0 l .init_array 0000000000000000 .hidden __init_array_end
00000000002027e0 l .dynamic 0000000000000000 .hidden _DYNAMIC
0000000000201778 l F .init 0000000000000000 .hidden _init
0000000000201794 l F .fini 0000000000000000 .hidden _fini
0000000000201770 g F .text 0000000000000005 __libc_csu_fini
00000000002015e0 g F .text 000000000000002f _start
0000000000201700 g F .text 0000000000000065 __libc_csu_init
00000000002016d0 g F .text 0000000000000028 main
00000000002039a0 w .data 0000000000000000 data_start
00000000002004c8 g O .rodata 0000000000000004 _IO_stdin_used
0000000000000000 F *UND* 0000000000000000 __libc_start_main
00000000002039a0 g .data 0000000000000000 __data_start
0000000000000000 w *UND* 0000000000000000 __gmon_start__
0000000000000000 w *UND* 0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 w *UND* 0000000000000000 _ITM_registerTMCloneTable
0000000000000000 F *UND* 0000000000000000 printf

 

icc -O0 -g -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index a.c
icc: remark #10441: The Intel(R) C++ Compiler Classic (ICC) is deprecated and will be removed from product release in the second half of 2023. The Intel(R) oneAPI DPC++/C++ Compiler (ICX) is the recommended compiler moving forward. Please transition to use this compiler. Use '-diag-disable=10441' to disable this message.
objdump --syms a.out
a.out: Found separate debug object file: /data/a.dwo


a.out: file format elf64-x86-64

SYMBOL TABLE:
000000000040051f l .text 0000000000000000 .hidden .annobin_init.c
000000000040051f l .text 0000000000000000 .hidden .annobin_init.c_end
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c.hot
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c_end.hot
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c.unlikely
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c_end.unlikely
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c.startup
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c_end.startup
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c.exit
00000000004004f0 l .text 0000000000000000 .hidden .annobin_init.c_end.exit
0000000000400520 l .text 0000000000000000 .hidden .annobin_static_reloc.c
000000000040051f l .text 0000000000000000 .hidden .annobin_static_reloc.c_end
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c.hot
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.hot
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c.unlikely
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.unlikely
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c.startup
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.startup
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c.exit
00000000004004f0 l .text 0000000000000000 .hidden .annobin_static_reloc.c_end.exit
0000000000400520 l .text 0000000000000000 .hidden .annobin__dl_relocate_static_pie.start
0000000000400525 l .text 0000000000000000 .hidden .annobin__dl_relocate_static_pie.end
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
0000000000402010 l O .tm_clone_table 0000000000000000 __TMC_LIST__
0000000000400530 l F .text 0000000000000000 deregister_tm_clones
0000000000400560 l F .text 0000000000000000 register_tm_clones
00000000004005a0 l F .text 0000000000000000 __do_global_dtors_aux
0000000000402010 l O .bss 0000000000000001 completed.0
0000000000401da8 l O .fini_array 0000000000000000 __do_global_dtors_aux_fini_array_entry
00000000004005d0 l F .text 0000000000000000 frame_dummy
0000000000401db0 l O .init_array 0000000000000000 __frame_dummy_init_array_entry
0000000000000000 l df *ABS* 0000000000000000 a.c
0000000000000000 l O .debug_info 0000000000000000 .debug_info_seg
0000000000400600 l .text 0000000000000000 .hidden .annobin_elf_init.c
0000000000400675 l .text 0000000000000000 .hidden .annobin_elf_init.c_end
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c.hot
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.hot
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c.unlikely
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.unlikely
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c.startup
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.startup
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c.exit
00000000004004f0 l .text 0000000000000000 .hidden .annobin_elf_init.c_end.exit
0000000000400600 l .text 0000000000000000 .hidden .annobin___libc_csu_init.start
0000000000400665 l .text 0000000000000000 .hidden .annobin___libc_csu_init.end
0000000000400665 l .text 0000000000000000 .hidden .annobin___libc_csu_fini.start
0000000000400675 l .text 0000000000000000 .hidden .annobin___libc_csu_fini.end
0000000000000000 l df *ABS* 0000000000000000 crtstuff.c
00000000004007b0 l O .eh_frame 0000000000000000 __FRAME_END__
0000000000400520 l F .text 0000000000000005 .hidden _dl_relocate_static_pie
00000000004004b0 l F .init 0000000000000000 .hidden _init
0000000000400678 l F .fini 0000000000000000 .hidden _fini
0000000000400690 l O .rodata 0000000000000000 .hidden __dso_handle
0000000000402010 l O .tm_clone_table 0000000000000000 .hidden __TMC_END__
0000000000401db8 l O .dynamic 0000000000000210 .hidden _DYNAMIC
0000000000401db0 l .init_array 0000000000000000 .hidden __init_array_start
0000000000401db8 l .init_array 0000000000000000 .hidden __init_array_end
0000000000401fe8 l O .got.plt 0000000000000020 .hidden _GLOBAL_OFFSET_TABLE_
0000000000402010 g .fini_array 0000000000000000 __bss_start
0000000000402010 g .fini_array 0000000000000000 _edata
0000000000402014 g .fini_array 0000000000000000 _end
0000000000000000 F *UND* 0000000000000000 __libc_start_main
0000000000000000 F *UND* 0000000000000000 printf
0000000000000000 w *UND* 0000000000000000 _ITM_registerTMCloneTable
0000000000000000 w *UND* 0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 w *UND* 0000000000000000 __gmon_start__
0000000000402008 g .data 0000000000000000 __data_start
0000000000400688 g O .rodata 0000000000000004 _IO_stdin_used
0000000000402008 w .data 0000000000000000 data_start
00000000004005d8 g F .text 0000000000000024 main
0000000000400600 g F .text 0000000000000065 __libc_csu_init
00000000004004f0 g F .text 000000000000002f _start
0000000000400670 g F .text 0000000000000005 __libc_csu_fini
0000000000000000 l d .debug_info.dwo 0000000000000000 .debug_info.dwo
0000000000000000 l d .debug_line.dwo 0000000000000000 .debug_line.dwo
0000000000000000 l d .debug_abbrev.dwo 0000000000000000 .debug_abbrev.dwo
0000000000000000 l d .debug_str.dwo 0000000000000000 .debug_str.dwo
0000000000000000 l d .debug_str_offsets.dwo 0000000000000000 .debug_str_offsets.dwo
0000000000000000 l O .debug_info.dwo 0000000000000000 .debug_info.dwo_seg

As you can see the debug section is not present when compiling with icx and -gsplit-dwarf option.
icc delivers executable with debug information as expected
We really want to use -gsplit-dwarf option because this speed up linking and copying process a lot!

What are we doing wrong or is this a compiler bug?

Best regards
Frank

0 Kudos
5 Replies
VaishnaviV_Intel
Moderator
606 Views

Hi,

 

Thanks for posting in Intel Communities.

 

We have tried executing your code, we are able to get the debug information with the following commands,

 

icc: icc -O0 -g -gsplit-dwarf a.c
icx: icx -O0 -g -gsplit-dwarf a.c

 

Please let us know, if you still face any issues.

 

Thanks & Regards, 

Vankudothu Vaishnavi.

 

 

0 Kudos
Frank_R_1
Beginner
562 Views

Hi,

It works by removing the option

-Wl,--gdb-index

which was necessary for icc.

Unfortunately we got this during build

#0 0x0000563cc63a9c13 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/net/avdi0de055/data/p4ws/repo_cache/software/intel/oneAPI/2023.1.0/linux/compiler/2023.1.0/linux/bin-llvm/ld.lld+0x29dcc13)
#1 0x0000563cc63a80d0 llvm::sys::RunSignalHandlers() (/net/avdi0de055/data/p4ws/repo_cache/software/intel/oneAPI/2023.1.0/linux/compiler/2023.1.0/linux/bin-llvm/ld.lld+0x29db0d0)
#2 0x0000563cc63aa50f SignalHandler(int) Signals.cpp:0:0
#3 0x00007f7247583cf0 __restore_rt (/lib64/libpthread.so.0+0x12cf0)
#4 0x0000563cc64d41f3 bool llvm::DenseMapBase<llvm::DenseMap<llvm::CachedHashStringRef, lld::elf::InputFile const*, llvm::DenseMapInfo<llvm::CachedHashStringRef, void>, llvm::detail::DenseMapPair<llvm::CachedHashStringRef, lld::elf::InputFile const*>>, llvm::CachedHashStringRef, lld::elf::InputFile const*, llvm::DenseMapInfo<llvm::CachedHashStringRef, void>, llvm::detail::DenseMapPair<llvm::CachedHashStringRef, lld::elf::InputFile const*>>::LookupBucketFor<llvm::CachedHashStringRef>(llvm::CachedHashStringRef const&, llvm::detail::DenseMapPair<llvm::CachedHashStringRef, lld::elf::InputFile const*> const*&) const InputFiles.cpp:0:0
#5 0x0000563cc64bc8da lld::elf::ObjFile<llvm::object::ELFType<(llvm::support::endianness)1, true>>::createInputSection(unsigned int, llvm::object::Elf_Shdr_Impl<llvm::object::ELFType<(llvm::support::endianness)1, true>> const&, llvm::StringRef) (/net/avdi0de055/data/p4ws/repo_cache/software/intel/oneAPI/2023.1.0/linux/compiler/2023.1.0/linux/bin-llvm/ld.lld+0x2aef8da)
#6 0x0000563cc64be423 lld::elf::ObjFile<llvm::object::ELFType<(llvm::support::endianness)1, true>>::initializeSections(bool, llvm::object::ELFFile<llvm::object::ELFType<(llvm::support::endianness)1, true>> const&) (/net/avdi0de055/data/p4ws/repo_cache/software/intel/oneAPI/2023.1.0/linux/compiler/2023.1.0/linux/bin-llvm/ld.lld+0x2af1423)
#7 0x0000563cc64bdb62 lld::elf::ObjFile<llvm::object::ELFType<(llvm::support::endianness)1, true>>::initSectionsAndLocalSyms(bool) (/net/avdi0de055/data/p4ws/repo_cache/software/intel/oneAPI/2023.1.0/linux/compiler/2023.1.0/linux/bin-llvm/ld.lld+0x2af0b62)
#8 0x0000563cc63d7bb2 std::__1::__function::__func<llvm::parallelFor(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>)::$_0, std::__1::allocator<llvm::parallelFor(unsigned long, unsigned long, llvm::function_ref<void (unsigned long)>)::$_0>, void ()>::operator()() Parallel.cpp:0:0
#9 0x0000563cc63d7a9a std::__1::__function::__func<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>)::$_0, std::__1::allocator<llvm::parallel::TaskGroup::spawn(std::__1::function<void ()>)::$_0>, void ()>::operator()() Parallel.cpp:0:0
#10 0x0000563cc63d70fd llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::work(llvm::ThreadPoolStrategy, unsigned int) Parallel.cpp:0:0
#11 0x0000563cc63d71dd void* std::__1::__thread_proxy[abi:v160000]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct>>, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()>>(void*) Parallel.cpp:0:0
#12 0x00007f72475791ca start_thread (/lib64/libpthread.so.0+0x81ca)
#13 0x00007f72471e4e73 clone (/lib64/libc.so.6+0x39e73)
icpx: error: unable to execute command: Segmentation fault (core dumped)
icpx: error: linker command failed due to signal (use -v to see invocation)

 

by building again it worked. So it seems like it is something unstable in the lld linker.

 

Best regards

Frank

0 Kudos
VaishnaviV_Intel
Moderator
511 Views

Hi,


We didn't encounter any issues in the initial build. Can you confirm if your issue has been resolved and if we can close this thread from our end?


Thanks & Regards,

Vankudothu Vaishnavi.


0 Kudos
Frank_R_1
Beginner
503 Views

Hi,

 

Thank you, you can close this thread now.

 

Best regards

Frank

0 Kudos
VaishnaviV_Intel
Moderator
498 Views

Hi,


Thanks for confirming. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks & Regards,

Vankudothu Vaishnavi.


0 Kudos
Reply