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

Force --enable-debug on FreeBSD if INVARIANTS is set #12185

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

rincebrain
Copy link
Contributor

Motivation and Context

As illustrated in #12163, at least on 14-CURRENT, panics can result if built without --enable-debug when DEBUG and INVARIANTS are enabled. There is already logic present to force building with INVARIANTS if that's enabled, but that's not enough to resolve this problem.

Description

Reshuffled the INVARIANTS check to happen before the --enable-debug check; set a new variable, FORCE_DEBUG, in the INVARIANTS check if it's true, then added if (FORCE_DEBUG) {enable debug} to the --enable-debug check.

How Has This Been Tested?

Before the change, #12163 happened if built on the default GENERIC kernel (with DEBUG=-g and INVARIANTS) without an explicit --enable-debug. After the change, tried on a GENERIC kernel (it correctly forced --enable-debug and did not repro), and tried with a GENERIC-NODEBUG kernel (which explicitly does not have INVARIANTS) (it did not force --enable-debug).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@ghost ghost added Status: Code Review Needed Ready for review and testing Type: Building Indicates an issue related to building binaries labels Jun 3, 2021
config/zfs-build.m4 Outdated Show resolved Hide resolved
There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Closes: openzfs#12163

Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That works, thanks.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Jun 4, 2021
@tonynguien tonynguien merged commit afb96fa into openzfs:master Jun 7, 2021
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes openzfs#12185
Closes openzfs#12163
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 8, 2021
There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes openzfs#12185
Closes openzfs#12163
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jun 9, 2021
There's already logic to force INVARIANTS on for building if it's
present in the running kernel; however, not having DEBUG enabled
when DEBUG and INVARIANTS are can cause strange panics.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes openzfs#12185
Closes openzfs#12163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested) Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants