microsoftarchive / redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes
http://redis.io
Other
20.78k stars 5.37k forks source link

Redis Server crash while processing GEORADIUSBYMEMBER command #586

Open fonoisrev opened 6 years ago

fonoisrev commented 6 years ago

My Redis server crash while acting as below. Server version is v=3.2.100 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=dd26f1f93c5130ee.

$ ./redis-cli.exe
127.0.0.1:6379> GEORADIUSBYMEMBER cities:locations beijing 150 km withcoord withdist
(empty list or set)
127.0.0.1:6379> GEOPOS cities:locations beijing
(empty list or set)
127.0.0.1:6379> GEOADD cities:locations 116.28 39.55 beijing 117.12 39.08 tianjin 114.29 38.02 shijiazhuang 118.01 39.38 tangshan 115.29 38.51 baoding
(integer) 5
127.0.0.1:6379>  zrange cities:locations 0 -1 withscores
 1) "shijiazhuang"
 2) "4068409216745297"
 3) "baoding"
 4) "4068467794757282"
 5) "beijing"
 6) "4069140618056030"
 7) "tianjin"
 8) "4069185565231353"
 9) "tangshan"
10) "4069273368540169"
127.0.0.1:6379> GEORADIUSBYMEMBER cities:locations beijing 150 km

=== REDIS BUG REPORT START: Cut & paste starting from here ===
Redis version: 3.2.100
[10756] 26 Jan 15:37:43.133 # --- EXCEPTION_ILLEGAL_INSTRUCTION
[10756] 26 Jan 15:37:43.134 # --- STACK TRACE
redis-server.exe!LogStackTrace(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:95)(0x0012E870, 0x0012FF90, 0x00000001, 0x4013A940)
redis-server.exe!UnhandledExceptiontHandler(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:185)(0x00000001, 0x00000000, 0x00000001, 0x4A000F45)
kernel32.dll!UnhandledExceptionFilter(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:185)(0x0012E870, 0x00000006, 0x00000000, 0x00000001)
ntdll.dll!RtlWow64EnableFsRedirection(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:185)(0x0012F4B0, 0x00000F48, 0x40140E48, 0x00000000)
ntdll.dll!_C_specific_handler(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:185)(0x00130000, 0x0012FF90, 0x0012FF90, 0x77C45940)
ntdll.dll!RtlCompareUnicodeString(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:185)(0x00130000, 0x77AEE940, 0x00013128, 0x0012E9E0)
ntdll.dll!RtlTimeToSecondsSince1970(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:185)(0x0012F4B0, 0x0012EFC0, 0x00000000, 0x00000000)
ntdll.dll!KiUserExceptionDispatcher(c:\release\redis\src\win32_interop\win32_stacktrace.cpp:185)(0x401687C0, 0x401687B4, 0x0012F680, 0x4005E3C0)
redis-server.exe!sin(f:\dd\vctools\crt\fpw32\tran\amd64\sin.asm:422)(0x00000000, 0x00000005, 0x00000000, 0x00000000)
redis-server.exe!geohashBoundingBox(c:\release\redis\deps\geohash-int\geohash_helper.c:106)(0x00000000, 0x40069600, 0xDA9ED591, 0x03931A10)
redis-server.exe!geohashGetAreasByRadius(c:\release\redis\deps\geohash-int\geohash_helper.c:135)(0x00000005, 0xB5C06970, 0xB5CDA000, 0x00000068)
redis-server.exe!georadiusGeneric(c:\release\redis\src\geo.c:532)(0xB5C12A40, 0x00000000, 0x00000000, 0x00000000)
redis-server.exe!call(c:\release\redis\src\server.c:2282)(0x5A6ADAC7, 0x00000000, 0x00000000, 0x00000007)
redis-server.exe!processCommand(c:\release\redis\src\server.c:2561)(0xB5CDF005, 0x00000000, 0x00000051, 0x00000000)
redis-server.exe!processInputBuffer(c:\release\redis\src\networking.c:1438)(0x00000051, 0x00000051, 0x00000000, 0x00000000)
redis-server.exe!readQueryFromClient(c:\release\redis\src\networking.c:1503)(0xB5C6B0E0, 0x00000001, 0xB5C0D100, 0x00000000)
redis-server.exe!aeMain(c:\release\redis\src\ae.c:481)(0x5A6ADA5C, 0x00000000, 0x00284F32, 0x00000002)
redis-server.exe!redis_main(c:\release\redis\src\server.c:4157)(0x00000000, 0x5A6ADA5C, 0x00284EE0, 0x00000002)
redis-server.exe!main(c:\release\redis\src\win32_interop\win32_qfork.cpp:1241)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
redis-server.exe!__tmainCRTStartup(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
kernel32.dll!BaseThreadInitThunk(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
ntdll.dll!RtlUserThreadStart(f:\dd\vctools\crt\crtw32\startup\crt0.c:255)(0x00000000, 0x00000000, 0x00000000, 0x00000000)
[10756] 26 Jan 15:37:43.160 # --- INFO OUTPUT
# Server
redis_version:3.2.100
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:dd26f1f93c5130ee
redis_mode:standalone
os:Windows
arch_bits:64
multiplexing_api:WinSock_IOCP
process_id:10756
run_id:1581daca7a3d59893f4644058a6f0bb2b1ac8b51
tcp_port:6379
uptime_in_seconds:107
uptime_in_days:0
hz:10
lru_clock:7002823
executable:D:\Program(no-install)\redis-x64-3.2.100\redis-server.exe
config_file:D:\Program(no-install)\redis-x64-3.2.100\redis.windows.conf

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

# Memory
used_memory:690768
used_memory_human:674.58K
used_memory_rss:652696
used_memory_rss_human:637.40K
used_memory_peak:690768
used_memory_peak_human:674.58K
total_system_memory:0
total_system_memory_human:0B
used_memory_lua:37888
used_memory_lua_human:37.00K
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
mem_fragmentation_ratio:0.94
mem_allocator:jemalloc-3.6.0

# Persistence
loading:0
rdb_changes_since_last_save:5
rdb_bgsave_in_progress:0
rdb_last_save_time:1516952156
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
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
aof_last_write_status:ok

# Stats
total_connections_received:1
total_commands_processed:5
instantaneous_ops_per_sec:0
total_net_input_bytes:558
total_net_output_bytes:5951446
instantaneous_input_kbps:0.00
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:0
evicted_keys:0
keyspace_hits:2
keyspace_misses:2
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0
migrate_cached_sockets:0

# Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU
used_cpu_sys:0.06
used_cpu_user:0.16
used_cpu_sys_children:0.00
used_cpu_user_children:0.00

# Commandstats
cmdstat_zrange:calls=1,usec=0,usec_per_call=0.00
cmdstat_command:calls=1,usec=1000,usec_per_call=1000.00
cmdstat_geoadd:calls=1,usec=0,usec_per_call=0.00
cmdstat_georadiusbymember:calls=1,usec=0,usec_per_call=0.00
cmdstat_geopos:calls=1,usec=0,usec_per_call=0.00

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=1,expires=0,avg_ttl=0
[10756] 26 Jan 15:37:43.192 #
=== REDIS BUG REPORT END. Make sure to include from START to END. ===

       Please report this bug by following the instructions at:

     http://github.com/MSOpenTech/redis/wiki/Submitting-an-Issue

    Suspect RAM error? Use redis-server --test-memory to verify it.

Error: 远程主机强迫关闭了一个现有的连接。
tporadowski commented 6 years ago

Hi @fonoisrev,

Since this port of Redis is not maintained anymore - please try my port of Redis 4.0.2 for Windows (alpha version). I've just run your test case without any issues.

Regards, Tomasz