RedisLabsModules / redismodule-rs

Rust API for Redis Modules API
BSD 3-Clause "New" or "Revised" License
269 stars 64 forks source link

FLUSHALL command failed after loading example module #50

Closed j4in closed 5 years ago

j4in commented 5 years ago

FLUSHALL, BGSAVE, SYNC and similar commands failed after trying out the module provided as example.

Note that, I can do FLUSHALL even after the redis server started with the module. The problems started after I run alloc.set. alloc.set is doing a open_key_writable(key).set_value(...)

Am I missing something?

=== REDIS BUG REPORT START: Cut & paste starting from here === 87858:M 25 Oct 2019 00:14:11.549 # Redis 5.0.4 crashed by signal: 11 87858:M 25 Oct 2019 00:14:11.549 # Accessing address: 0x0 87858:M 25 Oct 2019 00:14:11.549 # Failed assertion: (:0)

------ STACK TRACE ------ 0 redis-server 0x000000010250d1a0 logStackTrace + 110 1 redis-server 0x000000010250d527 sigsegvHandler + 236 2 libsystem_platform.dylib 0x00007fff7e18db3d _sigtramp + 29 3 ??? 0x0000000000000001 0x0 + 1 4 redis-server 0x00000001024cac29 _dictClear + 128 5 redis-server 0x00000001024cb4e6 dictEmpty + 25 6 redis-server 0x00000001024e2ba1 emptyDb + 121 7 redis-server 0x00000001024e2dbd flushallCommand + 71 8 redis-server 0x00000001024cf857 call + 223 9 redis-server 0x00000001024d00dc processCommand + 1537 10 redis-server 0x00000001024dc7e1 processInputBuffer + 285 11 redis-server 0x00000001024c8dff aeProcessEvents + 550 12 redis-server 0x00000001024c90ee aeMain + 43 13 redis-server 0x00000001024d2f6d main + 1377 14 libdyld.dylib 0x00007fff7dfa2ed9 start + 1 15 ??? 0x0000000000000003 0x0 + 3

gkorland commented 5 years ago

@j4in thanks for the issue. It seems like the example was incomplete. MyType didn't implement the free method, so when Redis tried to free it, it failed. See: https://github.com/RedisLabsModules/redismodule-rs/pull/52