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

loopd: nil-pointer bug when showing subsystems #560

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ziggie1984
Copy link

@ziggie1984 ziggie1984 commented Mar 24, 2023

Just a short drive-bug fix: loopd crashes when you wanna show the logging subsystems with loopd --debuglevel show

This fix just copies the rogue code to another place, but I think a better fix would be to get rid of the global pointer and maybe just return the logger when setting it up ?

Pull Request Checklist

  • Update release_notes.md if your PR contains major features, breaking changes or bugfixes

@@ -204,6 +197,13 @@ func Run(rpcCfg RPCConfig) error {
logWriter := build.NewRotatingLogWriter()
SetupLoggers(logWriter, shutdownInterceptor)

// Special show command to list supported subsystems and exit.
if config.DebugLevel == "show" {
Copy link
Member

Choose a reason for hiding this comment

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

Is this fix effective because if err := Validate(&config) precedes now?

Copy link
Author

Choose a reason for hiding this comment

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

hmm let me check

Copy link
Author

@ziggie1984 ziggie1984 Mar 24, 2023

Choose a reason for hiding this comment

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

yeah so debuglevel validation seems not part and not necessary to validate so it should be fixed, but maybe we clean this code part up a bit, maybe just get rid of the global pointer variable which led to the bug in the first place and do a clean initialization ?

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

Successfully merging this pull request may close these issues.

2 participants