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

from-ucontext stack trace tests fail on !frame-pointer backtracers on !Linux (was: stacktrace_unittest fails: CHECK_LE(ret_addr, range.end); fails) #1524

Closed
yurivict opened this issue Jun 7, 2024 · 8 comments

Comments

@yurivict
Copy link

yurivict commented Jun 7, 2024

(gdb) p ret_addr
$1 = (void *) 0x2c498a7b <thr_sighandler+315>
(gdb) p range.end
$2 = (const void *) 0x207756 <CaptureLeafUContext(void**, int)+902>

Version: 2.15
FreeBSD 14.1-STABLE stable/14-n267671-9a8a26aefb36

@yurivict
Copy link
Author

yurivict commented Jun 7, 2024

This test still fails with the latest master revision addf751.

@alk
Copy link
Contributor

alk commented Jun 7, 2024

It actually works on my freebsd VM. Can you please a) test fresh checkout just in case b) post exact failure details that apply to master

@yurivict
Copy link
Author

yurivict commented Jun 7, 2024

Yes, I can reproduce it with a fresh checkout of addf751

How to reproduce:

  1. Apply this patch to the ports tree.
  2. cd /usr/ports/devel/google-perftools
  3. make test

@alk
Copy link
Contributor

alk commented Jun 7, 2024

I am not a bsd person. Don't make me apply anything to ports or anything else "complex" BSD-wise. I can ssh and run usual unixy bits on FreeBSD VM. I think it is fair I stop here.

@yurivict
Copy link
Author

yurivict commented Jun 7, 2024

Either some environment variables, or configure arguments matter.

I was able to create a UNIXy reproducer.

Just run this shell script on a freshly cloned repo, and it should reproduce the problem.

@alk
Copy link
Contributor

alk commented Jun 11, 2024

Somewhat simpler and more precise reproduction:

  • get libunwind installed (as root): pkg install libunwind-20240221
  • then checkout master of gperftools
  • LDFLAGS="-L/usr/local/lib" CXXFLAGS="-O2 -isystem /usr/local/include" ./configure
  • make stacktrace_unittest && ./stacktrace_unittest

BTW, is there "normal" way to get /usr/local things automagically added to includes and libs ? Or is it some kind of principled way to make people's lives more hardcore?

@yurivict
Copy link
Author

BTW, is there "normal" way to get /usr/local things automagically added to includes and libs ? Or is it some kind of principled way to make people's lives more hardcore?

On BSDs there are 2 prefixes: /usr (for base) and /usr/local (for ports).
Only the first prefix is added automatically.
It would be strange to add both prefixes automatically, because there could be more prefixes in general. All of them can't be added.
It's also a bad idea to conflate them, like in Linux.

Sorry if this is inconvenient. This isn't done this way to inconvenience people.

@alk alk changed the title stacktrace_unittest fails: CHECK_LE(ret_addr, range.end); fails from-ucontext stack trace tests fail on !frame-pointer backtracers on !Linux (was: stacktrace_unittest fails: CHECK_LE(ret_addr, range.end); fails) Jun 11, 2024
@alk
Copy link
Contributor

alk commented Jun 12, 2024

Lets consider this fixed. Tests will now pass. But I created #1526 to cover making things work correctly, rather than avoiding brokenness in test.

@alk alk closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants