uv-k5-firmware-custom icon indicating copy to clipboard operation
uv-k5-firmware-custom copied to clipboard

Compilation error (error: 'MSG_Send' reading 30 bytes from a region of size 8)

Open eried opened this issue 1 year ago • 11 comments

Hi! thanks for the messenger, it is awesome! I am trying to compile my own with VOX but following the codespaces I get this error:

app/messenger.c: In function 'MSG_StorePacket':
app/messenger.c:698:25: error: 'MSG_Send' reading 30 bytes from a region of size 8 [-Werror=stringop-overread]
  698 |                         MSG_Send("\x1b\x1b\x1bRCVD", true);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
app/messenger.c:698:25: note: referencing argument 1 of type 'const char[30]'
app/messenger.c:542:6: note: in a call to function 'MSG_Send'
  542 | void MSG_Send(const char txMessage[TX_MSG_LENGTH], bool bServiceMessage) {
      |      ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:488: _build/app/messenger.o] Error 1
@eried ➜ /workspaces/uv-k5-firmware-custom (main) $ 

is there is any extra step when compiling it?

# ---- STOCK QUANSHENG FERATURES ----
ENABLE_UART                   ?= 1
ENABLE_AIRCOPY                ?= 1
ENABLE_FMRADIO                ?= 1
ENABLE_NOAA                   ?= 0
ENABLE_VOICE                  ?= 0
ENABLE_VOX                    ?= 1
ENABLE_ALARM                  ?= 0
ENABLE_TX1750                 ?= 0
ENABLE_PWRON_PASSWORD         ?= 0
ENABLE_DTMF_CALLING           ?= 0
ENABLE_FLASHLIGHT             ?= 0

eried avatar Jan 16 '24 20:01 eried

I think this means you've run out of memory. Try to disable a few features and run it again.

jamie-2bit avatar Jan 17 '24 12:01 jamie-2bit

mmmm, strange because even using the default makefile throws the error:

# ---- STOCK QUANSHENG FERATURES ----
ENABLE_UART                   ?= 1
ENABLE_AIRCOPY                ?= 0
ENABLE_FMRADIO                ?= 0
ENABLE_NOAA                   ?= 0
ENABLE_VOICE                  ?= 0
ENABLE_VOX                    ?= 0
ENABLE_ALARM                  ?= 0
ENABLE_TX1750                 ?= 0
ENABLE_PWRON_PASSWORD         ?= 0
ENABLE_DTMF_CALLING           ?= 0
ENABLE_FLASHLIGHT             ?= 0

eried avatar Jan 17 '24 12:01 eried

Same issue here, using default makefile, docker method. This happens even when going back to older versions (tried with repo checked out on "build 0.2.5" and various other commits. Works fine with latest egzumer FW.

jan-Sanku avatar Jan 18 '24 01:01 jan-Sanku

I had this issue when using a recent gcc-arm-none-eabi build system (13.2.1), but when I forced version 10.3-2021.1 it compiled fine. I just download the desired version for my OS, unzip/unpack it to a directory on my system, and then call make using a modified PATH environment variable, like

PATH=../../gcc-arm-none-eabi-10.3-2021.10/bin/:../../gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/bin:$PATH make -j20

This requirement/suggestion goes all the way back to the original DualTachyon clone firmware.

Separate issue is make clean doesn't correctly remove the _build directory on MacOS.

joecotton avatar Jan 18 '24 02:01 joecotton

PATH=../../gcc-arm-none-eabi-10.3-2021.10/bin/:../../gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/bin:$PATH make -j20

Ah, nice, thanks! following this then you can do this on the codespace


cd /opt
wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2"
tar -jxf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
rm gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
export PATH=../../gcc-arm-none-eabi-10.3-2021.10/bin/:../../gcc-arm-none-eabi-10.3-2021.10/arm-none-eabi/bin:$PATH
cd /workspaces/uv-k5-firmware-custom
pin install crcmod
rm -r _build/
make clean
make 

There is some issue with some lines at the makefile (around line 444), it is printing a warning, so I just removed those.

eried avatar Jan 18 '24 09:01 eried

How can I integrate a Fix for the github actions?

matrix1000 avatar Jan 18 '24 09:01 matrix1000

@matrix1000 I got it to run in Github Actions using the resources @eried provided

cd /opt
wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2"
tar -jxf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
rm gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
export PATH="/opt/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"
cd /workspaces/uv-k5-firmware-custom
pip install crcmod
rm -r _build/
make clean
make

randoassuser avatar Feb 18 '24 12:02 randoassuser

@matrix1000 I got it to run in Github Actions using the resources @eried provided

Do you have an workflows/main.yml example? Or how you get it working?

matrix1000 avatar Mar 04 '24 08:03 matrix1000

Just clone the repo to a Codespace

randoassuser avatar Apr 13 '24 01:04 randoassuser

anyone know the fix for this? i'm still getting the error when composing in the codespace. Thanks.

app/messenger.c: In function 'MSG_StorePacket': app/messenger.c:694:25: error: 'MSG_Send' reading 30 bytes from a region of size 8 [-Werror=stringop-overread] 694 | MSG_Send("\x1b\x1b\x1bRCVD", true); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ app/messenger.c:694:25: note: referencing argument 1 of type 'const char[30]' app/messenger.c:538:6: note: in a call to function 'MSG_Send' 538 | void MSG_Send(const char txMessage[TX_MSG_LENGTH], bool bServiceMessage) { | ^~~~~~~~ cc1: all warnings being treated as errors make: *** [Makefile:472: _build/app/messenger.o] Error 1

sumasage avatar Aug 11 '24 05:08 sumasage

In app/messenger.c replace row 694 from MSG_Send("\x1b\x1b\x1bRCVD", true); to MSG_Send("\x1b\x1b\x1bRCVD______________________", true);

Basically, the app is expecting a 30 bytes message, and only 8 were provided.

bitbam avatar Dec 08 '24 22:12 bitbam