Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

llvm-bolt crashes with a seg fault #58

Closed
railkar opened this issue Jul 22, 2019 · 8 comments
Closed

llvm-bolt crashes with a seg fault #58

railkar opened this issue Jul 22, 2019 · 8 comments

Comments

@railkar
Copy link

railkar commented Jul 22, 2019

Summary: After adding -print-all to the llvm-bolt command arguments, it crashes.

Command that does not crash:
llvm-bolt memcached -o memcached.bolt -data=lbr.fdata -reorder-blocks=cache+ -reorder-functions=hfsort+ -split-functions=3 -split-all-cold -split-eh -dyno-stats -print-profile-stats -print-cache-metrics -report-stale -v=1

Add: -print-all to the command above
Result: Crash
Please see .fdata file and the memcached executable (attached tarball) to reproduce the issue.

Stack dump is as follows:
LLVMSymbolizer: error reading file: No such file or directory
#0 0x0000000000eea11a (llvm-bolt+0xeea11a)
#1 0x0000000000ee82ae (llvm-bolt+0xee82ae)
#2 0x0000000000ee83fc (llvm-bolt+0xee83fc)
#3 0x00007f2c592ec390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x0000000000508b46 (llvm-bolt+0x508b46)
#5 0x00000000004bc128 (llvm-bolt+0x4bc128)
#6 0x00000000004d318b (llvm-bolt+0x4d318b)
#7 0x00000000004d5807 (llvm-bolt+0x4d5807)
#8 0x0000000000531d13 (llvm-bolt+0x531d13)
#9 0x00000000005735a1 (llvm-bolt+0x5735a1)
#10 0x00000000005736a5 (llvm-bolt+0x5736a5)
#11 0x000000000042d4cc (llvm-bolt+0x42d4cc)
#12 0x00007f2c58049830 __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0
#13 0x000000000047cec9 (llvm-bolt+0x47cec9)
Stack dump:
0. Program arguments: llvm-bolt memcached -o memcached.bolt -data=lbr.fdata -reorder-blocks=cache+ -reorder-functions=hfsort+ -split-functions=3 -split-all-cold -split-eh -dyno-stats -print-profile-stats -print-cache-metrics -report-stale -v=1 -print-all
Segmentation fault (core dumped)

Note: I renamed the tarball (.tgz) to .zip to satisfy the file uploader

bolt-crash.zip

@maksfb
Copy link
Contributor

maksfb commented Jul 23, 2019

Thank you for the bug report. Is your llvm-bolt compiled with assertions? I'm getting one triggered locally even using the command that does not crash for you.

@railkar
Copy link
Author

railkar commented Jul 23, 2019

cmake -G Ninja ../llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release
ninja

I simply followed the instructions on the github page to build the llvm-bolt binary.

Are you able to reproduce the issue?

@maksfb
Copy link
Contributor

maksfb commented Jul 23, 2019

I'm not sure if it is "the issue", but once I disable assertions I'm hitting a problem with the printout.

@maksfb
Copy link
Contributor

maksfb commented Jul 23, 2019

If the last valid printout is "after lower-annotations", then it's the issue with printing profile info for conditional tail calls without annotations.

@maksfb
Copy link
Contributor

maksfb commented Jul 23, 2019

To check if that's the problem, you can add -simplify-conditional-tail-calls=0 option and see if it goes away.

@railkar
Copy link
Author

railkar commented Jul 23, 2019

Adding -simplify-conditional-tail-calls=0 makes it go away. Doesn't crash. Thanks. Is this a bug though in the printing part of the code?

@maksfb
Copy link
Contributor

maksfb commented Jul 23, 2019

The problem is that getDynoStats() cannot properly handle conditional tail calls since annotations are removed.

@railkar
Copy link
Author

railkar commented Jul 23, 2019

OK, so I can confirm that -dyno-stats and -print-all are incompatible (lead to this crash) when -simplify-conditional-tail-calls=1

rafaelauler pushed a commit that referenced this issue May 10, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue May 11, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
aaupov pushed a commit that referenced this issue May 12, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue May 25, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue May 25, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue May 27, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Jun 4, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Jun 18, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
aaupov pushed a commit that referenced this issue Jun 25, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Jul 6, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Jul 16, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Jul 21, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Jul 23, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Aug 5, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Aug 6, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Aug 17, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Aug 25, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Sep 2, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
rafaelauler pushed a commit that referenced this issue Sep 9, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from commit cd5f3ddf046442b1b53029283ac92002023062e7)
aaupov pushed a commit that referenced this issue Dec 31, 2021
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from FBD16444718)
maksfb added a commit that referenced this issue Jan 10, 2022
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from FBD16444718)
maksfb added a commit that referenced this issue Jan 11, 2022
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from FBD16444718)
maksfb added a commit that referenced this issue Jan 11, 2022
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes #58.

(cherry picked from FBD16444718)
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
Summary:
After stripping annotations, conditional tail calls no longer can be
identified by their corresponding tag. We can check the number of basic
block successors instead.

Fixes facebookarchive/BOLT#58.

(cherry picked from FBD16444718)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants