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

CHPL_UNWIND=libunwind nightly testing #5017

Closed
mppf opened this issue Dec 13, 2016 · 3 comments
Closed

CHPL_UNWIND=libunwind nightly testing #5017

mppf opened this issue Dec 13, 2016 · 3 comments

Comments

@mppf
Copy link
Member

mppf commented Dec 13, 2016

CHPL_UNWIND=libunwind should be tested nightly as a prerequisite for turning it on-by-default in some configurations.

Note that util/test/prediff-for-stacktrace is supposed to help with the various forms of mismatch between a .good file and a .chpl file, in case one has a stacktrace and the other does not.

Also note that stack traces might include call sites on linux64, but generally won't include call sites on Mac OS X. And also note that stack traces do currently include line numbers from internal modules.

@mppf
Copy link
Member Author

mppf commented Jan 18, 2017

We should probably decide, as a matter of policy, if stack traces are expected in .good files, or if the prediff should handle the case that the .good file has no stack trace. If the stack traces are included in .good files, many more internal/standard module line numbers can be exposed, so we presumably need a way to handle that intelligently. It would not be an improvement to have to update every test that halts when certain internal module code is moved to different lines.

bradcray added a commit that referenced this issue Jan 19, 2017
Disable CHPL_UNWIND during start_test runs

[reviewed by @mppf]

This commit disables CHPL_UNWIND during start_test runs, since the
output can be dramatically different (e.g., if an expected error
message is called, which calls halt, a stack trace is printed).

It's an open question as to how we'd do testing in a "CHPL_UNWIND on
by default" world, but in the meantime, I'm trying to work with
CHPL_UNWIND on by default to see how well it works.  In the meantime,
this mod seems like the nice thing to do for developers who use it.

In the conversation on the PR, Michael points out that there is a prediff
script that can be manually invoked to filter out CHPL_UNWIND output
and that there are tests that will be skipped if CHPL_UNWIND is unset
(which now it always will be).  But, we're currently never running with
CHPL_UNWIND set in our nightly testing, so these tests aren't being run
anyway and Michael reports that their .good files are stale anyway.
Meanwhile, Michael has opened issue #5017 to further discuss how
CHPL_UNWIND testing should ultimately work.
mppf added a commit that referenced this issue Aug 20, 2020
Add ability to print stack trace when printing verbose comm

This PR takes several steps to improve stack trace support and then
improves verbose comm diagnostics support with a config param that can
enable stack traces to be printed with comm events.

To improve the stack trace support, it:
 * fixes problems with the linux-only call to `addr2line` to get specific
   line numbers. These were not working on my system because the address
   passed to `addr2line` included a random offset (from ASLR probably).
   So, I adjusted the code to use `dladdr` to compute the base address of
   the object containing the address. (And adding at program link-time
   `-ldl` in addition to the libunwind library). This is subtracted from
   the base address to get a relative address that works with
   `addr2line`. I ran into this because this code was core-dumping in
   gasnet configurations for me.
 * improves bounds checking on some operations & give ourselves a bit
   more buffer size working room
 * adds `chpl_stack_unwind_to_string` that saves a stack trace to an
   allocated string

Within the comm diagnostics code, it is mainly a matter of getting the
setting for `chpl_verbose_comm_stacktrace` from the config param and the
calling `chpl_stack_unwind_to_string`.

To use the stack tracing in verbose comms, make with
`CHPL_UNWIND=libunwind` and then compile a program printing verbose comms
with `-scommDiagsStacktrace=true`.

Note that we don't currently have libunwind testing in nightly testing -
see issue #5017.

Reviewed by @ronawho and @gbtitus - thanks!

- [x] test/runtime/stacktrace passes with gasnet and libunwind on linux
- [x] test/runtime/stacktrace passes on mac os x with system libunwind
- [x] full local testing
- [x] full local gasnet testing (earlier version)
@mppf mppf changed the title CHPL_UNWIND=libunwind testing CHPL_UNWIND=libunwind nightly testing Apr 15, 2021
mppf added a commit that referenced this issue Apr 15, 2021
Update these .good files to reflect location of ChapelIO

PR #16849 moved ChapelIO to modules/standard. Update the .good files for
the libunwind tests to reflect that.

Test change only - not reviewed.

Future Work:
 * CHPL_UNWIND=libunwind nightly testing #5017
@aconsroe-hpe aconsroe-hpe self-assigned this Oct 12, 2021
aconsroe-hpe added a commit that referenced this issue Oct 18, 2021
Bump libunwind and add test configuration with CHPL_UNWIND=bundled

reviewed by @ronawho

Bumping libunwind version to address a build failure reported in #17597 and add a test configuration utilizing CHPL_UNWIND=bundled.

Currently we have no nightly testing that uses CHPL_UNWIND=bundled, but we did have existing tests that were being skipped. This PR adds a cron configuration test-unwind.gasnet.bash with comm and unwind to support testing stacktraces in halts and stacktraces in verbose comm.

In #5017 it was raised that we might use a system prediff script to remove any stacktraces but initially this configuration will only be testing that the compiler successfully builds and testing the tests in test/runtime/stacktrace.

Relates to:

 * #5017
 * #17597
@aconsroe-hpe
Copy link
Contributor

We now have a basic unwind.gasnet nightly testing that covers building the compiler with CHPL_UNWIND=bundled and basic stacktrace tests. Did you want to close this issue or keep it around to add more testing?

@mppf
Copy link
Member Author

mppf commented Oct 21, 2021

Thanks, I'll close it.

@mppf mppf closed this as completed Oct 21, 2021
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

3 participants