Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisGraph crashed when executing read-only query #1083

Closed
MrSrsen opened this issue Apr 30, 2020 · 5 comments
Closed

RedisGraph crashed when executing read-only query #1083

MrSrsen opened this issue Apr 30, 2020 · 5 comments
Labels

Comments

@MrSrsen
Copy link

MrSrsen commented Apr 30, 2020

Hello there.

I am new to Cyper and RedisGraph. I am currently experimenting with graph DB technology on some test data. I really do not know what exactly am I doing but I am pretty sure that DB should not crash when executing read-only query.

I was executing this query trough RedisInsight:
MATCH (roots:broker) WHERE NOT ()<-[:supervising]-(:broker) WITH roots MATCH (roots)-[s:supervising]->(b:broker) RETURN roots, b, s

And I got:

=== REDIS BUG REPORT START: Cut & paste starting from here ===
1:M 30 Apr 2020 13:37:55.336 # Redis 5.0.8 crashed by signal: 11
1:M 30 Apr 2020 13:37:55.336 # Crashed running the instruction at: 0x7fdfcf305769
1:M 30 Apr 2020 13:37:55.336 # Accessing address: (nil)
1:M 30 Apr 2020 13:37:55.336 # Failed assertion: <no assertion failed> (<no file>:0)

------ STACK TRACE ------
EIP:
/usr/lib/redis/modules/redisgraph.so(OpBase_CloneRecord+0x9)[0x7fdfcf305769]

Backtrace:
redis-server *:6379(logStackTrace+0x32)[0x55b7cdd37592]
redis-server *:6379(sigsegvHandler+0x9e)[0x55b7cdd37c6e]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7fdfd046f730]
/usr/lib/redis/modules/redisgraph.so(OpBase_CloneRecord+0x9)[0x7fdfcf305769]
/usr/lib/redis/modules/redisgraph.so(+0x1cc875)[0x7fdfcf307875]
/usr/lib/redis/modules/redisgraph.so(+0x1c8973)[0x7fdfcf303973]
/usr/lib/redis/modules/redisgraph.so(+0x1c40ed)[0x7fdfcf2ff0ed]
/usr/lib/redis/modules/redisgraph.so(+0x1c4afc)[0x7fdfcf2ffafc]
/usr/lib/redis/modules/redisgraph.so(+0x1c8973)[0x7fdfcf303973]
/usr/lib/redis/modules/redisgraph.so(+0x1c4afc)[0x7fdfcf2ffafc]
/usr/lib/redis/modules/redisgraph.so(+0x1cbb9c)[0x7fdfcf306b9c]
/usr/lib/redis/modules/redisgraph.so(ExecutionPlan_Execute+0x58)[0x7fdfcf2fc178]
/usr/lib/redis/modules/redisgraph.so(Graph_Query+0x351)[0x7fdfcf2f6691]
/usr/lib/redis/modules/redisgraph.so(+0x1ebd1d)[0x7fdfcf326d1d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3)[0x7fdfd0464fa3]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7fdfd03954cf]

------ INFO OUTPUT ------
# Server
redis_version:5.0.8
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:ce75a617c591114f
redis_mode:standalone
os:Linux 5.2.14-050214-generic x86_64
arch_bits:64
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:8.3.0
process_id:1
run_id:2799cd5dbd1bc1a8b45c7d713c06f5637f5fdef2
tcp_port:6379
uptime_in_seconds:10020
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:11195571
executable:/data/redis-server
config_file:

# Clients
connected_clients:2
client_recent_max_input_buffer:2
client_recent_max_output_buffer:0
blocked_clients:1

# Memory
used_memory:6668744
used_memory_human:6.36M
used_memory_rss:10191265792
used_memory_rss_human:9.49G
used_memory_peak:9454603984
used_memory_peak_human:8.81G
used_memory_peak_perc:0.07%
used_memory_overhead:858620
used_memory_startup:824704
used_memory_dataset:5886868
used_memory_dataset_perc:99.43%
allocator_allocated:9664760
allocator_active:14667776
allocator_resident:17525235712
total_system_memory:16831561728
total_system_memory_human:15.68G
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:noeviction
allocator_frag_ratio:1.52
allocator_frag_bytes:5003016
allocator_rss_ratio:1194.81
allocator_rss_bytes:17510567936
rss_overhead_ratio:0.58
rss_overhead_bytes:-7333969920
mem_fragmentation_ratio:1501.94
mem_fragmentation_bytes:10184480376
mem_not_counted_for_evict:0
mem_replication_backlog:0
mem_clients_slaves:0
mem_clients_normal:33844
mem_aof_buffer:0
mem_allocator:jemalloc-5.1.0
active_defrag_running:0
lazyfree_pending_objects:0

# Persistence
loading:0
rdb_changes_since_last_save:11628
rdb_bgsave_in_progress:0
rdb_last_save_time:1588243855
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

# Stats
total_connections_received:32
total_commands_processed:12903
instantaneous_ops_per_sec:1
total_net_input_bytes:3562896
total_net_output_bytes:13603879
instantaneous_input_kbps:0.15
instantaneous_output_kbps:0.05
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
evicted_keys:0
keyspace_hits:23879
keyspace_misses:1
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec: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

# Replication
role:master
connected_slaves:0
master_replid:fdb3959e973f809e5a935083864e9deca920a9b8
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:107.863217
used_cpu_user:1467.656622
used_cpu_sys_children:0.004884
used_cpu_user_children:0.002061

# Commandstats
cmdstat_type:calls=1,usec=1,usec_per_call=1.00
cmdstat_scan:calls=1,usec=10,usec_per_call=10.00
cmdstat_client:calls=7,usec=14,usec_per_call=2.00
cmdstat_module:calls=642,usec=2268,usec_per_call=3.53
cmdstat_graph.QUERY:calls=12251,usec=321557,usec_per_call=26.25
cmdstat_info:calls=1,usec=61,usec_per_call=61.00

# Cluster
cluster_enabled:0

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

------ CLIENT LIST OUTPUT ------
id=24215 addr=172.27.0.3:47806 fd=8 name= age=752 idle=268 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=graph.QUERY
id=24230 addr=172.27.0.3:49480 fd=9 name= age=573 idle=0 flags=b db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=0 oll=0 omem=0 events=r cmd=graph.QUERY

------ REGISTERS ------
1:M 30 Apr 2020 13:37:55.357 # 
RAX:0000000000000000 RBX:00007fdfc5c30480
RCX:0000000000000a85 RDX:0000000000000000
RDI:0000000000000000 RSI:0000000000000001
RBP:0000000000000000 RSP:00007fdfcd9352f0
R8 :0000000000000000 R9 :0000000000000007
R10:00007fdfcd935fd0 R11:00007fdfcd935fd0
R12:00007fdfcd935318 R13:00007fdfcd935317
R14:00007fdfc5c30520 R15:0000000000000000
RIP:00007fdfcf305769 EFL:0000000000010206
CSGSFS:002b000000000033
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352ff) -> ffffffffffffffff
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352fe) -> ffffffffffffffff
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352fd) -> 01007fdfcf2f8b46
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352fc) -> 00007fdfcd935420
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352fb) -> 00007fdfcf303973
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352fa) -> 00007fdfcd93535f
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f9) -> 00007fdfcd935368
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f8) -> 00007fdfcd935360
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f7) -> 00007fdfc5c30480
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f6) -> 00007fdfcfe17c00
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f5) -> 0000000000000000
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f4) -> 00007fdfc5d44c28
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f3) -> 00007fdfcf307875
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f2) -> 00007fdfc5c30480
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f1) -> 00007fdfc5c30480
1:M 30 Apr 2020 13:37:55.357 # (00007fdfcd9352f0) -> 00007fdfc5c30480

------ FAST MEMORY TEST ------
1:M 30 Apr 2020 13:37:55.362 # Bio thread for job type #0 terminated
1:M 30 Apr 2020 13:37:55.362 # Bio thread for job type #1 terminated
1:M 30 Apr 2020 13:37:55.362 # Bio thread for job type #2 terminated
*** Preparing to test memory region 55b7cde65000 (2248704 bytes)
*** Preparing to test memory region 55b7cea4f000 (135168 bytes)
*** Preparing to test memory region 7fd9c5800000 (6627000320 bytes)
*** Preparing to test memory region 7fdb50900000 (6305087488 bytes)
*** Preparing to test memory region 7fdcc8700000 (7590641664 bytes)
*** Preparing to test memory region 7fde8cf00000 (1831862272 bytes)
*** Preparing to test memory region 7fdefa300000 (2515673088 bytes)
*** Preparing to test memory region 7fdf94000000 (7905280 bytes)
*** Preparing to test memory region 7fdf98000000 (3186688 bytes)
*** Preparing to test memory region 7fdf9c000000 (3186688 bytes)
*** Preparing to test memory region 7fdfa0000000 (3186688 bytes)
*** Preparing to test memory region 7fdfa4000000 (2461696 bytes)
*** Preparing to test memory region 7fdfa8000000 (6934528 bytes)
*** Preparing to test memory region 7fdfac000000 (3186688 bytes)
*** Preparing to test memory region 7fdfb0000000 (2457600 bytes)
*** Preparing to test memory region 7fdfb4000000 (3407872 bytes)
*** Preparing to test memory region 7fdfb8000000 (2187264 bytes)
*** Preparing to test memory region 7fdfbc180000 (71766016 bytes)
*** Preparing to test memory region 7fdfc4000000 (48234496 bytes)
*** Preparing to test memory region 7fdfc6f80000 (6815744 bytes)
*** Preparing to test memory region 7fdfc76ac000 (2621440 bytes)
*** Preparing to test memory region 7fdfc792d000 (8388608 bytes)
*** Preparing to test memory region 7fdfc812e000 (8388608 bytes)
*** Preparing to test memory region 7fdfc892f000 (8388608 bytes)
*** Preparing to test memory region 7fdfc9130000 (8388608 bytes)
*** Preparing to test memory region 7fdfc9931000 (8388608 bytes)
*** Preparing to test memory region 7fdfca132000 (8388608 bytes)
*** Preparing to test memory region 7fdfca933000 (8388608 bytes)
*** Preparing to test memory region 7fdfcb134000 (8388608 bytes)
*** Preparing to test memory region 7fdfcb935000 (8388608 bytes)
*** Preparing to test memory region 7fdfcc136000 (8388608 bytes)
*** Preparing to test memory region 7fdfcc937000 (8388608 bytes)
*** Preparing to test memory region 7fdfcd138000 (8388608 bytes)
*** Preparing to test memory region 7fdfcd939000 (8388608 bytes)
*** Preparing to test memory region 7fdfce13a000 (8388608 bytes)
*** Preparing to test memory region 7fdfce93b000 (8388608 bytes)
*** Preparing to test memory region 7fdfcf9fd000 (12288 bytes)
*** Preparing to test memory region 7fdfcfa00000 (8388608 bytes)
*** Preparing to test memory region 7fdfd0296000 (24576 bytes)
*** Preparing to test memory region 7fdfd0459000 (16384 bytes)
*** Preparing to test memory region 7fdfd047a000 (16384 bytes)
*** Preparing to test memory region 7fdfd0610000 (8192 bytes)
*** Preparing to test memory region 7fdfd063d000 (4096 bytes)
.redis-server: ../nptl/pthread_mutex_lock.c:433: __pthread_mutex_lock_full: Assertion `INTERNAL_SYSCALL_ERRNO (e, __err) != ESRCH || !robust' failed.
RGT-REDIS exited with code 139

RedisInsight and also Redis are running inside docker containers.

I hope this will help you somehow.

@jeffreylovitz
Copy link
Contributor

Thanks for the report, @MrSrsen!

That's definitely a bug, this should not crash. We'll try to address this soon!

The issue with your query is in:
WHERE NOT ()<-[:supervising]-(:broker)

This construction is legal, but a bit bizarre - path filters like this usually act on at least one bound variable, such as the alias roots.

@MrSrsen
Copy link
Author

MrSrsen commented Apr 30, 2020

Yeah I didn't see that. Thanks, now it's working! :D

@MrSrsen
Copy link
Author

MrSrsen commented Apr 30, 2020

Aaaand it crashed again.

@jeffreylovitz Should I create new issue or is this the same bug?

Query: MATCH rel = (root:broker {broker_id: "124"})<-[:supervising *]-(sup:broker) WHERE rel.modul_id = 3 RETURN rel

Result:

=== REDIS BUG REPORT START: Cut & paste starting from here ===
1:M 30 Apr 2020 15:19:57.287 # Redis 5.0.8 crashed by signal: 11
1:M 30 Apr 2020 15:19:57.287 # Crashed running the instruction at: 0x7ffae4810611
1:M 30 Apr 2020 15:19:57.287 # Accessing address: (nil)
1:M 30 Apr 2020 15:19:57.287 # Failed assertion: <no assertion failed> (<no file>:0)

(details moved to another issue)

I really should read manual or book about Cypher because otherwise this will be loooong path to desired result :D


Moved to: #1084

@jeffreylovitz
Copy link
Contributor

Ick, sorry!

This is a different bug, so you can open a new issue.

The problem in this case is that rel is a path, so attempting a property access on it like rel.modul_id = 3 should cause an error to be emitted.

We have a lot of assertions that should really be replaced with user-facing errors, as you're observing! It's something we should address broadly, but a lot of the cases are fairly unique, so reports like these are really helpful 🙂 .

@jeffreylovitz
Copy link
Contributor

Hey @MrSrsen,

This bug should be fixed now! Thanks again for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants