pigpio: Unhandled signal 11 when running on 64-bit Alpine

I kept getting this error when trying to compile this code on my Raspberry Pi 3 Model B rev 1.2. (64-bit) running OS Alpine-v3.12(64-bit).

Unhandled signal 11

A lot of searching and I started digging into this repo. I found that CPU amount was not set to 4 cores, but to 1 core. I think this is due to the way function gpioHardwareRevision() in the file pigpio.c is detecting my board version, since my BCM2837 chip is responding as it is a BCM2835 chip when running cat /proc/cpuinfo.

I then found this quote from the Raspberry Pi team specifically on the revision codes: As of the 4.9 kernel, all Pis report BCM2835, even those with BCM2836, BCM2837 and BCM2711 processors. You should not use this string to detect the processor. Quote from here written 2. aug. 2019 12.53 CEST.

More readning at stackExchange

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 43 (1 by maintainers)

Commits related to this issue

Most upvoted comments

That’s not a bad idea to combine all PR and issues into a 64-bit compatibility development branch. Maybe also write in README.md about this branch to pipe new PR/issues into that branch…

@guymcswain One of the Raspbian guys (plugwash) did the 64-bit work on pigpio. You’ll see comments sprinkled around the code.

socket connect failed

It never connected to the daemon via the socket. The log shows no evidence of an attempted/failed connection. From the log file it looks like it never got out of the DMA initialization process. So while it made further progress it is still fundamentally broke in this area for 64-bit.

I also noticed that issuing Control+C, for stopping [0] pigpiod, triggers

The daemon process ignores all signals. The way to stop it is to kill the process (from pigpio faq ):

Check that it is running with the command
ps aux | grep pigpiod

Kill the daemon with

sudo killall pigpiod

If your own program is acting as the daemon it may be removed as follows.

Find its process id (pid).

cat /var/run/pigpio.pid


Kill the program with

sudo kill -9 pid


If the above doesn't work do the following and try starting the daemon again
sudo rm /var/run/pigpio.pid

Oh, and importantly, since it crashed, you will need to remove the file /var/run/pigpio.pid.

if multiple users wanted a working 64-bit version, the best way was to share details of it here

I’m not disagreeing. But what I think is needed for that to work is a comprehensive review and conversion of pigpio to work in both 32-bit and 64-bit environments. For example, there are many instances of variables declared as int that are assumed to be 32 bits in size. Up until now, the author, Joan, has been reluctant to wade into 64 bit without an official OS from the Raspberry Pi org. With the recent introduction of Raspberry Pi OS (64 bit) beta test version now may be the time.

I would be happy to host an experimental 64-bit branch on this repo for the community to post pull requests with patches to make this conversion.

pigpio was written for a 32-bit userland. It is possible to run pigpio successfully on a machine with a 64-bit kernel and a 32-bit userland as is done on Gentoo 64. If Alpine with 64-bit kernel is running 64-bit userland then pigpio is unlikely to work.

I think a command you can run to show the ‘bit-ness’ of your installed userland is: getconf LONG_BIT.

Tried PR #342 with semi succes. Only worked when I ran pigpiod -g (without -a 1) as mentioned in PR. It worked and pigpiod ran on Alpine 64-bit, but only the first time i fired up pigpiod. When i killed it and tried to run it again a second time I was back to this error:

initMboxBlock: init mbox zaps failed

A reboot of the Pi fixed it, and I can run the service again one time before the error. Seams as PR #342 have a problem releasing memory or something.