-
Notifications
You must be signed in to change notification settings - Fork 96
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
memory usage indicators wrap around over 2GiB #191
Comments
Yeah, sadly the SQLite developers refuse to use standard types like size_t despite a many year campaign by me to fix this. I'll switch to the new -64 interface to fix this issue. Thanks for reporting it. |
On a completely unrelated point, you are the first person to ever do a bug report supplying test code as Python 3, and not Python 2! |
Note that memoryused and memoryhighwater are both defined to return 64 bits, and that APSW does use PyLong_FromLongLong in order to the 64 bit value in C into a Python number object. On looking at their code, they call the 32 bit version of sqlite3_status. Reported to the SQLite developers at http://permalink.gmane.org/gmane.comp.db.sqlite.general/94544 |
The SQLite authors fixed memoryused/memoryhighwater with that fix being in the next SQLite release. http://www.sqlite.org/src/info/8a0d5d5e9a451560 |
Very much appreciated, Roger. I can confirm |
I'm seeing negative numbers from
memoryused()
,memoryhighwatermark()
, andstatus(SQLITE_STATUS_MEMORY_USED)
once the values go over 2GiB. This is on a 64-bit install of Ubuntu Utopic.To reproduce, please run the following program:
I get the following output:
Note that the output of the functions has apparently wrapped around. I was expecting it to give increasing positive values either indefinitely or until about 4GiB.
SQLite 3.8.9 seems to have had some related changes (3rd item).
Please let me know what additional information would be helpful.
Thanks for APSW. It is incredibly useful to me.
The text was updated successfully, but these errors were encountered: