pylsl: access violation reading 0xFFFFFFFFFFFFFFFF
Exception in thread Thread-4:
Traceback (most recent call last):
File "C:\Users\Gerbuiker\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Users\Gerbuiker\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:/Users/Gerbuiker/PycharmProjects/LabEnvironment/receive_data.py", line 14, in read_stream
ch_labels.append(ch.child_value("label"))
File "C:\Users\Gerbuiker\Documents\Virtualenvs\HITLab\lib\site-packages\pylsl\pylsl.py", line 985, in child_value
res = lib.lsl_child_value_n(self.e, str.encode(name))
OSError: exception: access violation reading 0xFFFFFFFFFFFFFFFF
Happens sporadically so I’m not sure how to reproduce it but I’m reading multiple streams, one stream per thread.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (11 by maintainers)
Links to this issue
Commits related to this issue
- Update known issues with threading Fix https://github.com/labstreaminglayer/liblsl-Python/issues/29 — committed to agricolab/liblsl-Python by agricolab 2 years ago
Something like
https://docs.python.org/3/library/threading.html#with-locks
On a side note: If you only pull single samples, but print and write to file every time, this might be slower than new samples coming in. You might want to switch to chunks or fill a buffer instead, unless your sampling rate is very slow.
Hello,
If it helps, I was also having issues with multiple threads on python, but only when I was trying to access inlet’s info. I think the issues comes from how XML is handled internally by liblsl. I managed to find a workaround by parsing it manually, e.g.:
(tested with python 2, run on python 3 but I did not try to reproduce the original problem)
Beside that I never had any troubles with multi-threading and LSL, that I have been using heavily 😃
edit: I don’t remember the error I got but I think it was also a weird “access violation”, always a shock wihen dealing with python 😄