#64·redis

Crash with message `zmalloc: Out of memory trying to allocate (too many) bytes`

Author: paviadCreated Jun 20, 2020Updated Aug 7, 2024

Describe the bug/issue Occasionally redis crashes with an Out of memory message, the memory allocation size it says it failed to allocate is unreasonably high, and seems like a bug. In my example the message was:

zmalloc: Out of memory trying to allocate 2466055263228213039 bytes

To Reproduce Please provide more information about:

  • version of Redis for Windows you are using: 5.0.9
  • configuration of your instance if it's not out-of-the-box one (i.e. persistence type): Out of the box
  • typical workload handled by your instance: The dump file size is about 2-3 GB in size

Crash report

zmalloc: Out of memory trying to allocate 2466055263228213039 bytes


=== REDIS BUG REPORT START: Cut & paste starting from here ===
Redis version: 5.0.9
[13084] 16 Jun 07:51:43.759 # --- ABORT
[13084] 16 Jun 07:51:43.760 # --- STACK TRACE
redis-server.exe!StackTraceInfo(D:\dev\GitHub\redis\src\Win32_Interop\Win32_StackTrace.cpp:153)(0x00000016, 0x7EF855E64649, 0x1400DD360, 0x1401B5690)
redis-server.exe!AbortHandler(D:\dev\GitHub\redis\src\Win32_Interop\Win32_StackTrace.cpp:209)(0x1401B5690, 0x1400F87BF, 0x0014ED48, 0x0014ED20)
redis-server.exe!raise(minkernel\crts\\\ucrt\src\appcrt\misc\signal.cpp:547)(0x0014ED01, 0x7EF800000000, 0x00000000, 0x223930323933372F)
redis-server.exe!abort(minkernel\crts\\\ucrt\src\appcrt\startup\abort.cpp:71)(0x2239303239330000, 0x1401A9210, 0x223930323933372F, 0x00000057)
redis-server.exe!zmalloc_default_oom(D:\dev\GitHub\redis\src\zmalloc.c:104)(0x0FC00000, 0x223930323933372F, 0x0014F220, 0x14016EDB0)
redis-server.exe!zmalloc(D:\dev\GitHub\redis\src\zmalloc.c:114)(0x2239303239333732, 0x06400008, 0x04C17488, 0x140086C5B)
redis-server.exe!rdbSaveLzfStringObject(D:\dev\GitHub\redis\src\rdb.c:362)(0x2239303239333732, 0x7EF855E64649, 0x0014F220, 0x0014F220)
redis-server.exe!rdbSaveRawString(D:\dev\GitHub\redis\src\rdb.c:436)(0x06400008, 0x7EF8330FFCC1, 0x0014F220, 0x7EF6AA830A90)
redis-server.exe!rdbSaveObject(D:\dev\GitHub\redis\src\rdb.c:788)(0x0014F148, 0x00000000, 0x7EF606C00800, 0x0014F220)
redis-server.exe!rdbSaveKeyValuePair(D:\dev\GitHub\redis\src\rdb.c:1072)(0x0014F220, 0x00000000, 0x08C00000, 0xD45A2100)
redis-server.exe!rdbSaveRio(D:\dev\GitHub\redis\src\rdb.c:1216)(0x005309E0, 0x02210000, 0x00000000, 0x0000331C)
redis-server.exe!rdbSave(D:\dev\GitHub\redis\src\rdb.c:1318)(0x03030A08, 0x02210000, 0x02210000, 0x00000A3E)
redis-server.exe!QForkChildInit(D:\dev\GitHub\redis\src\Win32_Interop\Win32_QFork.cpp:297)(0x00000178, 0x00000000, 0x00000178, 0x00479E50)
redis-server.exe!main(D:\dev\GitHub\redis\src\Win32_Interop\Win32_QFork.cpp:1136)(0x00000000, 0x00000000, 0x0047B810, 0x00000000)
redis-server.exe!__scrt_common_main_seh(d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
KERNEL32.DLL!BaseThreadInitThunk(d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
[13084] 16 Jun 07:51:45.922 #
=== REDIS BUG REPORT END. Make sure to include from START to END. ===

Event Log Please check your system's Event Log to see if there are additional details logged related to this issue. There are none

Additional context Please provide Windows version you are using, mode in which you are starting Redis (standalone, cluster, Sentinel), etc.

  • OS Version: Windows Server 2016 (No service pack)
  • Windows version: Version 1607 (OS Build 14393.3750)
  • Redis mode: standalone
  • System memory: 195083MB
  • System type:12 Core 2.60 GHz Intel Xeon(R) Gold 6126 (Hyper-Threaded)