SQLite Forum

Crash while sqlite3_prepare_v2 with signal SIGFPE in SQLite version 3.31.01
Login
You need to build your application with one of many available packages that instrument heap usage (and abusage) to be sure that you have not corrupted the heap. The kind of problem you report is, almost without exception, caused by corruption of the data structures comprising the heap's book-keeping. And if your allocations properly match up with deallocations, as the suggested tool may show, then you need to determine whether your application is stepping on that data via a write through a bad pointer.

The query you cite as having induced the failure during a sqlite3_prepare_v2() call is not one which reaches some strange, untested combination of conditions within the SQLite parser, semantic analyzer, or code generator. The genesis of the problem is exceedingly likely to be in your own code.