zkteco-home / redis-windows

Native port of Redis for Windows,it can be installed as service.
MIT License
1.84k stars 167 forks source link

Redis cannot start with an imported source #50

Closed wardemi closed 1 year ago

wardemi commented 1 year ago

I have an RDB source that I cannot import. The source works with a different build. Do you have any ideas on how I could import it into this build? (The source comes from a Redis 5.0.10 build for Windows and contains many stream elements in DB 1.)

PS C:\code\redis-windows> .\redis-check-rdb.exe C:\code\test.rdb
[offset 0] Checking RDB file C:\code\test.rdb
[offset 29] AUX FIELD redis-ver = '5.0.14.1'
[offset 43] AUX FIELD redis-bits = '64'
[offset 55] AUX FIELD ctime = '1688541401'
[offset 70] AUX FIELD used-mem = '564236664'
[offset 86] AUX FIELD aof-preamble = '0'
[offset 88] Selecting DB ID 0
[offset 14342796] Selecting DB ID 1

=== REDIS BUG REPORT START: Cut & paste starting from here ===
[032920] 05 Jul 11:50:28.244 # --- EXCEPTION_ACCESS_VIOLATION
[032920] 05 Jul 11:50:28.244 # --- STACK TRACE
redis-check-rdb.exe!((null):0)(0x1401F17C0, 0x0014FF60, 0x00000001, 0x0014E280)
redis-check-rdb.exe!((null):0)(0x0014E280, 0x00000001, 0x00000000, 0x00010040)
KERNELBASE.dll!UnhandledExceptionFilter((null):0)(0x0005AA89, 0x7FFEF9E716A0, 0x00000000, 0x7FFEF9D30B4A)
ntdll.dll!RtlMoveMemory((null):0)(0x0014E350, 0x00000000, 0x0014E308, 0x0014E8F0)
ntdll.dll!_C_specific_handler((null):0)(0x00000000, 0x0014E850, 0x0014EF30, 0x0014EF30)
ntdll.dll!_chkstk((null):0)(0x0014EF30, 0x7FFEF9D10000, 0x7FFEF9D6AA68, 0x7FFEF9E9CBF8)
ntdll.dll!RtlFindCharInUnicodeString((null):0)(0x00000000, 0x7FCD89000008, 0x7FCD9DC0000A, 0x7FCD89000008)
ntdll.dll!KiUserExceptionDispatcher((null):0)(0x7FCD89000220, 0x140139600, 0x00000000, 0x1400E8900)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x7FCD9DC0000A, 0x00000000, 0x7FCD9DC00000, 0x00000000)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x7FCD9DC0000A, 0x00000000, 0x7FCD00000085, 0x7FCD9DC0000D)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x7FCD9DC00000, 0x00000CC9, 0x0014F3F0, 0x00000CC9)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x0000000E, 0x7FCD00000000, 0x00000008, 0x14026B000)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x1401E0628, 0x00500672, 0x64A53CE3, 0x14012BCC5)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x00000002, 0x00500648, 0x00000000, 0x1D9AF2620B283D9)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x00000000, 0x00000000, 0x00518259, 0x00000002)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x00000000, 0x140128055, 0x00500630, 0x00000000)
redis-check-rdb.exe!KiUserExceptionDispatcher((null):0)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
KERNEL32.DLL!BaseThreadInitThunk((null):0)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart((null):0)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart((null):0)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
[032920] 05 Jul 11:50:28.251 #
=== REDIS BUG REPORT END. Make sure to include from START to END. ===

Memurai 4.x result

PS C:\Program Files\Memurai> .\memurai-check-rdb.exe C:\code\test.rdb
[offset 0] Checking RDB file C:\code\test.rdb
[offset 29] AUX FIELD redis-ver = '5.0.14.1'
[offset 43] AUX FIELD redis-bits = '64'
[offset 55] AUX FIELD ctime = '1688541401'
[offset 70] AUX FIELD used-mem = '564236664'
[offset 86] AUX FIELD aof-preamble = '0'
[offset 88] Selecting DB ID 0
[offset 14342796] Selecting DB ID 1
[offset 160442129] Selecting DB ID 2
[offset 161291906] Selecting DB ID 3
[offset 161305927] Selecting DB ID 4
[offset 161467387] Selecting DB ID 5
[offset 161469860] Selecting DB ID 6
[offset 161793171] Checksum OK
[offset 161793171] \o/ RDB looks OK! \o/
[info] 9585 keys read
[info] 441 expires
[info] 441 already expired

Redis 5.0.10 for Windows

PS C:\Program Files\Redis> .\redis-check-rdb.exe C:\code\test.rdb
[offset 0] Checking RDB file C:\code\test.rdb
[offset 29] AUX FIELD redis-ver = '5.0.14.1'
[offset 43] AUX FIELD redis-bits = '64'
[offset 55] AUX FIELD ctime = '1688541401'
[offset 70] AUX FIELD used-mem = '564236664'
[offset 86] AUX FIELD aof-preamble = '0'
[offset 88] Selecting DB ID 0
[offset 14342796] Selecting DB ID 1
[offset 160442129] Selecting DB ID 2
[offset 161291906] Selecting DB ID 3
[offset 161305927] Selecting DB ID 4
[offset 161467387] Selecting DB ID 5
[offset 161469860] Selecting DB ID 6
[offset 161793171] Checksum OK
[offset 161793171] \o/ RDB looks OK! \o/
[info] 9585 keys read
[info] 441 expires
[info] 441 already expired

Redis_version:7.0.11 (WSL2 Docker)

/data # /usr/local/bin/redis-check-rdb /data/test.rdb
[offset 0] Checking RDB file /data/test.rdb
[offset 29] AUX FIELD redis-ver = '5.0.14.1'
[offset 43] AUX FIELD redis-bits = '64'
[offset 55] AUX FIELD ctime = '1688541401'
[offset 70] AUX FIELD used-mem = '564236664'
[offset 86] AUX FIELD aof-preamble = '0'
[offset 88] Selecting DB ID 0
[offset 14342796] Selecting DB ID 1
[offset 160442129] Selecting DB ID 2
[offset 161291906] Selecting DB ID 3
[offset 161305927] Selecting DB ID 4
[offset 161467387] Selecting DB ID 5
[offset 161469860] Selecting DB ID 6
[offset 161793171] Checksum OK
[offset 161793171] \o/ RDB looks OK! \o/
[info] 9585 keys read
[info] 441 expires
[info] 441 already expired
zkteco-home commented 1 year ago

please send me your test.rdb,i will investigate, to michael_zkteco@126.com

zkteco-home commented 1 year ago

I fixed your issue unzip and rename it to redis-check-rdb.exe

wardemi commented 1 year ago

I tested the sent fix and everything is working. Thanks for the help and for carrying out this project.