json::parse() ubsan regression with v3.7.0 #1716
Labels
kind: bug
release item: 🔨 further change
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Milestone
When upgrading from v3.6.1 to v3.7.0, I did see a crash in the CI of a library I maintain when using the undefined behaviour sanitiser with GCC. I was able to cut down complexity and produce a minimal test case that shows the issue is around
json::parse()
(see below).docker run -it debian:testing-20190812
; then inside the container do:apt update
apt install -y g++ nvi wget
wget https://github.com/nlohmann/json/releases/download/v3.7.0/json.hpp
main.cpp
to contain the code shown belowg++ -fsanitize=undefined -fno-sanitize-recover main.cpp
./a.out
where:
This is what I obtain with nlohmann/[email protected] as well as with v3.7.1 when (1) not using the sanitiser or (2)
m
is aconst char *
:See the bottom of this issue for a stacktrace.
Compiler:
System:
debian:testing-20190812
. Upon arriving in this point of the bug report, I also attempted to reproduce the issue with thedebian:stable
image, withg++ (Debian 8.3.0-6) 8.3.0
, where the behaviour was exactly the same.develop
branch?I did test v3.6.1, v3.7.0, and a015b78. Only v0.3.6.1 was working as intended.
I don't think this question applies to my case.
From a
debian:stable
docker container, and with v3.7.0, I obtained this stack trace (which has been edited for wrapping long lines):The text was updated successfully, but these errors were encountered: