MrPigss / BetterJSONStorage

Better JSONStorage for tinyDB
https://pypi.org/project/BetterJSONStorage/
MIT License
33 stars 4 forks source link

Floating point exception (core dumped) #3

Closed mastercoms closed 1 year ago

mastercoms commented 1 year ago

I'm getting a weird error with a 3.5MB database file, only on some machines. It works on my WSL Ubuntu instance, and on Windows, but not on my native Ubuntu VPS.

mastercoms commented 1 year ago
Starting program: python bot.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after vfork from child process 5287]
[New Thread 0x7fffedb21640 (LWP 5288)]

Thread 1 "python" received signal SIGFPE, Arithmetic exception.
___pthread_barrier_wait (barrier=0x555556a12870) at ./nptl/pthread_barrier_wait.c:116

#0  ___pthread_barrier_wait (barrier=0x555556a12870) at ./nptl/pthread_barrier_wait.c:116
#1  0x00007ffff2f7d8b7 in do_job () from /home/ubuntu/.local/share/virtualenvs/gamebot-s1LiBexb/lib/python3.10/site-packages/blosc2/blosc2_ext.cpython-310-x86_64-linux-gnu.so
#2  0x00007ffff2f7ee3f in blosc_run_decompression_with_context () from /home/ubuntu/.local/share/virtualenvs/gamebot-s1LiBexb/lib/python3.10/site-packages/blosc2/blosc2_ext.cpython-310-x86_64-linux-gnu.so
#3  0x00007ffff2f7f404 in blosc2_decompress () from /home/ubuntu/.local/share/virtualenvs/gamebot-s1LiBexb/lib/python3.10/site-packages/blosc2/blosc2_ext.cpython-310-x86_64-linux-gnu.so
#4  0x00007ffff2f5ed29 in __pyx_pf_6blosc2_10blosc2_ext_4decompress.constprop.0 () from /home/ubuntu/.local/share/virtualenvs/gamebot-s1LiBexb/lib/python3.10/site-packages/blosc2/blosc2_ext.cpython-310-x86_64-linux-gnu.so
#5  0x00005555556afb5e in ?? ()
#6  0x00005555556a67db in _PyObject_MakeTpCall ()
#7  0x000055555569f48e in _PyEval_EvalFrameDefault ()
#8  0x00005555556b03ac in _PyFunction_Vectorcall ()
#9  0x0000555555699005 in _PyEval_EvalFrameDefault ()
#10 0x00005555556b03ac in _PyFunction_Vectorcall ()
#11 0x000055555569914a in _PyEval_EvalFrameDefault ()
#12 0x00005555556b03ac in _PyFunction_Vectorcall ()
#13 0x00005555556a5a0d in _PyObject_FastCallDictTstate ()
#14 0x00005555556ba594 in ?? ()
#15 0x00005555556a6b8b in ?? ()
#16 0x00005555556befcb in PyObject_Call ()
#17 0x000055555569b3b0 in _PyEval_EvalFrameDefault ()
#18 0x00005555556b03ac in _PyFunction_Vectorcall ()
#19 0x00005555556a5a0d in _PyObject_FastCallDictTstate ()
#20 0x00005555556ba594 in ?? ()
#21 0x00005555556a677c in _PyObject_MakeTpCall ()
#22 0x000055555569fe1c in _PyEval_EvalFrameDefault ()
#23 0x00005555556b03ac in _PyFunction_Vectorcall ()
#24 0x00005555556a5a0d in _PyObject_FastCallDictTstate ()
#25 0x00005555556ba594 in ?? ()
#26 0x00005555556a677c in _PyObject_MakeTpCall ()
#27 0x000055555569fe1c in _PyEval_EvalFrameDefault ()
#28 0x00005555556cd900 in ?? ()
#29 0x00007ffff755762e in ?? () from /usr/lib/python3.10/lib-dynload/_asyncio.cpython-310-x86_64-linux-gnu.so
#30 0x00007ffff7557444 in ?? () from /usr/lib/python3.10/lib-dynload/_asyncio.cpython-310-x86_64-linux-gnu.so
#31 0x00005555556a67db in _PyObject_MakeTpCall ()
#32 0x000055555583fb12 in ?? ()
MrPigss commented 1 year ago

This looks like a Blosc error. Could you try something like this:

from blosc2 import decompress

with open("path/to/db/file", "rb") as db_file:
    data = decompress(db_file.read())

    # let's just print the first 1000 chars, we don't need the entire file.
    print(data[:1000])

Try it both on the working machines as the VPS. If this has the same behaviour then you should probably create an Issue on the blosc2 repo.

mastercoms commented 1 year ago

Works on the working machines.

Doesn't work on the faulty machine.

Will report to blosc.