FalkorDB / FalkorDB

A super fast Graph Database uses GraphBLAS under the hood for its sparse adjacency matrix graph representation. Our goal is to provide the best Knowledge Graph for LLM (GraphRAG).
https://www.falkordb.com/
Other
602 stars 21 forks source link

`redis-server` crashes when using `UNWIND` #238

Open gkorland opened 11 months ago

gkorland commented 11 months ago

Created by: @narayanacharya6 Source: https://github.com/RedisGraph/RedisGraph/issues/2057 A minimal example to reproduce the issue:

redis /tmp/redis.sock> "GRAPH.QUERY" "X" "MATCH (n) DETACH DELETE n" "--compact"
1) 1) "Cached execution: 0"
   2) "Query internal execution time: 0.496000 milliseconds"
redis /tmp/redis.sock> "GRAPH.QUERY" "X" "CREATE INDEX ON :T(le)" "--compact"
1) 1) "Indices created: 1"
   2) "Cached execution: 0"
   3) "Query internal execution time: 0.526000 milliseconds"
redis /tmp/redis.sock> "GRAPH.QUERY" "X" "CREATE INDEX ON :A(la)" "--compact"
1) 1) "Indices created: 1"
   2) "Cached execution: 0"
   3) "Query internal execution time: 0.351000 milliseconds"
redis /tmp/redis.sock> "GRAPH.QUERY" "X" "CREATE INDEX ON :N(la)" "--compact"
1) 1) "Indices created: 1"
   2) "Cached execution: 0"
   3) "Query internal execution time: 0.174000 milliseconds"
redis /tmp/redis.sock> 
redis /tmp/redis.sock> "GRAPH.QUERY" "X" "CYPHER my_id=\"ABCD\" MERGE (:D {my_id:$my_id})" "--compact"
1) 1) "Labels added: 1"
   2) "Nodes created: 1"
   3) "Properties set: 1"
   4) "Cached execution: 0"
   5) "Query internal execution time: 0.429000 milliseconds"
redis /tmp/redis.sock> 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)" --compact
Error: Server closed the connection

Bug Report:

=== REDIS BUG REPORT START: Cut & paste starting from here ===
44794:M 07 Dec 2021 16:34:53.664 # Redis 6.2.6 crashed by signal: 11, si_code: 0
44794:M 07 Dec 2021 16:34:53.664 # Accessing address: 0x0
44794:M 07 Dec 2021 16:34:53.664 # Killed by PID: 0, UID: 0
44794:M 07 Dec 2021 16:34:53.664 # Crashed running the instruction at: 0x1049380d4

------ STACK TRACE ------
EIP:
0   redisgraph.so                       0x00000001049380d4 Map_Clone + 36

Backtrace:
0   libsystem_platform.dylib            0x00007ff808985e2d _sigtramp + 29
1   ???                                 0x0000000000000003 0x0 + 3

------ REGISTERS ------
44794:M 07 Dec 2021 16:34:53.665 # 
RAX:0000000100f42a44 RBX:0492c0a000000000
RCX:01e0aacc00000000 RDX:000000010491bccc
RDI:0492c0a000000000 RSI:01e0aacc00000001
RBP:000000010638c000 RSP:000070000e369a60
R8 :0000000000000010 R9 :00000000000002b0
R10:00007ff463700000 R11:0000000000000000
R12:0000600003a28eac R13:000000010638c00c
R14:0000000400006000 R15:0000000000000000
RIP:00000001049380d4 EFL:0000000000010206
CS :000000000000002b FS:0000000000000000  GS:0000000000000000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a6f) -> 0000000400006000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a6e) -> 000000010638c00c
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a6d) -> 0000600003a28eac
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a6c) -> 000000010638c000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a6b) -> 000000000002ff47
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a6a) -> 0000000000000000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a69) -> 0000000100edacea
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a68) -> 000070000e369ac0
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a67) -> 0000000000000000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a66) -> 0000000000000000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a65) -> 0000000100edacc1
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a64) -> 000070000e369aa0
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a63) -> 0000000100006000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a62) -> 0000000000000000
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a61) -> 000000010638c00c
44794:M 07 Dec 2021 16:34:53.665 # (000070000e369a60) -> 0000000000000000

------ 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:44794
process_supervised:no
run_id:e1058dd717929c63bdaf05478350c70546c39a50
tcp_port:6379
server_time_usec:1638875093659734
uptime_in_seconds:55
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:11485141
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:43229996688
used_memory_human:40.26G
used_memory_rss:9003008
used_memory_rss_human:8.59M
used_memory_peak:43229996688
used_memory_peak_human:40.26G
used_memory_peak_perc:1019390.69%
used_memory_overhead:1077736
used_memory_startup:1060208
used_memory_dataset:43228918952
used_memory_dataset_perc:100.00%
allocator_allocated:4156720
allocator_active:8965120
allocator_resident:8965120
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.16
allocator_frag_bytes:4808400
allocator_rss_ratio:1.00
allocator_rss_bytes:0
rss_overhead_ratio:1.00
rss_overhead_bytes:37888
mem_fragmentation_ratio:2.17
mem_fragmentation_bytes:4846288
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:4
rdb_bgsave_in_progress:0
rdb_last_save_time:1638875038
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:7
instantaneous_ops_per_sec:0
total_net_input_bytes:682
total_net_output_bytes:21547
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:0
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:7
total_writes_processed:6
io_threaded_reads_processed:0
io_threaded_writes_processed:0

# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:d8b16ae5bab842145efad83edc9d48e640340b75
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.039482
used_cpu_user:0.038289
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_command:calls=1,usec=735,usec_per_call=735.00,rejected_calls=0,failed_calls=0
cmdstat_graph.QUERY:calls=6,usec=1804,usec_per_call=300.67,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=49 idle=0 flags=bU db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=65530 argv-mem=243 obl=0 oll=0 omem=0 tot-mem=83219 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: Map_Clone (base: 0x1049380b0)
Module: /Users/narayan/OSS/RedisGraph/src/redisgraph.so (base 0x104918000)
$ xxd -r -p /tmp/dump.hex /tmp/dump.bin
$ objdump --adjust-vma=0x1049380b0 -D -b binary -m i386:x86-64 /tmp/dump.bin
------
44794:M 07 Dec 2021 16:34:53.666 # dump of function (hexdump of 164 bytes):
415741564155415455534883ec58488d05137b4d014885ff488b000f84a70100004889fb8b7ff44989fc48c1e7054883c70cffd04585e4448960044c8d780c4889c5c7400820000000c700000000000f8453010000418d4424ff48c1e005488d44032048890424eb710f1f8000000000418b77fc01d239ca488d05a17f4d01480f42d1488b7c24084883c320480faff2418957f84883c60cff104c8d780c4889c58b008d

=== REDIS BUG REPORT END. Make sure to include from START to END. ===

       Please report the crash by opening an issue on github:

           http://github.com/redis/redis/issues

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

zsh: segmentation fault  redis-server --unixsocket /tmp/redis.sock --save "tmp.rdb" --appendonly no

Am I using UNWIND correctly?

Using RedisGraph built from commit ID: c7ec83ed on master 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

gkorland commented 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?

gkorland commented 11 months ago

Origin comment by: @narayanacharya6 Yes, I cloned the repo last week and built the .so file.

image

Any suggestions for how I can investigate this?

gkorland commented 11 months ago

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. ===
gkorland commented 11 months ago

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.

gkorland commented 11 months ago

Origin comment by: @swilly22 @narayanacharya6 can you please expand on the hacky business ?

gkorland commented 11 months ago

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.

  1. git clone --recurse-submodules -j8 https://github.com/RedisGraph/RedisGraph.git

  2. 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

  1. After stumbling through many different blog posts and SO answers, the suggestion here - https://github.com/Rdatatable/data.table/wiki/Installation#step-3 worked for me. I set the below env variables and then ran 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.