Open gkorland opened 11 months ago
Origin comment by: @swilly22
Hi @narayanacharya6, the commit you've referred to is quite recent,
the stack trace (Map_Clone
) doesn't make much sense, I don't see where the Map
data structure is used in the query.
I've tested your query sequence against the edge
docker image which reflects current master
branch
docker run -p 6379:6379 -it --rm redislabs/redisgraph:edge
127.0.0.1:6379> FLUSHALL
OK
127.0.0.1:6379> GRAPH.QUERY X "MATCH (n) DETACH DELETE n"
1) 1) "Cached execution: 0"
2) "Query internal execution time: 1.253000 milliseconds"
127.0.0.1:6379> GRAPH.QUERY X "CREATE INDEX ON :T(le)"
1) 1) "Indices created: 1"
2) "Cached execution: 0"
3) "Query internal execution time: 0.678500 milliseconds"
127.0.0.1:6379> GRAPH.QUERY X "CREATE INDEX ON :A(la)"
1) 1) "Indices created: 1"
2) "Cached execution: 0"
3) "Query internal execution time: 0.935800 milliseconds"
127.0.0.1:6379> GRAPH.QUERY X "CREATE INDEX ON :N(la)"
1) 1) "Indices created: 1"
2) "Cached execution: 0"
3) "Query internal execution time: 0.956100 milliseconds"
127.0.0.1:6379> GRAPH.QUERY X "CYPHER my_id=\"ABCD\" MERGE (:D {my_id:$my_id})"
1) 1) "Labels added: 1"
2) "Nodes created: 1"
3) "Properties set: 1"
4) "Cached execution: 0"
5) "Query internal execution time: 0.589200 milliseconds"
127.0.0.1:6379> GRAPH.QUERY X "CYPHER batch=[[0, 44, 0, 226, 'ABCD'], [44, 84, 226, 449, 'ABCD']] UNWIND $batch as row CREATE (s:S {start:row[0], end:row[1], start_char:row[2], end_char:row[3]}) WITH s, row MATCH (d:D {my_id:row[4]}) MERGE (d)-[:S]->(s)"
1) 1) "Labels added: 1"
2) "Nodes created: 2"
3) "Properties set: 8"
4) "Relationships created: 2"
5) "Cached execution: 0"
6) "Query internal execution time: 2.326100 milliseconds"
127.0.0.1:6379>
Would you mind verifying from your end?
Origin comment by: @narayanacharya6
Yes, I cloned the repo last week and built the .so
file.
Any suggestions for how I can investigate this?
Origin comment by: @narayanacharya6
Hi @swilly22 , I updated my code to the latest commit on master - 7d550c74
and ran the same series of commands, redis-server
crashed again. This time the bug report complains about SI_CloneValue
.
Bug Report:
=== REDIS BUG REPORT START: Cut & paste starting from here ===
3204:M 08 Dec 2021 11:40:37.090 # Redis 6.2.6 crashed by signal: 11, si_code: 0
3204:M 08 Dec 2021 11:40:37.090 # Accessing address: 0x0
3204:M 08 Dec 2021 11:40:37.091 # Killed by PID: 0, UID: 0
3204:M 08 Dec 2021 11:40:37.091 # Crashed running the instruction at: 0x10c531775
------ STACK TRACE ------
EIP:
0 redisgraph.so 0x000000010c531775 SI_CloneValue + 181
Backtrace:
0 libsystem_platform.dylib 0x00007ff80ccd5e2d _sigtramp + 29
1 ??? 0x0000000000000027 0x0 + 39
------ REGISTERS ------
3204:M 08 Dec 2021 11:40:37.092 #
RAX:0000600002d305f0 RBX:0000000000000002
RCX:0000000000000010 RDX:0000000000000000
RDI:000000010912f000 RSI:0000600002d305f0
RBP:1200d08000000000 RSP:0000700002dd4ad0
R8 :0000000000000010 R9 :000000000000039f
R10:00007fb0c8f10000 R11:fffffffffffe7810
R12:0000000000000010 R13:00007fa2a670000c
R14:00000000006f732e R15:0000000000000000
RIP:000000010c531775 EFL:0000000000010212
CS :000000000000002b FS:0000000000000000 GS:0000000000000000
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4adf) -> 0000600001a0c0c0
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ade) -> 0000700002dd4b77
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4add) -> 000000010c531b84
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4adc) -> 0000700002dd4b9f
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4adb) -> 0000600001d0c510
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ada) -> 0000000000000000
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad9) -> 0000600000b00f0c
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad8) -> 00007fb1082f8168
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad7) -> 00007fb1082f8078
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad6) -> 00007fb117804280
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad5) -> 00000000e2280f00
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad4) -> 00007fb1082f8018
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad3) -> 000000010c54d57c
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad2) -> 0000600000b00f0c
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad1) -> 00007fa2a6700000
3204:M 08 Dec 2021 11:40:37.092 # (0000700002dd4ad0) -> 0000000000000727
------ INFO OUTPUT ------
# Server
redis_version:6.2.6
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:c6f3693d1aced7d9
redis_mode:standalone
os:Darwin 21.1.0 x86_64
arch_bits:64
multiplexing_api:kqueue
atomicvar_api:c11-builtin
gcc_version:4.2.1
process_id:3204
process_supervised:no
run_id:a22e17fe3888e3e363f6474659d6c285af705817
tcp_port:6379
server_time_usec:1638943837057891
uptime_in_seconds:101
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:11553884
executable:/Users/narayan/OSS/RedisGraph/redis-server
config_file:
io_threads_active:0
# Clients
connected_clients:1
cluster_connections:0
maxclients:10000
client_recent_max_input_buffer:48
client_recent_max_output_buffer:0
blocked_clients:1
tracking_clients:0
clients_in_timeout_table:0
# Memory
used_memory:60713431584
used_memory_human:56.54G
used_memory_rss:9121792
used_memory_rss_human:8.70M
used_memory_peak:60713431584
used_memory_peak_human:56.54G
used_memory_peak_perc:1431677.38%
used_memory_overhead:1077736
used_memory_startup:1060208
used_memory_dataset:60712353848
used_memory_dataset_perc:100.00%
allocator_allocated:4156704
allocator_active:9083904
allocator_resident:9083904
total_system_memory:34359738368
total_system_memory_human:32.00G
used_memory_lua:37888
used_memory_lua_human:37.00K
used_memory_scripts:0
used_memory_scripts_human:0B
number_of_cached_scripts:0
maxmemory:0
maxmemory_human:0B
maxmemory_policy:allkeys-lru
allocator_frag_ratio:2.19
allocator_frag_bytes:4927200
allocator_rss_ratio:1.00
allocator_rss_bytes:0
rss_overhead_ratio:1.00
rss_overhead_bytes:37888
mem_fragmentation_ratio:2.19
mem_fragmentation_bytes:4965088
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:17456
mem_aof_buffer:0
mem_allocator:libc
active_defrag_running:0
lazyfree_pending_objects:0
lazyfreed_objects:0
# Persistence
loading:0
current_cow_size:0
current_cow_size_age:0
current_fork_perc:0.00
current_save_keys_processed:0
current_save_keys_total:0
rdb_changes_since_last_save:5
rdb_bgsave_in_progress:0
rdb_last_save_time:1638943736
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:0
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
aof_last_cow_size:0
module_fork_in_progress:0
module_fork_last_cow_size:0
# Stats
total_connections_received:1
total_commands_processed:8
instantaneous_ops_per_sec:0
total_net_input_bytes:610
total_net_output_bytes:21552
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
expired_stale_perc:0.00
expired_time_cap_reached_count:0
expire_cycle_cpu_milliseconds:1
evicted_keys:0
keyspace_hits:11
keyspace_misses:1
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0
total_forks:0
migrate_cached_sockets:0
slave_expires_tracked_keys:0
active_defrag_hits:0
active_defrag_misses:0
active_defrag_key_hits:0
active_defrag_key_misses:0
tracking_total_keys:0
tracking_total_items:0
tracking_total_prefixes:0
unexpected_error_replies:0
total_error_replies:0
dump_payload_sanitizations:0
total_reads_processed:8
total_writes_processed:7
io_threaded_reads_processed:0
io_threaded_writes_processed:0
# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:0abd0fdad17804e78412e6417fa3898c9d60f1d4
master_replid2:0000000000000000000000000000000000000000
master_repl_offset:0
second_repl_offset:-1
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
# CPU
used_cpu_sys:0.095636
used_cpu_user:0.055260
used_cpu_sys_children:0.000000
used_cpu_user_children:0.000000
# Modules
module:name=graph,ver=999999,api=1,filters=0,usedby=[],using=[],options=[]
# Commandstats
cmdstat_graph.QUERY:calls=6,usec=1722,usec_per_call=287.00,rejected_calls=0,failed_calls=0
cmdstat_command:calls=1,usec=722,usec_per_call=722.00,rejected_calls=0,failed_calls=0
cmdstat_flushall:calls=1,usec=16,usec_per_call=16.00,rejected_calls=0,failed_calls=0
# Errorstats
# Cluster
cluster_enabled:0
# Keyspace
db0:keys=1,expires=0,avg_ttl=0
------ CLIENT LIST OUTPUT ------
id=5 addr=/tmp/redis.sock:0 laddr=/tmp/redis.sock:0 fd=9 name= age=95 idle=1 flags=bU db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=65530 argv-mem=234 obl=0 oll=0 omem=0 tot-mem=83210 events=r cmd=graph.QUERY user=default redir=-1
------ MODULES INFO OUTPUT ------
# graph_executing commands
graph_command:GRAPH.QUERY CYPHER batch=[[0, 44, 0, 226, 'ABCD'], [44, 84, 226, 449, 'ABCD']] UNWIND $batch as row CREATE (s:S {start:row[0], end:row[1], start_char:row[2], end_char:row[3]}) WITH s, row MATCH (d:D {my_id:row[4]}) MERGE (d)-[:S]->(s)
------ DUMPING CODE AROUND EIP ------
Symbol: SI_CloneValue (base: 0x10c5316c0)
Module: /Users/narayan/OSS/RedisGraph/src/redisgraph.so (base 0x10c52a000)
$ xxd -r -p /tmp/dump.hex /tmp/dump.bin
$ objdump --adjust-vma=0x10c5316c0 -D -b binary -m i386:x86-64 /tmp/dump.bin
------
3204:M 08 Dec 2021 11:40:37.093 # dump of function (hexdump of 309 bytes):
4889f0415448c1e820554889fd85c0530f84da00000083fe10776585f60f842d01000083fe1089f37776488d150b0000004863049a4801d0ffe0669064000000040100002401000064000000f4000000640000006400000064000000e400000064000000640000006400000064000000640000006400000064000000d400000081fe000800007558488d05a10b5001ff1048ba0008000001000000eb580f1f004531e4488d05ae0450014c89e7ff104183fc08724b498b542cf8418d4c24ff4889c74889eec1e9034a895420f8f348a5480fbaeb204889da5b5d415cc30f1f004531e489f3ebbc660f1f8400000000004889f889f25b5d415cc3660f1f4400004585e474cb0fb655008810ebc30f1f005b5d415ce957e201000f1f80000000005b5d415ce907bd01000f1f800000000041bc480000
=== REDIS BUG REPORT END. Make sure to include from START to END. ===
Origin comment by: @narayanacharya6
Also, I ran the command sequence against the edge
docker container and things work as expected.
My setup with macOS might be an issue here. I had to do some hacky business to build the RedisGraph project on macOS.
Origin comment by: @swilly22 @narayanacharya6 can you please expand on the hacky business ?
Origin comment by: @narayanacharya6
@swilly22 I ran into a few issues with running make
directly. From skimming through the README, I understood that there will be a few things I might need to do differently because I was on macOS. Below is a list of things, from memory, I did to get things working. I should add that I am pretty new to building C/C++ projects, so please let me know if I could have done things better.
git clone --recurse-submodules -j8 https://github.com/RedisGraph/RedisGraph.git
brew install llvm libomp
After this, I tried running make CC=/usr/local/opt/llvm/bin/clang
but still ran into errors about fopenmp
and libomp
- clang: error: unsupported option '-fopenmp'
and ld: library not found for -lomp clang-11: error: linker command failed with exit code 1
make
export LLVM_LOC=/usr/local/opt/llvm
export CC="${LLVM_LOC}/bin/clang -fopenmp"
export CXX="${LLVM_LOC}/bin/clang++ -fopenmp"
export CFLAGS="-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe"
export CXXFLAGS="-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe"
export LDFLAGS="-L/usr/local/opt/gettext/lib -L${LLVM_LOC}/lib -Wl,-rpath,${LLVM_LOC}/lib"
export CPPFLAGS="-I/usr/local/opt/gettext/include -I${LLVM_LOC}/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
make
I am guessing some of the flags I set here might have caused an issue with my build.
Created by: @narayanacharya6 Source: https://github.com/RedisGraph/RedisGraph/issues/2057 A minimal example to reproduce the issue:
Bug Report:
Am I using
UNWIND
correctly?Using RedisGraph built from commit ID:
c7ec83ed
onmaster
redis-server
version:Redis server v=6.2.6 sha=00000000:0 malloc=libc bits=64 build=c6f3693d1aced7d9
Run as:redis-server --unixsocket /tmp/redis.sock --save "tmp.rdb" --appendonly no --maxmemory-policy allkeys-lru --loadmodule ./src/redisgraph.so
OS Version: macOS Monterey 12.0.1