SQLite User Forum

Out of memory due to the function json_valid
Login

Out of memory due to the function json_valid

(1) By Jinsheng Ba (bajinsheng) on 2023-11-07 06:38:58 [source]

An unexpected out-of-memory error:

CREATE TABLE t0 (c0 INT);
CREATE INDEX i0 ON t0(c0);
INSERT INTO t0(c0) VALUES (1);
ANALYZE;

SELECT * FROM t0 WHERE t0.c0<=json_valid(2); --- out of memory

Environment:

Version: 3.45.0 (dev)

Commit ID: 7a63b5b65a79d15658a160d0878c7371941c67e9b48a7442762c68c60b77288a

Compile Options: make CFLAGS="-DSQLITE_ENABLE_STAT4" all

Client: CLI

Found by SQLancer: https://github.com/sqlancer/sqlancer/issues/899

(2) By Richard Hipp (drh) on 2023-11-07 12:35:06 in reply to 1 [link] [source]

Thanks for the clear and concise bug report.

The problem bisects to the introduction of support for JSON5. I will provide additional information after the problem has been fixed.

(3) By anonymous on 2025-06-03 00:25:09 in reply to 2 [link] [source]

Hi, just wondering if there's any progress on this?

(4.1) By Bo Lindbergh (_blgl_) on 2025-06-03 02:15:57 edited from 4.0 in reply to 3 [link] [source]

Should be fixed by this commit.

(Meta: more frequent "should be fixed by this commit" replies would make the forum work more smoothly as a bug report channel.)

(5) By Adrian Ho (lexfiend) on 2025-06-03 03:08:24 in reply to 4.1 [link] [source]

Since references to forum posts are generally included in bug fix commit messages, perhaps an automated reply referencing the commit would help to close the loop in a consistent fashion?

(6) By anonymous on 2025-06-03 22:07:54 in reply to 4.1 [link] [source]

Thank you and sorry for the noob question but how do I know what version of the SQLite libraries has this fix?

(7) By Richard Hipp (drh) on 2025-06-03 22:49:50 in reply to 6 [link] [source]

3.45.0

(9) By anonymous on 2025-06-03 23:07:54 in reply to 7 [link] [source]

Thank you

(8) By Bo Lindbergh (_blgl_) on 2025-06-03 22:56:53 in reply to 6 [link] [source]

In the web interface for this commit, you can find these bits of information:

  • It is dated 2023-11-07.

  • The context section shows this commit tagged "trunk" and another one with the same description tagged "branch-3.44". This means that the fix would have gone into the next 3.44.* bugfix release.

In the release history, you can see that the next matching bugfix release is 3.44.1 from 2023-11-22.