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

Fix coredump when use hellodict example module #1395

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

Codebells
Copy link
Contributor

image

In the ValkeyModule_OnLoad method of the file hellodict.c, the parameter keystep of ValkeyModule_CreateCommand should be 1. Otherwise, execute command will coredump.

MODULE LOAD /home/tiger/valkey/src/modules/hellodict.so
COMMAND GETKEYS HELLODICT.SET key value

@Codebells Codebells force-pushed the fix/module_coredump branch from cbdbc98 to 507eb2c Compare December 5, 2024 14:34
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

Thanks!

We obviously we don't have any tests for these example modules.

We should probably add tests for them if we want to keep them in the repo.

Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.85%. Comparing base (a401e37) to head (507eb2c).
Report is 3 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1395      +/-   ##
============================================
+ Coverage     70.69%   70.85%   +0.16%     
============================================
  Files           118      118              
  Lines         63549    63549              
============================================
+ Hits          44924    45029     +105     
+ Misses        18625    18520     -105     

see 9 files with indirect coverage changes

@zuiderkwast zuiderkwast changed the title fix coredump when use hellodict module Fix coredump when use hellodict example module Dec 5, 2024
@zuiderkwast zuiderkwast merged commit 6df376d into valkey-io:unstable Dec 5, 2024
48 checks passed
@Codebells
Copy link
Contributor Author

Codebells commented Dec 6, 2024

Agree, I will add tests for them in next MR.

@Codebells Codebells deleted the fix/module_coredump branch December 6, 2024 02:54
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