jakethaw / pivot_vtab

SQLite3 pivot virtual table
MIT License
29 stars 1 forks source link

Segmentation fault when selecting large amounts of data #10

Open AlexSartori opened 1 month ago

AlexSartori commented 1 month ago

I'm experiencing an inconsistent segmentation fault error when selecting large amounts of data from virtual tables created with pivot_vtab.

In particular, sometimes I can solve the error by appending a limit to the query equal to the number of rows, e.g.,

SELECT
    *
FROM
    x
LIMIT (
    SELECT COUNT(*) FROM x
);

as if the error occured because of a cursor overrunning a counter. However, this solution doesn't always work.

I'm failrly experienced with the C language, so I'm hoping I can help solve the issue. What's the best way to debug a SQLite extension? Do you have any suggestion on how to proceed?

Thank you, Alex

AlexSartori commented 1 month ago

Forgot to add: platform is SQLite 3.37.2 running on WSL2.

AlexSartori commented 1 month ago

This issue is solved in @dmagyari's PR: #8

Recompile the extension with the source code from his frork.