strandborg / AlsavoCtrl

Alsavo Heat Pump control application
Other
11 stars 2 forks source link

Loguru caught a signal: SIGBUS #19

Open DKLeader opened 1 year ago

DKLeader commented 1 year ago

Hi

Freshly installed AlsavoCtrl on a Pi 4 using Bullseye, and keep getting SIGBUS error. Was workign on a Pi 3 using Buster.

date time ( uptime ) [ thread name/id ] file:line v| 2023-07-15 16:37:45.360 ( 0.001s) [main thread ] loguru.cpp:647 INFO| arguments: /home/pi/AlsavoCtrl/build/AlsavoCtrl -s SERIAL -l PASSWORD -a 192.168.101.135 -p 1194 2023-07-15 16:37:45.360 ( 0.001s) [main thread ] loguru.cpp:650 INFO| Current dir: /home/pi/AlsavoCtrl 2023-07-15 16:37:45.360 ( 0.001s) [main thread ] loguru.cpp:652 INFO| stderr verbosity: 0 2023-07-15 16:37:45.360 ( 0.001s) [main thread ] loguru.cpp:653 INFO| -----------------------------------

Loguru caught a signal: SIGBUS Stack trace: 0 0xf74d4910 __default_rt_sa_restorer + 0 2023-07-15 16:37:45.360 ( 0.001s) [main thread ] :0 FATL| Signal: SIGBUS

strandborg commented 1 year ago

I'm currently running this on Pi 4 as well without any problems. A debug build would probably give a better stack trace, or running the app in a debugger directly.

DKLeader commented 1 year ago

Thank you for the reply. Have now tried installing same Bullseye from Raspberry Pi Imager a few times and suddenly it got a bit further. Only change was using: cmake .. --debug-output make -d Not sure why this made a difference.

Although, now I have a new issue. Both Pi's are on the same net.

On the old Pi it connects fine to the Heater:

rroot@raspberrypi:~# /home/pi/alsavo/AlsavoCtrl-main/build/AlsavoCtrl -s SERIAL -l PASSWORD -a 192.168.101.135 -p 1194 date time ( uptime ) [ thread name/id ] file:line v| 2023-07-16 20:43:04.802 ( 0.003s) [main thread ] loguru.cpp:647 INFO| arguments: /home/pi/alsavo/AlsavoCtrl-main/build/AlsavoCtrl -s SERIAL -l PASSWORD -a 192.168.101.135 -p 1194 2023-07-16 20:43:04.802 ( 0.003s) [main thread ] loguru.cpp:650 INFO| Current dir: /root 2023-07-16 20:43:04.802 ( 0.003s) [main thread ] loguru.cpp:652 INFO| stderr verbosity: 0 2023-07-16 20:43:04.803 ( 0.003s) [main thread ] loguru.cpp:653 INFO| ----------------------------------- 2023-07-16 20:43:04.803 ( 0.003s) [main thread ] AlsavoCtrl.cpp:359 INFO| Disconnecting. 2023-07-16 20:43:04.803 ( 0.004s) [main thread ] AlsavoCtrl.cpp:292 INFO| Connecting to 192.168.101.135:1194... 2023-07-16 20:43:04.811 ( 0.011s) [main thread ] AlsavoCtrl.cpp:319 INFO| Received handshake, CSID=1C880000, DSID=73120090, server token 0FC047D7 2023-07-16 20:43:04.816 ( 0.017s) [main thread ] AlsavoCtrl.cpp:352 INFO| Connection complete. /home/alsavo/status/16={"type":"status", "index":16, "value":21.2}

On the new I copied the string from the old - to ensure that serial and password being correct, on the new Pi I am getting this :

root@raspberrypi:~# /home/pi/AlsavoCtrl/build/AlsavoCtrl -s SERIAL -l PASSWORD -a 192.168.101.135 -p 1194 date time ( uptime ) [ thread name/id ] file:line v| 2023-07-16 21:45:53.662 ( 0.002s) [main thread ] loguru.cpp:647 INFO| arguments: /home/pi/AlsavoCtrl/build/AlsavoCtrl -s SERIAL -l PASSWORD -a 192.168.101.135 -p 1194 2023-07-16 21:45:53.663 ( 0.002s) [main thread ] loguru.cpp:650 INFO| Current dir: /root 2023-07-16 21:45:53.663 ( 0.002s) [main thread ] loguru.cpp:652 INFO| stderr verbosity: 0 2023-07-16 21:45:53.663 ( 0.002s) [main thread ] loguru.cpp:653 INFO| ----------------------------------- 2023-07-16 21:45:53.663 ( 0.002s) [main thread ] AlsavoCtrl.cpp:359 INFO| Disconnecting. 2023-07-16 21:45:53.663 ( 0.002s) [main thread ] AlsavoCtrl.cpp:292 INFO| Connecting to 192.168.101.135:1194... 2023-07-16 21:45:53.663 ( 0.002s) [main thread ] AlsavoCtrl.cpp:301 ERR| Server not responding, disconnecting 2023-07-16 21:45:53.663 ( 0.002s) [main thread ] AlsavoCtrl.cpp:359 INFO| Disconnecting. 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:359 INFO| Disconnecting. 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:292 INFO| Connecting to 192.168.101.135:1194... 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:301 ERR| Server not responding, disconnecting 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:359 INFO| Disconnecting. 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:359 INFO| Disconnecting. 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:292 INFO| Connecting to 192.168.101.135:1194... 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:301 ERR| Server not responding, disconnecting 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] AlsavoCtrl.cpp:359 INFO| Disconnecting. 2023-07-16 21:45:53.664 ( 0.003s) [main thread ] loguru.cpp:526 INFO| atexit

SuGiCZ commented 1 year ago

Hi, I have same problem with SIGBUS :-( RPI 4B RaspOS. Bullseye and Bookworm version.

cmake .. --debug-output
make -d

Nothing change for me. Any tips? What about g++ version?

root@raspberrypi:/opt/alsavo/AlsavoCtrl/build# ./AlsavoCtrl --serial=xxx --password=xxx --address=192.168.x.x -p 1194
date       time         ( uptime  ) [ thread name/id ]                   file:line     v|
2023-08-24 09:20:41.778 (   0.001s) [main thread     ]             loguru.cpp:647   INFO| arguments: ./AlsavoCtrl --serial=xxx --password=xxx --address=192.168.x.x -p 1194
2023-08-24 09:20:41.778 (   0.001s) [main thread     ]             loguru.cpp:650   INFO| Current dir: /opt/alsavo/AlsavoCtrl/build
2023-08-24 09:20:41.778 (   0.001s) [main thread     ]             loguru.cpp:652   INFO| stderr verbosity: 0
2023-08-24 09:20:41.778 (   0.001s) [main thread     ]             loguru.cpp:653   INFO| -----------------------------------

Loguru caught a signal: SIGBUS
Stack trace:
0   0xf761d280 __default_rt_sa_restorer + 0
2023-08-24 09:20:41.778 (   0.001s) [main thread     ]                       :0     FATL| Signal: SIGBUS
strandborg commented 1 year ago

One possibility is that the heat pump is very slightly different model than what I have, and the protocol is somehow different. Maybe you could try the cloud IP instead of local IP, if that makes any difference?

SuGiCZ commented 1 year ago

I tried the cloud too but without success I found the the strange thing on line 564: int16_t m_NextSeq = 0; When I change to int32_t m_NextSeq = 0; SIGBUS dissapeared and the app is working without system error, but can't connect.

SuGiCZ commented 1 year ago

Ha! Its working, I had one more bug in code. So change line 564 is enough to avoid the SIGBUS :-)

DKLeader commented 1 year ago

This solved the problem I had :)

Could it be something related to using Bullseye? Just thinking since it was working on a Pi 3 using Buster :)