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

Accessing invalid BSON field yields inconsistent state #32

Open
felipenoris opened this issue Sep 5, 2018 · 0 comments
Open

Accessing invalid BSON field yields inconsistent state #32

felipenoris opened this issue Sep 5, 2018 · 0 comments

Comments

@felipenoris
Copy link

In the example below, result is a valid BSONObject instance that doesn't have hey as a key.

Sometimes I also get segfaults.

julia> result["hey"]
ERROR: key not found: "hey"
Stacktrace:
 [1] getindex(::LibBSON.BSONObject, ::String) at /Users/felipenoris/.julia/v0.6/LibBSON/src/BSONIter.jl:80

julia> result
Error showing value of type LibBSON.BSONObject:
ERROR: ArgumentError: cannot convert NULL to string
Stacktrace:
 [1] unsafe_string at ./strings/string.jl:39 [inlined]
 [2] convert(::Type{AbstractString}, ::LibBSON.BSONObject) at /Users/felipenoris/.julia/v0.6/LibBSON/src/BSONObject.jl:75
 [3] show(::IOContext{Base.Terminals.TTYTerminal}, ::LibBSON.BSONObject) at /Users/felipenoris/.julia/v0.6/LibBSON/src/BSONObject.jl:86
 [4] display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::LibBSON.BSONObject) at ./REPL.jl:122
 [5] display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::LibBSON.BSONObject) at ./REPL.jl:125
 [6] display(::LibBSON.BSONObject) at ./multimedia.jl:218
 [7] eval(::Module, ::Any) at ./boot.jl:235
 [8] print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at ./REPL.jl:144
 [9] print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at ./REPL.jl:129
 [10] (::Base.REPL.#do_respond#16{Bool,Base.REPL.##26#36{Base.REPL.LineEditREPL,Base.REPL.REPLHistoryProvider},Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Bool) at ./REPL.jl:646
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