DeskPi-Team / deskpi

DeskPi Pro is the Ultimate Case Kit for Raspberry Pi 4 with Full Size HDMI/2.5 Hard Disk Support and Safe Power Button, It has QC 3.0 Power Supply inside and New ICE Tower Cooler inside.
GNU General Public License v3.0
145 stars 46 forks source link

Segmentation Faults ubuntu 22.10 x64 #142

Closed TardisJacker closed 4 months ago

TardisJacker commented 1 year ago

I've got a deskpi pro with the Ubuntu latest 22.10 image installed booting via the USB SSD adapter that came as a part of the kit. I've pulled and installed the latest version and have issues with Segmentation Fault errors without any further information. It seems that these tools are not yet ready for 22.10.

  1. Out of the gate I kept receiving errors about needing to change dtoverlay settings in /boot/configs.txt that were already enabled under /boot/firmware/configs.txt and that ttyUSB0 wasn't found. a test case for where the configs are may be appropriate
# Config settings specific to arm64
arm_64bit=1
dtoverlay=dwc2,dr_mode=host
  1. while It appears that the patches found in https://github.com/DeskPi-Team/deskpi/issues/118#issue-1272238182 will likely help with issues related to the device naming especially when using any other USB serial devices; the issue on a system with only the deskpi seems related to a match found via brltty, with a fix found here: https://github.com/juliagoda/CH341SER/issues/18#issuecomment-1413273419

    comment out this line:
    ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run"
    in this file:
    /usr/lib/udev/rules.d/85-brltty.rules
    Then reboot
  2. Now that we've sorted the issues with /dev/ttyUSB0 via the brltty fix, running the command to start the service returns a segfault

    me@deskpi:~$ sudo /usr/bin/pwmFanControl
    Segmentation fault

Info provided by: journalctl -xeu deskpi.service

Apr 10 11:27:55 deskpi systemd[1]: Starting DeskPi PWM Control Fan Service...
░░ Subject: A start job for unit deskpi.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit deskpi.service has begun execution.
░░ 
░░ The job identifier is 206.
Apr 10 11:27:55 deskpi sudo[1598]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/pwmFanControl &
Apr 10 11:27:55 deskpi sudo[1598]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Apr 10 11:27:56 deskpi sudo[1598]: pam_unix(sudo:session): session closed for user root
Apr 10 11:27:56 deskpi systemd[1]: deskpi.service: Main process exited, code=killed, status=11/SEGV
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ An ExecStart= process belonging to unit deskpi.service has exited.
░░ 
░░ The process' exit code is 'killed' and its exit status is 11.
Apr 10 11:27:56 deskpi systemd[1]: deskpi.service: Failed with result 'signal'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit deskpi.service has entered the 'failed' state with result 'signal'.
Apr 10 11:27:56 deskpi systemd[1]: Failed to start DeskPi PWM Control Fan Service.
░░ Subject: A start job for unit deskpi.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit deskpi.service has finished with a failure.
░░ 
░░ The job identifier is 206 and the job result is failed.
Apr 10 11:46:07 deskpi systemd[1]: Starting DeskPi PWM Control Fan Service...
░░ Subject: A start job for unit deskpi.service has begun execution
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit deskpi.service has begun execution.
░░ 
░░ The job identifier is 3426.
Apr 10 11:46:07 deskpi sudo[2826]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/pwmFanControl &
Apr 10 11:46:07 deskpi sudo[2826]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Apr 10 11:46:08 deskpi sudo[2826]: pam_unix(sudo:session): session closed for user root
Apr 10 11:46:08 deskpi systemd[1]: deskpi.service: Main process exited, code=killed, status=11/SEGV
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ An ExecStart= process belonging to unit deskpi.service has exited.
░░ 
░░ The process' exit code is 'killed' and its exit status is 11.
Apr 10 11:46:08 deskpi systemd[1]: deskpi.service: Failed with result 'signal'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ The unit deskpi.service has entered the 'failed' state with result 'signal'.
Apr 10 11:46:08 deskpi systemd[1]: Failed to start DeskPi PWM Control Fan Service.
░░ Subject: A start job for unit deskpi.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░ 
░░ A start job for unit deskpi.service has finished with a failure.
░░ 
░░ The job identifier is 3426 and the job result is failed.
me@deskpi:~/deskpi$ 

and from systemctl status deskpi.service

jgraham@jaydon-deskpi:~/deskpi$ systemctl status deskpi.service 
× deskpi.service - DeskPi PWM Control Fan Service
     Loaded: loaded (/lib/systemd/system/deskpi.service; enabled; preset: enabled)
     Active: failed (Result: signal) since Mon 2023-04-10 11:46:08 MST; 4min 24s ago
    Process: 2826 ExecStart=sudo /usr/bin/pwmFanControl & (code=killed, signal=SEGV)
   Main PID: 2826 (code=killed, signal=SEGV)
        CPU: 35ms

Apr 10 11:46:07 jaydon-deskpi systemd[1]: Starting DeskPi PWM Control Fan Service...
Apr 10 11:46:07 jaydon-deskpi sudo[2826]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/pwmFanControl &
Apr 10 11:46:07 jaydon-deskpi sudo[2826]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Apr 10 11:46:08 jaydon-deskpi sudo[2826]: pam_unix(sudo:session): session closed for user root
Apr 10 11:46:08 jaydon-deskpi systemd[1]: deskpi.service: Main process exited, code=killed, status=11/SEGV
Apr 10 11:46:08 jaydon-deskpi systemd[1]: deskpi.service: Failed with result 'signal'.
Apr 10 11:46:08 jaydon-deskpi systemd[1]: Failed to start DeskPi PWM Control Fan Service.

I'll start looking into how the build is being done and if there are other issues in here that may have fixes via patches or changes to the systemd service portions but at this point the only hint I've got is a Segmentation Fault with return code 11 if anyone has any insight there

jzazo commented 1 year ago

Are you using 64bits? I had some back and forths with 22.04, have you tried to install with these changes?

noanight commented 1 year ago

I'm using mate 64 bit and have the same issue. Installed with install-ubuntu-64.sh and added the compilation of fanStop.c. There is no /dev/ttyUSB0 device listed with ls /dev/tty*

Why is /dev/ttyUSB0 not created? There is a /dev/ttyAMA0 device...

jzazo commented 1 year ago

no idea... sorry

TardisJacker commented 1 year ago

I seem to have figured it out, due to the complications in my installation; for whatever reason /etc/deskpi.conf wasn't created when I installed or attempted re-installs with the script. I was able to use the deskpi-config with the option to set my own curve which created the file that fixed my issue. I will attempt a clean re-image of my PI with the mentioned fix commenting out ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run" In /usr/lib/udev/rules.d/85-brltty.rules and report back here if that's what it takes to install on 22.10

TardisJacker commented 1 year ago

@jzazo I'll look at using the linked patches as well, thanks for the tip! @noanight I was able to fix it by commenting out the mentioned line in my brltty rules, if you grep for ttyUSB on dmesg output after a fresh boot you'll see that brltty is disconnecting the fan control on /dev/ttyUSB0 due to that rule.

noanight commented 1 year ago

@tardisjacker thx, ttyUSB0 is now available.

but calling: sudo pwmControlFan returns "Segmentation fault" too...

yoyojacky commented 1 year ago

please check your OS platform, if you are using 64bit arch, please use pwmfancontrol64 it is a 64bit binary file, pwmfancontrol is 32bit

yoyojacky commented 1 year ago

sudo /usr/bin/pwmFanControl

try to cope pwmFanControl64 to /usr/bin/ location and then execute :

sudo /usr/bin/pwmFanControl64

noanight commented 1 year ago

@yoyojacky i'm using mate 64bit