Git Product home page Git Product logo

Comments (14)

aaupov avatar aaupov commented on July 22, 2024 1

I would suggest you check if the issue reproduces with the trunk version of BOLT first. AFAIK DWARF5 support was added to BOLT after LLVM14 release and it wasn't backported.

from bolt.

aaupov avatar aaupov commented on July 22, 2024

Hi @zpget,

Thanks for reporting! Can you please also include full backtrace and the version of BOLT used?
It would also be helpful for us to be able to repro the build - if clang14 binary is built manually, what's the CMake command line? If it's distro built, which package is it?

@ayermolo - does that look familiar? Can that be the cause of the crash?

BOLT-WARNING: Unsupported DWARFLocationEntry Kind:5

from bolt.

zpget avatar zpget commented on July 22, 2024

Hi @zpget,

Thanks for reporting! Can you please also include full backtrace and the version of BOLT used? It would also be helpful for us to be able to repro the build - if clang14 binary is built manually, what's the CMake command line? If it's distro built, which package is it?

@ayermolo - does that look familiar? Can that be the cause of the crash?

BOLT-WARNING: Unsupported DWARFLocationEntry Kind:5

  1. bolt version: llvm-project-llvmorg-14.0.0 release
  2. core line:
    bolt/lib/Rewrite/DWARFRewriter.cpp
    switch (Entry.Kind) {
    default:
    llvm_unreachable("Unsupported DWARFLocationEntry Kind.");

Kind:5

  1. binary code is complex , main module depend on many other modules(static link)

from bolt.

ayermolo avatar ayermolo commented on July 22, 2024

Hi
I am currently on PTO so won't be able to look until next week, but does sound like you are using BOLT version that doesn't support DWARF5. Please try with trunk as Amir suggested.

from bolt.

zpget avatar zpget commented on July 22, 2024

BOLT version:
BOLT-INFO: BOLT version: 56ff67c
with latest trunk, still has core
switch (Entry.Kind) {
default:
errs() << "BOLT-WARNING: Unsupported DWARFLocationEntry Kind. type="
<< std::to_string(Entry.Kind) << '\n';
llvm_unreachable("Unsupported DWARFLocationEntry Kind.");
i add log
errs() << "BOLT-WARNING: Unsupported DWARFLocationEntry Kind. type="
<< std::to_string(Entry.Kind) << '\n';
and coredump before get:
BOLT-WARNING: Unsupported DWARFLocationEntry Kind. type=5

before coredump print so many warnings:
BOLT-WARNING: empty location list detected at 0x6dd5 for DIE at 0x1779b0 in CU at 0x215b0
BOLT-WARNING: unexpected low_pc form value. Cannot update DIE at offset 0x1779c2
BOLT-WARNING: empty location list detected at 0x6dd7 for DIE at 0x1779d2 in CU at 0x215b0
BOLT-WARNING: unexpected low_pc form value. Cannot update DIE at offset 0x1779db
BOLT-WARNING: unexpected low_pc form value. Cannot update DIE at offset 0x1779ff
BOLT-WARNING: unexpected low_pc form value. Cannot update DIE at offset 0x177a23

from bolt.

zpget avatar zpget commented on July 22, 2024

clang build with -gdwarf-4 -gstrict-dwarf ,
BOLT-WARNING: Unsupported DWARFLocationEntry Kind. type=8
add
@@ -516,6 +518,12 @@ void DWARFRewriter::updateUnitDebugInfo(
BaseAddress + Entry.Value0, BaseAddress + Entry.Value1,
Entry.Loc});
break;

  •            case dwarf::DW_LLE_start_length:
    
  •                 InputLL.emplace_back(DebugLocationEntry{
    
  •                  Entry.Value0, Entry.Value0 + Entry.Value1,
    
  •                  Entry.Loc});
    
  •              break;
    

can success ,
but has warning
BOLT-WARNING: empty location list detected at 0x6dd8 for DIE at 0x177aa4 in CU at 0x215b0
and
gdb load bin has no debug info warning
GNU gdb (GDB) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
https://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from test.bolt...
DW_FORM_strp pointing outside of .debug_str section [in module /home/work/test.bolt]
(No debugging symbols found in test.bolt)

so something wrong with debuginfo update?

from bolt.

aaupov avatar aaupov commented on July 22, 2024

BOLT version: BOLT-INFO: BOLT version: 56ff67c with latest trunk, still has core

You're using non-upstreamed BOLT version which was last updated in Jan this year.
BOLT has been part of LLVM monorepo since then: https://github.com/llvm/llvm-project/tree/main/bolt

Please follow the instructions on that page (https://github.com/llvm/llvm-project/tree/main/bolt#manual-build) to check out and build the latest trunk version.

from bolt.

zpget avatar zpget commented on July 22, 2024

ok, now can fix coredump ,but get some ERROR:
BOLT-ERROR: unsupported form for DW_AT_call_return_pc

from bolt.

ayermolo avatar ayermolo commented on July 22, 2024

Hmm. Are you sure you are on latest llvm trunk? I am pretty sure I fixed that and committed it.

from bolt.

zpget avatar zpget commented on July 22, 2024

with this commit: 4f158995b9cddae392bfb5989af8c83101ae0789
llvm/llvm-project@4f15899

today i see have a latest commit? 4d3a0cade2ed0bdc87256c197215691c2e279ed0
i need try again?

from bolt.

ayermolo avatar ayermolo commented on July 22, 2024

I added support in https://reviews.llvm.org/D128526
Maybe I missed a case. Can you provide a binary and/or how it was build?

from bolt.

zpget avatar zpget commented on July 22, 2024

compiler: llvm-project-14.0.5.src/clang f68d4e64a17b5699e0245b1a7c445830d38fd75f
demo: simple main demo
#include
#include <stdio.h>
#include
#include <unistd.h>
int LOOPS=1000;
void test() {
for (int i = 0; i < LOOPS; i++ ) {
std::string tmp = "hello" + std::to_string(i);
std::cout << tmp << std::endl;
}
}

int main() {
while (true) {
test();
sleep(5);
}
return 0;
}
compile cmd: clang-14/bin/clang++ main.cpp -std=c++11 -Wl,-q
demo bin:
a.out.zip
errmsg:
BOLT-INFO: padding code to 0xa00000 to accommodate hot text
BOLT-ERROR: unsupported form for DW_AT_call_return_pc Function:__libc_csu_init
for DIE.dump()
0x00000696: DW_TAG_call_site
DW_AT_call_return_pc (0x00000000004016dc)

from bolt.

ayermolo avatar ayermolo commented on July 22, 2024

Debug Info in question comes from GCC compiled code.
https://reviews.llvm.org/D136204

from bolt.

zpget avatar zpget commented on July 22, 2024

Debug Info in question comes from GCC compiled code. https://reviews.llvm.org/D136204

ok, test can work, thanks~

from bolt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.