Skip to content

Instantly share code, notes, and snippets.

@dogbert17
Last active February 27, 2020 20:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save dogbert17/eb04b7f4c19a4fbbeaa431d2c5189d30 to your computer and use it in GitHub Desktop.
TSAN warning
dogbert@dogbert-VirtualBox ~/repos/rakudo $ TSAN_OPTIONS=second_deadlock_stack=1 MVM_SPESH_NODELAY=1 MVM_SPESH_BLOCKING=1 MVM_JIT_DISABLE=1 ./perl6-m -Ilib t/spec/S05-grammar/parse_and_parsefile-6e.t
1..24
ok 1 - grammar is created using 6.e version of Grammar class
ok 2 - .parse method invokes TOP rule, no match
ok 3 - .parse method invokes TOP rule, match
ok 4 - .parse method requires match to end
ok 5 - .subparse method doesn't require match to end
ok 6 - dies if no TOP rule
ok 7 - .parsefile method invokes TOP rule, no match
ok 8 - .parsefile method invokes TOP rule, match
ok 9 - dies if no TOP rule
ok 10 - dies if file not found
ok 11 - .parse works with namespaced grammars, no match
ok 12 - .parse works with namespaced grammars, match
1..2
ok 1 - '::No::Such::Grammar.parse()' died
ok 2 - right exception type (Exception)
ok 13 - .parse on missing grammar dies
ok 14 - can .parse grammar named "Integer"
Unexpected named argument 'cache' passed
in block <unit> at t/spec/S05-grammar/parse_and_parsefile-6e.t line 65
# You planned 24 tests, but ran 14
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=566)
Cycle in lock order graph: M227 (0x7d0c0008f310) => M186 (0x7d0c00098940) => M227
Mutex M186 acquired here while holding mutex M227 in main thread:
#0 pthread_mutex_lock <null> (libtsan.so.0+0x000000037286)
#1 uv_mutex_lock 3rdparty/libuv/src/unix/thread.c:330 (libmoar.so+0x000000455af8)
#2 instrumentation_level_barrier src/core/frame.c:99 (libmoar.so+0x00000023a0e2)
#3 create_context_only src/core/frame.c:158 (libmoar.so+0x00000023b67a)
#4 MVM_frame_create_context_only src/core/frame.c:215 (libmoar.so+0x00000023b67a)
#5 deserialize_context src/6model/serialization.c:2311 (libmoar.so+0x00000031e1bc)
#6 deserialize_closure src/6model/serialization.c:2415 (libmoar.so+0x000000321f45)
#7 MVM_serialization_demand_code src/6model/serialization.c:2921 (libmoar.so+0x000000321f45)
#8 MVM_sc_get_code src/6model/sc.c:328 (libmoar.so+0x00000031899d)
#9 read_code_ref src/6model/serialization.c:1893 (libmoar.so+0x00000031dd43)
#10 MVM_serialization_read_ref src/6model/serialization.c:1963 (libmoar.so+0x00000031dd43)
#11 deserialize src/6model/reprs/P6opaque.c:1147 (libmoar.so+0x0000002c969c)
#12 deserialize_object src/6model/serialization.c:2780 (libmoar.so+0x0000003205bf)
#13 work_loop src/6model/serialization.c:2825 (libmoar.so+0x0000003205bf)
#14 MVM_serialization_demand_stable src/6model/serialization.c:2891 (libmoar.so+0x00000032166a)
#15 MVM_sc_get_stable src/6model/sc.c:261 (libmoar.so+0x000000318355)
#16 read_object_table_entry src/6model/serialization.c:2263 (libmoar.so+0x00000031a468)
#17 repossess src/6model/serialization.c:3062 (libmoar.so+0x00000031a468)
#18 MVM_serialization_deserialize src/6model/serialization.c:3220 (libmoar.so+0x000000326dfe)
#19 MVM_interp_run src/core/interp.c:3224 (libmoar.so+0x00000021f6af)
#20 MVM_vm_run_file src/moar.c:463 (libmoar.so+0x0000003f23ac)
#21 main src/main.c:305 (moar+0x00000040156c)
Mutex M227 previously acquired by the same thread here:
#0 pthread_mutex_lock <null> (libtsan.so.0+0x000000037286)
#1 uv_mutex_lock 3rdparty/libuv/src/unix/thread.c:330 (libmoar.so+0x000000455af8)
#2 MVM_serialization_demand_stable src/6model/serialization.c:2872 (libmoar.so+0x000000321044)
#3 MVM_sc_get_stable src/6model/sc.c:261 (libmoar.so+0x000000318355)
#4 read_object_table_entry src/6model/serialization.c:2263 (libmoar.so+0x00000031a468)
#5 repossess src/6model/serialization.c:3062 (libmoar.so+0x00000031a468)
#6 MVM_serialization_deserialize src/6model/serialization.c:3220 (libmoar.so+0x000000326dfe)
#7 MVM_interp_run src/core/interp.c:3224 (libmoar.so+0x00000021f6af)
#8 MVM_vm_run_file src/moar.c:463 (libmoar.so+0x0000003f23ac)
#9 main src/main.c:305 (moar+0x00000040156c)
Mutex M227 acquired here while holding mutex M186 in main thread:
#0 pthread_mutex_lock <null> (libtsan.so.0+0x000000037286)
#1 uv_mutex_lock 3rdparty/libuv/src/unix/thread.c:330 (libmoar.so+0x000000455af8)
#2 MVM_serialization_demand_object src/6model/serialization.c:2837 (libmoar.so+0x000000320a19)
#3 MVM_sc_get_object src/6model/sc.c:206 (libmoar.so+0x000000317e7d)
#4 MVM_bytecode_finish_frame src/core/bytecode.c:697 (libmoar.so+0x000000235080)
#5 prepare_and_verify_static_frame src/core/frame.c:29 (libmoar.so+0x00000023a6ff)
#6 instrumentation_level_barrier src/core/frame.c:99 (libmoar.so+0x00000023a6ff)
#7 MVM_frame_invoke src/core/frame.c:404 (libmoar.so+0x00000023c4a0)
#8 invoke_handler src/6model/reprs/MVMCode.c:10 (libmoar.so+0x0000002d0bd8)
#9 MVM_interp_run src/core/interp.c:1066 (libmoar.so+0x0000001fa56d)
#10 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#11 MVM_args_throw_named_unused_error src/core/args.c:429 (libmoar.so+0x0000001eb230)
#12 MVM_interp_run src/core/interp.c:5974 (libmoar.so+0x000000226ff8)
#13 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#14 MVM_file_open_fh src/io/syncfile.c:461 (libmoar.so+0x000000295b8e)
#15 MVM_interp_run src/core/interp.c:3633 (libmoar.so+0x0000002053c1)
#16 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#17 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#18 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#19 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#20 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#21 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#22 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#23 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#24 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#25 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#26 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#27 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#28 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#29 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#30 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#31 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#32 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#33 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#34 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#35 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#36 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#37 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#38 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#39 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#40 MVM_vm_run_file src/moar.c:463 (libmoar.so+0x0000003f23ac)
#41 main src/main.c:305 (moar+0x00000040156c)
Mutex M186 previously acquired by the same thread here:
#0 pthread_mutex_lock <null> (libtsan.so.0+0x000000037286)
#1 uv_mutex_lock 3rdparty/libuv/src/unix/thread.c:330 (libmoar.so+0x000000455af8)
#2 instrumentation_level_barrier src/core/frame.c:99 (libmoar.so+0x00000023a0e2)
#3 MVM_frame_invoke src/core/frame.c:404 (libmoar.so+0x00000023c4a0)
#4 invoke_handler src/6model/reprs/MVMCode.c:10 (libmoar.so+0x0000002d0bd8)
#5 MVM_interp_run src/core/interp.c:1066 (libmoar.so+0x0000001fa56d)
#6 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#7 MVM_args_throw_named_unused_error src/core/args.c:429 (libmoar.so+0x0000001eb230)
#8 MVM_interp_run src/core/interp.c:5974 (libmoar.so+0x000000226ff8)
#9 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#10 MVM_file_open_fh src/io/syncfile.c:461 (libmoar.so+0x000000295b8e)
#11 MVM_interp_run src/core/interp.c:3633 (libmoar.so+0x0000002053c1)
#12 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#13 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#14 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#15 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#16 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#17 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#18 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#19 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#20 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#21 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#22 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#23 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#24 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#25 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#26 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#27 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#28 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#29 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#30 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#31 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#32 MVM_exception_throw_adhoc_free src/core/exceptions.c:883 (libmoar.so+0x0000001f45f4)
#33 no_such_attribute src/6model/reprs/P6opaque.c:210 (libmoar.so+0x0000001e4dd9)
#34 get_attribute src/6model/reprs/P6opaque.c:324 (libmoar.so+0x0000002ccbb5)
#35 MVM_interp_run src/core/interp.c:2113 (libmoar.so+0x000000215734)
#36 MVM_vm_run_file src/moar.c:463 (libmoar.so+0x0000003f23ac)
#37 main src/main.c:305 (moar+0x00000040156c)
SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) ??:0 pthread_mutex_lock
==================
ThreadSanitizer: reported 1 warnings
The Raku backtrace looks like this
Unexpected named argument 'cache' passed
at gen/moar/stage2/NQPHLL.nqp:2463 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:lineof)
from SETTING::src/core.e/Grammar.pm6:44 (/home/dogbert/repos/rakudo/blib/CORE.e.setting.moarvm:typed_exception)
from SETTING::src/core.e/Grammar.pm6:57 (/home/dogbert/repos/rakudo/blib/CORE.e.setting.moarvm:SETFAIL)
from SETTING::src/core.e/Grammar.pm6:62 (/home/dogbert/repos/rakudo/blib/CORE.e.setting.moarvm:parse)
from t/spec/S05-grammar/parse_and_parsefile-6e.t:65 (<ephemeral file>:)
from t/spec/S05-grammar/parse_and_parsefile-6e.t:48 (<ephemeral file>:<unit>)
from t/spec/S05-grammar/parse_and_parsefile-6e.t:1 (<ephemeral file>:<unit-outer>)
from gen/moar/stage2/NQPHLL.nqp:1913 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:eval)
from gen/moar/stage2/NQPHLL.nqp:2118 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
from gen/moar/stage2/NQPHLL.nqp:2078 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
from gen/moar/Compiler.nqp:55 (/home/dogbert/repos/rakudo/blib/Perl6/Compiler.moarvm:command_eval)
from gen/moar/stage2/NQPHLL.nqp:2003 (/home/dogbert/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_line)
from gen/moar/rakudo.nqp:127 (/home/dogbert/repos/rakudo/perl6.moarvm:MAIN)
from gen/moar/rakudo.nqp:92 (/home/dogbert/repos/rakudo/perl6.moarvm:<mainline>)
from <unknown>:1 (/home/dogbert/repos/rakudo/perl6.moarvm:<main>)
from <unknown>:1 (/home/dogbert/repos/rakudo/perl6.moarvm:<entry>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment