Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

functioninfo.h:163 Check failed: logical_num > 0 (0 vs. 0) #112

Closed
ChenhaoZhang opened this issue Jun 8, 2021 · 12 comments
Closed

functioninfo.h:163 Check failed: logical_num > 0 (0 vs. 0) #112

ChenhaoZhang opened this issue Jun 8, 2021 · 12 comments

Comments

@ChenhaoZhang
Copy link

I'm using the gcc version of autofdo tool. And when I tried to convert my perf.data into gcov file, the tool reports an error as below:

F20210608 11:36:58.429226 49029 functioninfo.h:163] Check failed: logical_num > 0 (0 vs. 0)
*** Check failure stack trace: ***
Aborted

The commands that I'm using to collect perf.data and convert it are:
perf record -b "my binary"
./create_gcov --binary=../battle_data/battlesvr --profile=../battle_data/perf.data_battle --gcov=ver1.1_print.gcov -gcov_version=1

In addition, I have tried to build a llvm version of the autofdo tool and it successfully converts the perf.data. Any help would be appreciated!

@wmi0
Copy link
Collaborator

wmi0 commented Jun 8, 2021

Could you give a reproducible, for example attach the binary and the profile?

@ChenhaoZhang
Copy link
Author

Could you give a reproducible, for example attach the binary and the profile?
Yes! But could you provide me an email address since the zipped file of the binary and the profile still excesses the maximum size supported.

@wmi0
Copy link
Collaborator

wmi0 commented Jun 9, 2021

You can send it to wmi@google.com. Thanks!

@ChenhaoZhang
Copy link
Author

You can send it to wmi@google.com. Thanks!

Sent.

@wmi0
Copy link
Collaborator

wmi0 commented Jun 10, 2021 via email

@rekyyang
Copy link

I met the same problem, has it been solved?

@rekyyang
Copy link

rekyyang commented Jun 20, 2021

I solved it by sampling perf.data using perf record -b -e br_inst_retired.near_taken:pp -p 1 -- sleep 120
and complie with -g option in the first compilation, and remove the -g option in the second compilation

https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html , and search key word autofdo

@grajer
Copy link

grajer commented Jun 26, 2021

I also meet this problem, when convert redis profiling data to .gcov. Is there any solution?

@wmi0
Copy link
Collaborator

wmi0 commented Jun 28, 2021 via email

@softrobotYCLi
Copy link

softrobotYCLi commented Jul 3, 2021

Hi all, I also meet this problem and solved it by compare with old create_gcov.
little example can recurrence this problem:

#include <iostream>
#include <stdlib.h>
inline int foobar(int a, int b)
{
  if (a < b)
    return a;
  a = rand();
  b = rand();
  return a-b;
}

int bar(int a) {
  a+=rand();
  return a;
}

int foo(int a, int b)
{
  return bar(foobar(a,b));
}

int main()
{
  int a = 1;
  int j = 10000000;
  while (j--)
    a+= foo(rand(),rand());
  std::cout << a << endl;
  return 0;
}

The solution is:

--- a/legacy_addr2line.cc
+++ b/legacy_addr2line.cc
@@ -184,6 +184,9 @@ void Google3Addr2line::GetInlineStack(uint64_t address,
   if (iter == line_map_->begin())
     return;
   --iter;
+  if (iter->second == 0) {
+    return;
+  }
   const LineIdentifier &LI = line_map_->GetLogical(iter->second);
   if (LI.line == 0)
     return;

hope it`s useful ^_^

@wmi0
Copy link
Collaborator

wmi0 commented Jul 10, 2021

Thanks for pointing that out! I somehow dropped that line when I was doing the merge. The suggested fix solves the problem. Will merge it.

@wmi0
Copy link
Collaborator

wmi0 commented Jul 10, 2021

Fix committed: 8d5bf56

@wmi0 wmi0 closed this as completed Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants