Skip to content

segfault calling python-mbus #10

@sjlongland

Description

@sjlongland

Just running the tests that come with python-mbus causes the Python interpreter to segfault.

libmbus is git head as of this morning, tried both with commit widesky/libmbus@716d712 and widesky/libmbus@ef6c4be. libmbus itself appears to work judging from the test/example programs it comes with, so it looks to be something funny with python-mbus.

RC=0 stuartl@rikishi /tmp/python-mbus $ py.test 
======================================================================== test session starts ========================================================================
platform linux2 -- Python 2.7.7 -- py-1.4.30 -- pytest-2.7.2
rootdir: /tmp/python-mbus, inifile: pytest.ini
plugins: cov
collected 16 items 

tests/test_MBus_connect.py Segmentation fault

Changes to python-mbus:

diff --git a/mbus/MBus.py b/mbus/MBus.py
index 7f26165..671a18f 100644
--- a/mbus/MBus.py
+++ b/mbus/MBus.py
@@ -60,7 +60,7 @@ class MBus:
                 raise TypeError("port number not given as integer")

         if None == libpath:
-            libpath = "/usr/local/lib/libmbus.so"
+            libpath = "/usr/local/lib64/libmbus.so"

         self._libmbus = cdll.LoadLibrary(libpath)

diff --git a/pytest.ini b/pytest.ini
index f84356a..0cd849c 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,8 +1,8 @@
 [pytest]
-addopts = --pep8 --cov-config .coveragerc --cov . tests/
+addopts = --cov-config .coveragerc --cov . tests/

-serialdevice = /dev/adjustme
+serialdevice = /dev/ttyS0
 ;serialdevice = /dev/ttyUSB0

 markers =
-       serial: mark a test to be run with serial device attached
\ No newline at end of file
+       serial: mark a test to be run with serial device attached

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions