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

Home Page:https://www.falkordb.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Graph crashed on assert `algebraic_expression_construction.c:657 'src == dest' is not true`

Lincyaw opened this issue · comments

Redis bug report is shown as follows:

later I will push the data for reproduce

=== REDIS BUG REPORT START: Cut & paste starting from here ===
2075067:M 14 Oct 2023 15:27:07.642 # === ASSERTION FAILED ===
2075067:M 14 Oct 2023 15:27:07.642 # ==> /home/nn/FalkorDB/src/arithmetic/algebraic_expression/algebraic_expression_construction.c:657 'src
== dest' is not true

------ STACK TRACE ------

Backtrace:
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(AlgebraicExpression_FromQueryGraph+0x839)[0x7f5f1b9e6bd2]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(+0x54d2e8)[0x7f5f1bb4d2e8]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(buildMatchOpTree+0xbe)[0x7f5f1bb4dece]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(ExecutionPlanSegment_ConvertClause+0x63)[0x7f5f1bb62008]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(ExecutionPlan_PopulateExecutionPlan+0xf0)[0x7f5f1bb3ba0b]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(+0x53c4dc)[0x7f5f1bb3c4dc]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(+0x53c669)[0x7f5f1bb3c669]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(ExecutionPlan_FromTLS_AST+0x83)[0x7f5f1bb3d0c3]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(ExecutionCtx_FromQuery+0x338)[0x7f5f1bae412e]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(_query+0xc0)[0x7f5f1bad9356]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(Graph_Query+0x2a)[0x7f5f1bad9727]
/home/nn/FalkorDB/bin/linux-x64-debug-cov/src/falkordb.so(+0x86f702)[0x7f5f1be6f702]
/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3)[0x7f5f1f094ac3]
/lib/x86_64-linux-gnu/libc.so.6(+0x126a40)[0x7f5f1f126a40]

------ INFO OUTPUT ------
# Server
redis_version:6.2.13
redis_git_sha1:24c0bf5c
redis_git_dirty:0
redis_build_id:df3b523deb5642f1
redis_mode:standalone
os:Linux 6.2.0-34-generic x86_64
arch_bits:64
monotonic_clock:POSIX clock_gettime
multiplexing_api:epoll
atomicvar_api:c11-builtin
gcc_version:11.4.0
process_id:2075067
process_supervised:no
run_id:b6126834da77cc501be4df485443d7bc2faf3335
tcp_port:9888
server_time_usec:1697268427640793
uptime_in_seconds:599
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:2769611
executable:/home/nn/redis/./src/redis-server
config_file:/home/nn/redis/./redis.conf
io_threads_active:0

# Clients
connected_clients:1
cluster_connections:0
maxclients:10000
client_recent_max_input_buffer:1196
client_recent_max_output_buffer:0
blocked_clients:1
tracking_clients:0
clients_in_timeout_table:0

# Memory
used_memory:4444505008
used_memory_human:4.14G
used_memory_rss:3764531200
used_memory_rss_human:3.51G
used_memory_peak:4450636448
used_memory_peak_human:4.14G
used_memory_peak_perc:99.86%
used_memory_overhead:879915
used_memory_startup:858672
used_memory_dataset:4443624965
used_memory_dataset_perc:100.00%
allocator_allocated:4447837448
allocator_active:4623040512
allocator_resident:4679434240
total_system_memory:134828650496
total_system_memory_human:125.57G
used_memory_lua:30720
used_memory_lua_human:30.00K
used_memory_scripts:0
used_memory_scripts_human:0B
number_of_cached_scripts:0
maxmemory:0
maxmemory_human:0B
maxmemory_policy:noeviction
allocator_frag_ratio:1.04
allocator_frag_bytes:175203064
allocator_rss_ratio:1.01
allocator_rss_bytes:56393728
rss_overhead_ratio:0.80
rss_overhead_bytes:-914903040
mem_fragmentation_ratio:0.85
mem_fragmentation_bytes:-680391312
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:20907
mem_aof_buffer:0
mem_allocator:jemalloc-5.1.0
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:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1697268129
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
rdb_last_cow_size:2813952
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:16
total_commands_processed:18062
instantaneous_ops_per_sec:63
total_net_input_bytes:9537990
total_net_output_bytes:95381236
instantaneous_input_kbps:36.69
instantaneous_output_kbps:22.76
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:6
evicted_keys:0
keyspace_hits:18751
keyspace_misses:0
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:2747
total_forks:1
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:153
dump_payload_sanitizations:0
total_reads_processed:18077
total_writes_processed:19020
io_threaded_reads_processed:0
io_threaded_writes_processed:0

# Replication
role:master
connected_slaves:0
master_failover_state:no-failover
master_replid:36965f184f8cbe1ae9bcc4f6c2dd65372a6e369f
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:82.412871
used_cpu_user:1278.015538
used_cpu_sys_children:0.011434
used_cpu_user_children:0.000881
used_cpu_sys_main_thread:3.248873
used_cpu_user_main_thread:105.828438

# Modules
module:name=graph,ver=999999,api=1,filters=0,usedby=[],using=[],options=[]

# Commandstats
cmdstat_graph.QUERY:calls=18062,usec=416698302,usec_per_call=23070.44,rejected_calls=0,failed_calls=0

# Errorstats
errorstat_Type:count=153

# Cluster
cluster_enabled:0

# Keyspace
db0:keys=6,expires=0,avg_ttl=0

------ CLIENT LIST OUTPUT ------
id=36041 addr=127.0.0.1:52492 laddr=127.0.0.1:9888 fd=9 name= age=4 idle=0 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=40954 argv-me
m=825 obl=0 oll=0 omem=0 tot-mem=62297 events=r cmd=graph.QUERY user=default redir=-1

------ MODULES INFO OUTPUT ------
# graph_executing commands
graph_command:GRAPH.QUERY MATCH (n2:L3:L2)<-[r4 :T3]-(n5:L4:L0), (n0:L3:L1)-[r0 :T4]->(n1:L3:L2:L4)<-[r1 :T0]-(n2:L3), (n4) WHERE (((((r0.id
) > -1) AND ((r0.id) <> (r1.id))) AND ((r0.id) <> (r4.id))) AND ((r1.id) <> (r4.id))) MATCH (n3)<-[]-(n2), (n3)-[]->(n4), (n4)-[r5 :T2]->(n3
) WHERE ((r5.id) > -1) MATCH (n1:L4)<-[]-(n0), (n7:L3:L0)-[r7 :T2]->(n8:L3:L4:L1), (n1:L4)<-[]-(n2) WHERE (n1.k29) WITH n8, (n5.k3) AS a0, (
r7.k44) AS a1, (n1.k29) AS a2 MATCH (n6)-[r8 :T0]->(n9:L2), (n11)<-[r10 :T4]-(n9:L2), (n11:L2)<-[r9 :T1]-(n10:L0) WHERE (((((r8.id) > -1) AN
D ((r8.id) <> (r9.id))) AND ((r8.id) <> (r10.id))) AND ((r9.id) <> (r10.id))) WITH r8, n10, n8, max('f') AS a3, max('T') AS a4 WHERE ((n10.k
3) STARTS WITH a3) OPTIONAL MATCH (n10)-[]->(n11)<-[]-(n9) RETURN DISTINCT (r8.k32) AS a5, (r8.k32) AS a6, (r8.k32) AS a7
graph_command:GRAPH.QUERY MATCH (n0 :L4 :L2)-[r0 :T2]->(n1 :L4 :L0)-[r1 :T2]->(n2 :L4) WHERE (((r0.id) > -1) AND ((r0.id) <> (r1.id))) WITH
min('R') AS a0 MATCH (n4)-[r3 :T2]->(n5) WHERE ((r3.k44) < 2140639346) OPTIONAL MATCH (n0 :L2)-[]->(n1 :L0)-[]->(n2 :L4) WHERE ((n2.k24) >=
-470857342) WITH n0 WHERE ((n0.k14) < 905402565) MATCH (n7 :L4 :L2 :L3) MATCH (n0 :L4 :L2)-[]->(n1 :L4)-[]->(n2) MATCH (n8 :L0) UNWIND [(n1.
k24)] AS a1 RETURN (n0.k28) AS a2
graph_command:GRAPH.QUERY MATCH (n1 :L3 :L0 :L2), (n3 :L4) WHERE (n3.k28) MATCH (n6 :L0 :L3)<-[r4 :T4]-(n0), (n8 :L4)<-[r6 :T2]-(n9) WHERE (
((r4.id) > -1) AND ((r4.id) <> (r6.id))) OPTIONAL MATCH (n6)<-[]-(n0)<-[]-(n1 :L0) WHERE ((n8.k26) > (n6.k1)) OPTIONAL MATCH (n7)<-[]-(n8)<-
[]-(n9), (n10)-[r7 :T5]->(n2 :L0)<-[r8 :T2]-(n11 :L3 :L1 :L0) WHERE (((n8.k24) > (n11.k19)) AND ((r7.id) <> (r8.id))) WITH r4 WHERE ((r4.k55
) <= (r4.k55)) WITH (r4.k55) AS a0 ORDER BY a0 MATCH (n10 :L4)-[]->(n2 :L0)<-[]-(n11) WHERE true OPTIONAL MATCH (n10)-[]->(n2)<-[]-(n11 :L3)
 RETURN DISTINCT (n2.k2) AS a1
graph_command:GRAPH.QUERY MATCH (n2), (n0)-[r3 :T1]->(n4 :L0) WHERE ((r3.id) > -1) UNWIND [-1690843202, (r3.k38), -1690843202] AS a0 UNWIND
[(r3.k39), 499130324] AS a1 MATCH (n4)<-[r4 :T5]-(n5 :L0 :L4) WHERE ((n5.k25) >= (n5.k0)) MATCH (n3 :L1)<-[]-(n0)-[]->(n4), (n6 :L3) WHERE (
1902218970 < 2074364653) MATCH (n0)-[]->(n1)<-[]-(n2) WHERE ((r3.k40) OR (n6.k22)) UNWIND [1181107674] AS a2 OPTIONAL MATCH (n0 :L2)-[]->(n4
 :L0)<-[]-(n5) WHERE ((n6.k22) AND (n6.k22)) RETURN a1, (r3.k37) AS a3 ORDER BY a1, a3
graph_command:GRAPH.QUERY MATCH (n0 :L2)-[r0 :T2]->(n1 :L0 :L3)-[r1 :T2]->(n2 :L4 :L1), (n3 :L4 :L0 :L1)-[r2 :T3]->(n4 :L0)<-[r3 :T5]-(n5 :L
4 :L3), (n6 :L1 :L0 :L2)-[r4 :T2]->(n7 :L2 :L1)<-[r5 :T1]-(n8) WHERE ((((((((((((((((n3.k23) AND ((r0.id) <> (r1.id))) AND ((r0.id) <> (r2.i
d))) AND ((r0.id) <> (r3.id))) AND ((r0.id) <> (r4.id))) AND ((r0.id) <> (r5.id))) AND ((r1.id) <> (r2.id))) AND ((r1.id) <> (r3.id))) AND (
(r1.id) <> (r4.id))) AND ((r1.id) <> (r5.id))) AND ((r2.id) <> (r3.id))) AND ((r2.id) <> (r4.id))) AND ((r2.id) <> (r5.id))) AND ((r3.id) <>
 (r4.id))) AND ((r3.id) <> (r5.id))) AND ((r4.id) <> (r5.id))) MATCH (n9)<-[r6 :T2]-(n10 :L1)<-[r7 :T1]-(n11), (n1 :L3)-[r8 :T1]->(n12) WHER
E (((((r4.k46) > (r1.k46)) AND ((r6.id) <> (r7.id))) AND ((r6.id) <> (r8.id))) AND ((r7.id) <> (r8.id))) OPTIONAL MATCH (n13 :L0)-[r9 :T0]->
(n14 :L0 :L2 :L1)-[r10 :T5]->(n1 :L0) WHERE (((r9.id) > -1) AND ((r9.id) <> (r10.id))) OPTIONAL MATCH (n6)<-[r11 :T5]-(n15 :L2 :L3)<-[r12 :T
3]-(n16 :L0) WHERE (((r5.k38) >= (n6.k0)) AND ((r11.id) <> (r12.id))) WITH min('H') AS a0, (r7.k41) AS a1, min(474700052) AS a2 MATCH (n15)-
[]->(n6 :L1 :L0)-[]->(n7) WHERE ((n6.k9) AND (n6.k9)) MATCH (n9)<-[]-(n10)<-[]-(n11) RETURN a1

------ FAST MEMORY TEST ------
2075067:M 14 Oct 2023 15:27:07.644 # main thread terminated
2075067:M 14 Oct 2023 15:27:07.645 # Bio thread for job type #0 terminated
2075067:M 14 Oct 2023 15:27:07.645 # Bio thread for job type #1 terminated
2075067:M 14 Oct 2023 15:27:07.645 # Bio thread for job type #2 terminated

Fast memory test PASSED, however your memory can still be broken. Please run a memory test for several hours if possible.

The graph can be created by the following statements.

create.log

After executing the first query, the server is down.
image

image

I minimized the query to reproduce this to

MATCH (n2)<-[]-(), (n1)<-[]-(n0)-[]->(n1)<-[]-(n2)<-[]-(n3)-[]->(n3) RETURN *