-
Notifications
You must be signed in to change notification settings - Fork 4
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
Unknown error with Clang on Ubuntu #656
Comments
Hey @michaelmior , Can you provide an example full command and file that I can try? We run lots of CLI e2e tests (see https://github.com/sourcemeta/jsonbinpack/blob/main/test/cli/CMakeLists.txt) on CI and they seem to work, so not sure what could be going wrong for you. |
Here's a full transcript of my session.
|
I'll note that a good portion of the tests fail on my machine as well.
|
@michaelmior Very interesting. Are you on Linux? What OS and Clang versions? We are running CI on Ubuntu 22.04 with both Clang and GCC and its all green. You must be hitting some weird corner case on your setup. With more info, I'll try to reproduce and try to come up with a fix... As an aside, I removed the built-in CMake presets I had on the project given their lack of flexibility for most complex build, but you can still follow a standard CMake flow (enabling |
Ah, I see you are on Clang v18 from your logs. |
Assuming it's RapidJSON (from your original comment), have you tried building RapidJSON on this system? Do all their tests pass? |
@jviotti Good question! I tried building RapidJSON and all the tests passed without issue. Although I wasn't able to use the same version of Clang due to some deprecation warnings in gtest and |
I'll note that if I pass invalid JSON, I get a parsing error as expected. The unknown error only seems to happen with syntactically valid schemas. |
Also, you're correct that I'm using Clang 18. Running Ubuntu 22.04. FWIW, I've tried both the debug and release presets as well as no presets at all with the same result. Interestingly, with the debug preset, the binary doesn't have any debugging symbols. I assume that's not expected behavior. |
Hey @michaelmior , I did some further digging on this without success. Ubuntu 22.04 for me, on default Clang v14 passes just fine: Not sure how you are installing Clang v18, but I also did so through https://apt.llvm.org, and it also seemed to work OK: Some further ideas:
|
@jviotti Unfortunately my machine is out of service for the rest of the day, but I'll try working through that list as soon as I can. I'd be happy to have a call to chat regardless. You can book an appointment on my Google Calendar if you like or feel free to contact me via email. |
@michaelmior I booked a slot on Friday. However, there is no Google Meet / Zoom link in there, unless I'm missing something. Can you add one? |
@jviotti Done! |
As an update, I get the same result if I use debug build (same error messages and no assertions seem to be hit). I also tried building with Clang 12 and I get the same results. However, building with GCC 10.5.0 all the tests pass. |
Interesting finds. I wonder how could I reproduce... do you see the same issues on Clang on another machine? Is there any specific configuration on that machine that could explain this? I tried Ubuntu myself, and we run CI on Ubuntu too, so there must be something special on that machine. If you are comfortable with LLDB, any chance that you can trigger the CLI (or one of the unit test files) there and get a backtrace? |
I can't think of any specific configuration that's likely to be problematic (although there's obviously something). I'll try to give this a shot on another machine sometime soon. In the meantime, here's a backtrace:
|
Seems to be failing at parsing the JSON Schema 2020-12 official metaschema that should be embedded into JSON Toolkit (https://jsontoolkit.sourcemeta.com). Assuming your build it at
? |
Could be something in RapidJSON actually. Their upstream test suite is not very comprehensive, and I have seen, on JSON Toolkit, weird parsing errors coming from RapidJSON when using different compilers (see https://github.com/sourcemeta/jsontoolkit/blob/main/test/json/jsontestsuite.cc#L55-L77 for some examples). But I still don't understand why I can't reproduce, even with the same Ubuntu version and compiler version. What happens if you build JSON Toolkit on this machine with Clang: https://github.com/sourcemeta/jsontoolkit? Do you get test failures too? You can find some build commands here: https://github.com/sourcemeta/jsontoolkit#contributing, where the |
I landed a PR fully removing RapidJSON just today, which should fix this. I'll close it, but let me know how it goes! |
I tried again and I still get what look like pretty similar test failures unfortunately. |
@michaelmior Do you have a screenshot/logs of the new ones? With what specific compiler/version are you building it? |
Logs are below. I'm using Clang 18.0.0.
|
Thanks. Interesting that all failures happen strictly at the CLI level or the e2e level, but none of the specific components fail. There must be something off at that higher level that trips up Clang 18. I'll attempt to reproduce and debug tomorrow |
No matter what schema I use, when running any commands (other than
version
orhelp
), I get the error below:Error: Unknown error -1
Any idea what could be causing this? It seems this is an error originating from RapidJSON.
The text was updated successfully, but these errors were encountered: