Skip to content
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

Bad Conversions on FreeBSD 13.0 i386 #10

Open
uyota opened this issue Jan 8, 2022 · 1 comment
Open

Bad Conversions on FreeBSD 13.0 i386 #10

uyota opened this issue Jan 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@uyota
Copy link
Contributor

uyota commented Jan 8, 2022

U8, UINT, ULONG, and LONG types cause errors in FreeBSD 13.0-RELEASE with i386 arch:

% python
Python 3.7.9 (default, Feb 28 2021, 01:41:41) 
[Clang 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c on freebsd13
>>> from freebsd_sysctl import Sysctl
>>> a = Sysctl("vm.kmem_size")
>>> print(a.value)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/freebsd_sysctl/__init__.py", line 103, in value
    return self.raw_value.value
  File "/usr/local/lib/python3.7/site-packages/freebsd_sysctl/types.py", line 51, in value
    self.data
struct.error: unpack requires a buffer of 8 bytes

kern.poweroff_on_panic is U8
kern.maxvnodes is UINT
vm.kvm_size is LONG
vm.kmem_size is ULONG

freebsd-sysctl was installed via pkg:

% pkg query '%n-%v' py37-freebsd-sysctl
py37-freebsd-sysctl-0.0.7

long and ulong are 4 bytes on i386 but 8 bytes conversion is specified, q and Q.

@gronke gronke added the bug Something isn't working label Jan 8, 2022
@igalic
Copy link
Collaborator

igalic commented Apr 15, 2022

with #11 merged, can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants