Skip to content

OOM segfault at 32-bit max memory on OS X #711

@titanous

Description

@titanous

I was doing some memory benchmarks with the 32-bit version of 2.6.0-rc8 and hit a OOM segfault on OS X 10.8.2. Redis set maxmemory to 3.5GB automatically, but I guess this is too high. I assume that I won't hit this if I set maxmemory to 3GB, so I'm not sure if this is actually a bug.

redis-server(44174,0xacb2ca28) malloc: *** mmap(size=8388608) failed (error code=12)
*** error: can't allocate region securely
*** set a breakpoint in malloc_error_break to debug
[44174] 14 Oct 14:23:22.734 # Out Of Memory allocating 32777 bytes!
[44174] 14 Oct 14:23:22.734 # 

=== REDIS BUG REPORT START: Cut & paste starting from here ===
[44174] 14 Oct 14:23:22.734 # ------------------------------------------------
[44174] 14 Oct 14:23:22.734 # !!! Software Failure. Press left mouse button to continue
[44174] 14 Oct 14:23:22.734 # Guru Meditation: "OOM" #redis.c:2493
[44174] 14 Oct 14:23:22.734 # (forcing SIGSEGV in order to print the stack trace)
[44174] 14 Oct 14:23:22.734 # ------------------------------------------------
[44174] 14 Oct 14:23:22.734 #     Redis 2.5.14 crashed by signal: 11
[44174] 14 Oct 14:23:22.734 #     Failed assertion: <no assertion failed> (<no file>:0)
[44174] 14 Oct 14:23:22.734 # --- STACK TRACE
0   redis-server                        0x000ddabd logStackTrace + 109
1   redis-server                        0x000dce1b _redisPanic + 187
2   libsystem_c.dylib                   0x980e286b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   redis-server                        0x000b2ffa redisOutOfMemoryHandler + 74
5   redis-server                        0x000b4b6c zrealloc + 140
6   redis-server                        0x000b36cd sdsMakeRoomFor + 61
7   redis-server                        0x000b9349 readQueryFromClient + 121
8   redis-server                        0x000ab588 aeProcessEvents + 584
9   redis-server                        0x000ab88c aeMain + 60
10  redis-server                        0x000b3434 main + 1060
11  libdyld.dylib                       0x914be725 start + 0
[44174] 14 Oct 14:23:22.734 # --- INFO OUTPUT
[44174] 14 Oct 14:23:22.734 # # Server
redis_version:2.5.14
redis_git_sha1:00000000
redis_git_dirty:0
redis_mode:standalone
os:Darwin 12.2.0 x86_64
arch_bits:32
multiplexing_api:kqueue
gcc_version:4.2.1
process_id:44174
run_id:39ffceff4b629ad1ef55f757ece58c0fe7ced46b
tcp_port:6379
uptime_in_seconds:471
uptime_in_days:0
lru_clock:806172

# Clients
connected_clients:11
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory
used_memory:3342167712
used_memory_human:3.11G
used_memory_rss:3451162624
used_memory_peak:3342309936
used_memory_peak_human:3.11G
used_memory_lua:20480
mem_fragmentation_ratio:1.03
mem_allocator:libc

# Persistence
loading:0
rdb_changes_since_last_save:91935232
rdb_bgsave_in_progress:1
rdb_last_save_time:1350238913
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:29
rdb_current_bgsave_time_sec:28
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok

# Stats
total_connections_received:11
total_commands_processed:716257
instantaneous_ops_per_sec:1417
rejected_connections:0
expired_keys:0
evicted_keys:0
keyspace_hits:0
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:5291

# Replication
role:master
connected_slaves:0

# CPU
used_cpu_sys:18.90
used_cpu_user:334.91
used_cpu_sys_children:19.21
used_cpu_user_children:59.68

# Commandstats
cmdstat_sadd:calls=716255,usec=174427318,usec_per_call=243.53
cmdstat_keys:calls=2,usec=463652,usec_per_call=231826.00

# Keyspace
db0:keys=716246,expires=0
hash_init_value: 1350526408

[44174] 14 Oct 14:23:22.734 # --- CLIENT LIST OUTPUT
[44174] 14 Oct 14:23:22.735 # addr=127.0.0.1:59491 fd=5 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32782 obl=0 oll=0 omem=0 events=r cmd=sadd
addr=127.0.0.1:59492 fd=6 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=sadd
addr=127.0.0.1:59493 fd=7 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=6 oll=0 omem=0 events=rw cmd=sadd
addr=127.0.0.1:59494 fd=8 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32776 obl=6 oll=0 omem=0 events=rw cmd=sadd
addr=127.0.0.1:59495 fd=9 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32772 obl=0 oll=0 omem=0 events=r cmd=sadd
addr=127.0.0.1:59496 fd=10 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32790 obl=0 oll=0 omem=0 events=r cmd=sadd
addr=127.0.0.1:59497 fd=11 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=6 oll=0 omem=0 events=rw cmd=sadd
addr=127.0.0.1:59498 fd=12 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32788 obl=0 oll=0 omem=0 events=r cmd=sadd
addr=127.0.0.1:59499 fd=13 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32776 obl=0 oll=0 omem=0 events=r cmd=sadd
addr=127.0.0.1:59500 fd=14 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32770 obl=0 oll=0 omem=0 events=r cmd=sadd
addr=127.0.0.1:59501 fd=15 age=423 idle=32 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=keys

[44174] 14 Oct 14:23:22.735 # --- CURRENT CLIENT INFO
[44174] 14 Oct 14:23:22.735 # client: addr=127.0.0.1:59492 fd=6 age=459 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=sadd
[44174] 14 Oct 14:23:22.735 # --- REGISTERS
[44174] 14 Oct 14:23:22.735 # 
EAX:6a262917 EBX:00112d28 ECX:bff55d84 EDX:00003800
EDI:00118155 ESI:000dcd6e EBP:bff562c8 ESP:bff562a0
SS:00000023  EFL:00010282 EIP:000dce1b CS :0000001b
DS:00000023  ES:00000023  FS :00000000 GS :0000000f
[44174] 14 Oct 14:23:22.735 # (bff562dc) -> 800d44e0
[44174] 14 Oct 14:23:22.735 # (bff562d8) -> 000009bd
[44174] 14 Oct 14:23:22.735 # (bff562d4) -> 00112d28
[44174] 14 Oct 14:23:22.735 # (bff562d0) -> 00114688
[44174] 14 Oct 14:23:22.735 # (bff562cc) -> 000b2ffa
[44174] 14 Oct 14:23:22.735 # (bff562c8) -> bff562e8
[44174] 14 Oct 14:23:22.735 # (bff562c4) -> 000b4aee
[44174] 14 Oct 14:23:22.735 # (bff562c0) -> 00000010
[44174] 14 Oct 14:23:22.735 # (bff562bc) -> 000b2fbc
[44174] 14 Oct 14:23:22.735 # (bff562b8) -> 6a262917
[44174] 14 Oct 14:23:22.735 # (bff562b4) -> 800d44e0
[44174] 14 Oct 14:23:22.735 # (bff562b0) -> 000009bd
[44174] 14 Oct 14:23:22.735 # (bff562ac) -> 00112d28
[44174] 14 Oct 14:23:22.735 # (bff562a8) -> 00114688
[44174] 14 Oct 14:23:22.735 # (bff562a4) -> 00118155
[44174] 14 Oct 14:23:22.735 # (bff562a0) -> 00000003
[44174] 14 Oct 14:23:22.735 # 
=== REDIS BUG REPORT END. Make sure to include from START to END. ===

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions