Closed striezel closed 1 month ago
@FourierTransformer: I've just rebased this pull request on top of the current master branch and updated simdjson from version 3.2.1 to version 3.2.3.
I've actually been playing around with this lately, and it seems like the json pointer code can cause segfaults. I haven't figured out if it's related to the new version yet, but overall it doesn't seem great.
I've actually been playing around with this lately, and it seems like the json pointer code can cause segfaults.
Can you provide more details on that? A small, reproducible example would also be helpful.
I noticed it when I first started updating some of the unit tests to 3.3.0. I have a draft pr/branch out here: https://github.com/FourierTransformer/lua-simdjson/pull/63 Looks like it's failing in GHA as well with the new tests. The optimization level doesn't seem to affect it. I ran the unit tests and it seemed to work on the old version of the code just fine. I'm going to assume some of the internals changed in the past 3 major versions... heh...
rough copy from the interpreter:
simdjson = require("simdjson")
function loadFile(textFile)
local file = io.open(textFile, "r")
if not file then error("File not found at " .. textFile) end
local allLines = file:read("*all")
file:close()
return allLines
end
demo = loadFile("jsonexamples/small/demo.json")
djson = simdjson.open(demo)
djson:atPointer("/Image/Width")
simdjson.openFile("jsonexamples/small/demo.json")
Segmentation fault (core dumped)
closing in favor of #83
So the segfaults you mentioned are fixed in #83, I assume? That's good news. :)
Yup! The new[er] simdjson ondemand parser, you need to keep the parser, document, and string in scope and it wasn't quite doing that >.<
This pull request updates simdjson to 3.2.3, the most recent version.
Closes #61. Closes #60. Closes #57. Closes #56.
@FourierTransformer: You possibly want to merge #58 first to make sure that lua-simdjson still builds properly on CI.