cloudflare / cloudflared

Cloudflare Tunnel client (formerly Argo Tunnel)

Home Page:https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Illegal instruction on armv6lšŸ›

giondo opened this issue Ā· comments

Describe the bug
Trying to run cloudflared on a raspberry pi zero w
tried also the version on the repositories
deb http://archive.raspberrypi.org/debian/ bullseye main

To Reproduce
Steps to reproduce the behavior:

Configure '...'
Download and install cloudflared-linux-armhf.deb
cloudflared/now 2023.10.0 armhf [installed,local]
Cloudflare Tunnel daemon

Run '....'
cloudflared
Illegal instruction

See error
Illegal instruction

If it's an issue with Cloudflare Tunnel:
6. Tunnel ID :
7. cloudflared config:

Expected behavior
Able to run the command with a normal output

Environment and versions

OS: Linux hostname 6.1.21+ #1642 Mon Apr 3 17:19:14 BST 2023 armv6l GNU/Linux

Architecture: [e.g. AMD, ARM] armv6l

Version: [e.g. 2022.02.0]
Architecture: armv6l
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
Vendor ID: ARM
Model: 7
Model name: ARM1176
Stepping: r0p7
CPU max MHz: 1000.0000
CPU min MHz: 700.0000
BogoMIPS: 697.95
Flags: half thumb fastmult vfp edsp java tls

Logs and errors
If applicable, add logs or errors to help explain your problem.

Additional context

dpkg: error processing archive cloudflared-linux-arm.deb (--install):
package architecture (arm) does not match system (armhf)
Errors were encountered while processing:
cloudflared-linux-arm.deb

#1136

issue still persist, not fixed in the new version arm is not the arch for this proc

:~# dpkg -i cloudflared-linux-armhf.deb
Selecting previously unselected package cloudflared.
(Reading database ... 43920 files and directories currently installed.)
Preparing to unpack cloudflared-linux-armhf.deb ...
Unpacking cloudflared (2024.1.3) ...
Setting up cloudflared (2024.1.3) ...
Processing triggers for man-db (2.9.4-2) ...
~# cloudflared -v
Illegal instruction

this is a 32 bit processor, please take into consideration

Architecture: armv6l
Byte Order: Little Endian
CPU(s): 1
On-line CPU(s) list: 0
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 1
Vendor ID: ARM
Model: 7
Model name: ARM1176
Stepping: r0p7
CPU max MHz: 1000.0000
CPU min MHz: 700.0000
BogoMIPS: 697.95
Flags: half thumb fastmult vfp edsp java tls

I believe you should use instead the arm version instead of armhf.

Can you try that one?

I'd like to add that I get the same error when using cloudflared-linux-arm v2024.1.3 on arm7l

# ./cloudflared-linux-arm --version
Illegal instruction

Here are my CPU details.

# cat /proc/cpuinfo
model name      : ARMv7 Processor rev 0 (v7l)
processor       : 0
BogoMIPS        : 1594.16
Features        : half fastmult edsp tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

model name      : ARMv7 Processor rev 0 (v7l)
processor       : 1
BogoMIPS        : 1594.16
Features        : half fastmult edsp tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x3
CPU part        : 0xc09
CPU revision    : 0

Hardware        : Northstar Prototype
Revision        : 0000
Serial          : 0000000000000000

Reverting to 2023.10.0 everything works just fine. I haven't tried compiling it myself yet, but just wanted to throw this in the bug hat, that it doesn't work in arm7l either ... at least for me.

Hi @magallz1, the arm release is meant for ARMv6. For ARMv7, please use armhf

Hello @chungthuang! Thanks for the quick reply. But I still have no joy:

# ./cloudflared-linux-armhf --version
Illegal instruction

Also to note, that if I try to use the 2023.10.0 armhf version, I get the illegal instruction. Using just the 2023.10.0 arm version works as expected though. I really appreciate you guys supporting all these architectures BTW. I'm certain this issue will be solved soon.

Greetings!

I have found my answer! I got some time today to try compiling my own version of cloudflared. I first tried just going for the arm7l version and still got the Illegal instruction error. So I started backing things down. I got it working with arm5!

After educating myself about GOARM and go in general, it looks like GOARM=7 defaults to a hardware FPU (vfp). My v7l doesn't have that feature. It has to use a software floating point. v5 defaults to a software floating point so that is why it works for me now. In issue 61588 in the go project, it looks like they are introducing a method to designate a software FP option for arm 6 & 7. It is slated to be included in go 1.22. Until that comes out, it looks like arm CPUs that do not have the vfp feature are going to have to compile with v5. In my compile, I have to set the following:
GOOS=linux GOARCH=arm GOARM=5

@chungthuang, would it be unreasonable to request a different version of cloudflared that supports arms with software FP (armsf)? If so, should I recreate a separate feature report for that or will the comments here be sufficient (with maybe a title change)?

@joliveirinha this is still an issue for me on a Raspberry Pi Zero 2 W running Raspberry Pi OS. It was not resolved in #1136

Attached is my output log for apt-get install

jeremyloy@pihole:~ $ sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease [15.0 kB]
Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:3 https://pkg.cloudflare.com/cloudflared bullseye InRelease
Fetched 15.0 kB in 4s (3,936 B/s)
Reading package lists... Done
jeremyloy@pihole:~ $ apt-get install cloudflared
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
jeremyloy@pihole:~ $ sudo !!
sudo apt-get install cloudflared
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be upgraded:
  cloudflared
1 upgraded, 0 newly installed, 0 to remove and 78 not upgraded.
Need to get 16.2 MB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 https://pkg.cloudflare.com/cloudflared bullseye/main armhf cloudflared armhf 2024.1.4 [16.2 MB]
Fetched 16.2 MB in 8s (1,913 kB/s)
Reading changelogs... Done
(Reading database ... 46018 files and directories currently installed.)
Preparing to unpack .../cloudflared_2024.1.4_armhf.deb ...
Unpacking cloudflared (2024.1.4) over (2024.1.2) ...
Setting up cloudflared (2024.1.4) ...
Processing triggers for man-db (2.9.4-2) ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.
jeremyloy@pihole:~ $ which cloudflared
/usr/local/bin/cloudflared
jeremyloy@pihole:~ $ cloudflared --version
Illegal instruction

Hey,

I think the problem you are facing is all the same.

it seems that although some of you are using ARM platforms that should have an FPU (eg.ARMv7), it seems that you don't have it enabled in the kernel. (it seems that it requires Kernel support which can be disabled via the kernel bootline).
This can be validated by the fact ,that the CPU info shared doesn't show in the CPU features vpf, altough it is a armv7 which I believe it should have a FPU unit.

So, the solution for this, is to make sure that the ARM build we build is targeted for ARM=5 instead of ARM=6, which requires vpf support.

This should be fixed in the next release.

Closing for now.

@joliveirinha here is the output for my cpuinfo.

I think you're correct, fpu is not enabled. However, vfp is enabled, which is a different floating point instruction.

I'm wondering if this is something that should be made into a Golang issue.

I do see that vfp isn't supported in the compiler at present, so maybe we can reference this issue as a reason to add support for that.


jeremyloy@pihole:~ $ cat /proc/cpu
cpu/     cpuinfo
jeremyloy@pihole:~ $ cat /proc/cpuinfo
processor	: 0
model name	: ARMv6-compatible processor rev 7 (v6l)
BogoMIPS	: 697.95
Features	: half thumb fastmult vfp edsp java tls
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xb76
CPU revision	: 7

Hardware	: BCM2835
Revision	: 9000c1
Serial		: 0000000010d6bc46
Model		: Raspberry Pi Zero W Rev 1.1```