Skip to content

Container segfault when attempting to program #2

@jackm

Description

@jackm

After starting up the container, opening an existing Diamond project, and then going to Tools > Programmer, the main container process (i.e. the Diamond IDE) exits due to a segfault. For the physical programmer, I am using a Lattice HW-USBN-2B programmer cable. Note that I also manually named the docker container and prevented it from being deleted after exiting.

Checking the container logs I see this:

user@host:~/docker-fpga/lattice-diamond$ docker logs diamond-3.11-sp1
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
libusb couldn't open USB device /dev/bus/usb/002/006: Permission denied.
libusb requires write access to USB device nodes.
/opt/docker-fpga/run.sh: line 5:     9 Segmentation fault      (core dumped) diamond

Indeed, the USB device file is only writable by root:

user@host:~$ ls -l /dev/bus/usb/002/006
crw-rw-r-- 1 root root 189, 133 Dec 20 12:12 /dev/bus/usb/002/006

Is this expected? The user I am running the container under is a member of the "docker" group so it is able to run docker commands however it is not running as the root user of the host so the permission problems are to be expected if it is trying to write to /dev/bus/usb/002/006. I also tried using sudo docker start diamond-3.11-sp1 to re-start the existing container as root but I still got the same permission problems followed by a segfault.

What is the proper solution here? Perhaps a udev rule is needed for the programmer?

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