Skip to content

src: add file name to 'Module did not self-register' error #30125

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 9 commits into from

Conversation

nornagon
Copy link
Contributor

The 'Module did not self-register' error can be difficult to track down because it's not always obvious which module is failing to self-register.

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

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Oct 25, 2019
@@ -484,7 +484,9 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
mp = dlib->GetSavedModuleFromGlobalHandleMap();
if (mp == nullptr || mp->nm_context_register_func == nullptr) {
dlib->Close();
env->ThrowError("Module did not self-register.");
char errmsg[1024];
Copy link
Member

Choose a reason for hiding this comment

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

could this be PATH_MAX?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PATH_MAX + strlen("Module did not self-register.") + 1 i suppose?

given the code immediately below that also uses 1024 and includes *filename, I figured best to go for consistency :)

@addaleax addaleax added addons Issues and PRs related to native addons. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Oct 29, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nornagon
Copy link
Contributor Author

Looks like the CI flaked out here, could someone kick it?

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax
Copy link
Member

Landed in 4f43418 🎉

addaleax pushed a commit that referenced this pull request Nov 19, 2019
PR-URL: #30125
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@addaleax addaleax closed this Nov 19, 2019
@nornagon nornagon deleted the filename-module-error branch November 19, 2019 18:21
MylesBorins pushed a commit that referenced this pull request Nov 21, 2019
PR-URL: #30125
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@BridgeAR BridgeAR mentioned this pull request Nov 21, 2019
targos pushed a commit that referenced this pull request Dec 1, 2019
PR-URL: #30125
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@BethGriggs BethGriggs mentioned this pull request Dec 9, 2019
MylesBorins pushed a commit that referenced this pull request Dec 17, 2019
PR-URL: #30125
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@BethGriggs BethGriggs mentioned this pull request Dec 23, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
addons Issues and PRs related to native addons. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. c++ Issues and PRs that require attention from people who are familiar with C++. errors Issues and PRs related to JavaScript errors originated in Node.js core.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants