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

Crash (assert/check fail) in RapidYAML if the input is a YAML stream #1148

Open
johnbartholomew opened this issue Apr 1, 2024 · 0 comments

Comments

@johnbartholomew
Copy link
Collaborator

johnbartholomew commented Apr 1, 2024

While trying to reproduce #1147 I hit this assert/check-fail (building with Makefile at cb18fec)

❯ ./jsonnet -e 'std.parseYaml("1\n---")'
third_party/rapidyaml/ryml_all.hpp:22998:check failed: !m_tree->is_stream(id)
Aborted (core dumped)
(gdb) bt
#0  0x00005555555e7000 in trap_instruction () at third_party/rapidyaml/ryml_all.hpp:1724
#1  debug_break () at third_party/rapidyaml/ryml_all.hpp:1819
#2  c4::yml::Emitter<c4::yml::WriterOStream<std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> > > >::_do_visit_json (this=this@entry=0x7fffffffbe90, id=id@entry=0)
    at third_party/rapidyaml/ryml_all.hpp:22998
#3  0x00005555555d89e9 in c4::yml::Emitter<c4::yml::WriterOStream<std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> > > >::emit_as (error_on_excess=true, id=0, t=..., 
    type=c4::yml::EMIT_JSON, this=0x7fffffffbe90) at third_party/rapidyaml/ryml_all.hpp:22564
#4  c4::yml::operator<< <std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> > > (j=..., s="") at third_party/rapidyaml/ryml_all.hpp:22253
#5  jsonnet::internal::(anonymous namespace)::Interpreter::yamlTreeToJson (this=this@entry=0x7fffffffd720, tree=...) at core/vm.cpp:1657
#6  0x00005555555d98ce in jsonnet::internal::(anonymous namespace)::Interpreter::builtinParseYaml (this=0x7fffffffd720, loc=..., args=...) at core/vm.cpp:1622
#7  0x00005555555cd8ed in jsonnet::internal::(anonymous namespace)::Interpreter::evaluate (this=this@entry=0x7fffffffd720, ast_=0x55555569a5a0, ast_@entry=0x5555559e67e0, 
    initial_stack_size=initial_stack_size@entry=0) at core/vm.cpp:2680
#8  0x00005555555d38dd in jsonnet::internal::jsonnet_vm_execute (alloc=alloc@entry=0x7fffffffdbe0, ast=0x5555559e67e0, ext_vars=std::map with 0 elements, max_stack=max_stack@entry=502, 
    gc_min_objects=<optimized out>, gc_growth_trigger=<optimized out>, natives=std::map with 0 elements, 
    import_callback=0x55555559b53c <default_import_callback(void*, char const*, char const*, char**, char**, size_t*)>, ctx=0x5555556997b0, string_output=false) at core/vm.cpp:3348
#9  0x0000555555593f6c in jsonnet_evaluate_snippet_aux (vm=0x5555556997b0, filename=<optimized out>, snippet=0x5555556998e0 "std.parseYaml(\"1\\n---\")", error=0x7fffffffde78, 
    kind=kind@entry=(anonymous namespace)::REGULAR) at core/libjsonnet.cpp:564
#10 0x00005555555947b1 in jsonnet_evaluate_snippet (vm=<optimized out>, filename=<optimized out>, snippet=<optimized out>, error=<optimized out>) at core/libjsonnet.cpp:716
#11 0x000055555556191e in main (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/13.2.1/bits/basic_string.h:222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant