GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — zlib: alter wrong argument number error message by amarchino · Pull Request #22130 · nodejs/node

Conversation

@amarchino

@amarchino amarchino commented Aug 4, 2018

Copy link
Copy Markdown

The ZCtx::Init function presents a standard CHECK to handle the
argument number. The correct number of arguments as of now is 7.

The CHECK usage follows the standard usage in the node C++ code, yet
this is the only instance where the error message is long enough so as
to be split in two lines. The macro CHECK displays this error message
incorrectly.

The fix revolves around a copy of the macro, injected in the point of
code where the previous CHECK was residing; it formats the message in
the same way the macro would have and cleanly exits the execution.

Fixes: #16987

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Notes:

  • Commit message guidelines followed, yet core-validate-commit fails due to absence of PR-URL and reviewer (might it be acceptable in opening the pull request?)
  • I was not able to create a test for the code correction. I'd like to ask for support in how to create a test case.

I remain at disposal for every problem that maight arise.
Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@amarchino
zlib: alter wrong argument number error message
8721237
The ZCtx::Init function presents a standard CHECK to handle the
argument number. The correct number of arguments as of now is 7.

The CHECK usage follows the standard usage in the node C++ code, yet
this is the only instance where the error message is long enough so as
to be split in two lines. The macro CHECK displays this error message
incorrectly.

The fix revolves around a copy of the macro, injected in the point of
code where the previous CHECK was residing; it formats the message in
the same way the macro would have and cleanly exits the execution.

Fixes: nodejs#16987
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. zlib Issues and PRs related to the zlib module and its compression dependencies. labels Aug 4, 2018
@tniessen

tniessen commented Aug 5, 2018

Copy link
Copy Markdown
Member

Thank you for your contribution, @amarchino! 😃

I won't stand in the way, but to be honest, I am not sure whether the relatively small improvement in readability of a debugging message that should barely ever be visible to users justifies the added complexity. Plus, there are many other places in core which use the same or similar ways to include custom messages in assertions.

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@amarchino

amarchino commented Aug 6, 2018

Copy link
Copy Markdown
Author

I am, for the most part, in agreement with Your point, @tniessen.
This pull request was done as a (long time due) correction for a typo found some time ago.
If the added complexity introduces is not worth the slight improvement, the pull request (and arguably the referenced issue) should be closed with no damage incurred.
I defer to You for the evaluation, and remain at disposal.

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tniessen

tniessen commented Aug 15, 2018

Copy link
Copy Markdown
Member

cc @addaleax based on the discussion in #16987.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Aug 19, 2018

Copy link
Copy Markdown
Member

I don’t think I have anything to add to @tniessen’s reply here. :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tniessen

tniessen commented Aug 19, 2018

Copy link
Copy Markdown
Member

Thanks Anna. I am closing this based on the previous discussion. Thank you for your contribution, @amarchino, we are looking forward to more!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tniessen tniessen closed this Aug 19, 2018
@amarchino

amarchino commented Aug 19, 2018

Copy link
Copy Markdown
Author

Thanks to all af You for the attention and time You spent!

addaleax reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@aliceUnhinged613 aliceUnhinged613 mentioned this pull request May 16, 2022
[Snyk] Security upgrade gatsby from 2.18.18 to 2.19.36 aliceUnhinged613/node#58
Open
This was referenced May 16, 2022
[Snyk] Security upgrade gatsby from 2.18.18 to 2.19.36 137717unity/node#57
Open
[Snyk] Security upgrade gatsby from 2.18.18 to 2.19.36 Rednickle/node-1#49
Open
@kissofire kissofire mentioned this pull request May 16, 2022
[Snyk] Security upgrade gatsby from 2.13.73 to 2.19.36 kissofire/node#67
Open
@wedataintelligence wedataintelligence mentioned this pull request May 16, 2022
[Snyk] Security upgrade gatsby from 2.18.18 to 2.19.36 wedataintelligence/node#33
Open
@ron-a20 ron-a20 mentioned this pull request May 16, 2022
[Snyk] Security upgrade gatsby from 2.18.18 to 2.19.36 ron-a20/node#66
Open
@molllyn1 molllyn1 mentioned this pull request May 17, 2022
[Snyk] Security upgrade gatsby from 2.18.18 to 2.19.36 molllyn1/node#48
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. zlib Issues and PRs related to the zlib module and its compression dependencies.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Error message possible typo in node_zlib

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@amarchino @tniessen @addaleax @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.