Skip to content

Stop remapping RedisModule_OnLoad; add test module that exports it via version script#6

Open
roshkhatri wants to merge 1 commit into
unstablefrom
fix-fix-crashes-in-issues-#547,-#1921,-#2322,-#1256
Open

Stop remapping RedisModule_OnLoad; add test module that exports it via version script#6
roshkhatri wants to merge 1 commit into
unstablefrom
fix-fix-crashes-in-issues-#547,-#1921,-#2322,-#1256

Conversation

@roshkhatri

Copy link
Copy Markdown
Owner

Motivation

  • Avoid renaming the RedisModule_OnLoad entry-point via macro substitution because it can break modules that use a linker version script to export RedisModule_OnLoad explicitly.
  • Ensure valkey-server continues to load modules that export the original RedisModule_OnLoad symbol.

Description

  • Stop mapping RedisModule_OnLoad to ValkeyModule_OnLoad in src/redismodule.h and add a comment explaining why the symbol must be left unmapped.
  • Add a minimal test module tests/modules/hellovalkey.c that defines RedisModule_OnLoad and a version script hellovalkey.version that exports RedisModule_OnLoad.
  • Update tests/modules/Makefile to build hellovalkey.so using the version script on Linux and include it in the test modules list.
  • Add a unit test tests/unit/moduleapi/redismodule_onload.tcl that verifies the RedisModule_OnLoad symbol is exported (nm -D on Linux) and that the module can be loaded and unloaded by the server.

Testing

  • Built the test modules including hellovalkey.so (Linux path using the version script) and the build succeeded.
  • Ran the new unit test tests/unit/moduleapi/redismodule_onload.tcl which checks the exported symbol and performs MODULE LOAD / MODULE UNLOAD, and the test passed.

Codex Task

Signed-off-by: Codex <codex@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant