Hi there.
Because of a lack of updated and Python 3 compatible Filament Sensor plugins (where pull requests are looked at and accepted), I decided to fork "Filament Sensor Reloaded", mix it a bit with "Filament Sensor Simplified" to try and take the best of both worlds. The entire day has been spent on development and tweaking, but I have hit an issue I can't seem to get past.
The issue:
I get the error Segmentation fault
- only visible when I manually serve OctoPrint using ~/oprint/bin/octoprint serve
via SSH connection. The plugin can be found here; https://github.com/SimplyPrint/OctoPrint-SimplyFilamentSensor - still under development, of course.
How to re-create the issue:
It's a bit random when this happens, but the most sure way to re-create for me has been;
- have the plugin enabled
- have a filament sensor
- have filament in the sensor
- pull the filament out, resulting in the print pausing
- without inserting more filament, resume the print
- if it hasn't crashed yet, pause the print manually
It also happened once after having a print running, stopping the print and simply starting it again. It's a bit random whether it happens when the filament sensor has filament in it or not.
All testing has been done on an OctoPrint instance running a virtual printer.
What I have tried, and what I know about the issue:
To try and get more out of the "Segmentation error", I imported the faulthandler
package and execute faulthandler.enable()
right after the imports in the plugin. This resulted in getting the following string of errors; (very long...)
2020-09-15 22:56:26,807 - octoprint.util.comm - INFO - Changing monitoring state from "Printing" to "Pausing"
Fatal Python error: Segmentation fault
Thread 0x64441460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x667ab460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x64c42460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/Queue.py", line 168 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/concurrent/futures/thread.py", line 73 in _worker
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x65443460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x698f1460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x688ef460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x690f0460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6a0f2460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6b0f4460 <octoprint> (most recent call first):
File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/virtual_printer/virtual.py", line 1255 in _performMove
File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/virtual_printer/virtual.py", line 1478 in _processBuffer
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6b8f5460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/Queue.py", line 126 in put
File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/virtual_printer/virtual.py", line 726 in _gcode_G0
File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/virtual_printer/virtual.py", line 441 in _processIncoming
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6c8f7460 <octoprint> (most recent call first):
File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/discovery/__init__.py", line 669 in _ssdp_monitor
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6d8f9460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/Queue.py", line 177 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 368 in dispatch_events
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 203 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6e0fa460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/utils/delayed_queue.py", line 54 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/observers/inotify_buffer.py", line 43 in read_event
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/observers/inotify.py", line 131 in queue_events
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/observers/api.py", line 152 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6e8fb460 <octoprint> (most recent call first):
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/observers/inotify_c.py", line 314 in read_events
File "/home/pi/oprint/local/lib/python2.7/site-packages/watchdog/observers/inotify_buffer.py", line 88 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x6f8fd460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1514 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 3399 in _send_loop
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x700fe460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/Queue.py", line 177 in get
File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/virtual_printer/virtual.py", line 1542 in readline
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 2916 in _readline
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 1708 in _monitor
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x71cff460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/Queue.py", line 168 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/concurrent/futures/thread.py", line 73 in _worker
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x708ff460 <octoprint> (most recent call first):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/printer/standard.py", line 1501 in _work
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x712ff460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/Queue.py", line 168 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/filemanager/analysis.py", line 230 in _work
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x726ee460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x739ff460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 359 in wait
File "/usr/lib/python2.7/threading.py", line 614 in wait
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/__init__.py", line 1375 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x743fe460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/Queue.py", line 168 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/events.py", line 177 in _work
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x74fff460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/Queue.py", line 168 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/concurrent/futures/thread.py", line 73 in _worker
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x7595d460 <octoprint> (most recent call first):
File "/usr/lib/python2.7/threading.py", line 340 in wait
File "/usr/lib/python2.7/Queue.py", line 168 in get
File "/home/pi/oprint/local/lib/python2.7/site-packages/concurrent/futures/thread.py", line 73 in _worker
File "/usr/lib/python2.7/threading.py", line 754 in run
File "/usr/lib/python2.7/threading.py", line 801 in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 774 in __bootstrap
Thread 0x76cb9010 <octoprint> (most recent call first):
File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/ioloop.py", line 1048 in start
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/__init__.py", line 940 in run
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/cli/server.py", line 119 in run_server
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/cli/server.py", line 207 in serve_command
File "/home/pi/oprint/local/lib/python2.7/site-packages/click/decorators.py", line 21 in new_func
File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 610 in invoke
File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 1066 in invoke
File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 1259 in invoke
File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 782 in main
File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 829 in __call__
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/__init__.py", line 629 in main
File "/home/pi/oprint/bin/octoprint", line 8 in <module>
Segmentation fault
As none of the files listed lead to anything plugin-specific, I am not sure where to go from here, and how to figure out exactly what the issue might be.
My theory is that it's GPIO-related. I am unsure where to go from here, so I hope someone made it to the end, and has the will to check some of this out - I know that let alone the filament sensor requirement for testing is a bit rough...
Any suggestions ar every welcome! Thanks!