libvmi / python

LibVMI Python bindings
http://libvmi.com/
GNU Lesser General Public License v3.0
30 stars 22 forks source link

fi.error: the C compiler says 'VMI_EVENTS_VERSION' is equal to 8 (0x8), but the cdef disagrees #75

Closed cotic closed 2 years ago

cotic commented 2 years ago

VMI_EVENTS_VERSION is 8 in :

https://github.com/libvmi/libvmi/blob/master/libvmi/events.h#L36

and is 7 in the current python bindings:

https://github.com/libvmi/python/blob/master/libvmi/events_cdef.h#L1

This causes an error:

File "singlestep-event.py", line 8, in <module>
    from libvmi.event import SingleStepEvent
  File "/home/andrew/Documents/python-virtual-environments/LibVMI/lib/python3.8/site-packages/libvmi-3.4-py3.8-linux-x86_64.egg/libvmi/event.py", line 7, in <module>
    EVENTS_VERSION = lib.VMI_EVENTS_VERSION
ffi.error: the C compiler says 'VMI_EVENTS_VERSION' is equal to 8 (0x8), but the cdef disagrees

I assume this is a check, as the DS may have changed, and the fix, for now, is to use with an older version of LibVMI that is set to 7?

Wenzel commented 2 years ago

Hi @cotic thank you for this bug report, there is indeed a mismatch between the 2 versions.

I created a PR to fix it.

The VMI_EVENTS_VERSION has been upgraded from 0x7 to 0x8 since the nested page table walk support. I fixed the python bindings to support this feature as well in this commit: https://github.com/libvmi/python/commit/82dfaa9c89ed6701ce6b02a0fda3028e03049810

What I don't understand at this point is why the CI didn't catch it and was green, despite having a library import smoke test https://github.com/libvmi/python/actions/runs/1186795342