Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible IPState stdin EOF #1

Closed
pauledd opened this issue Aug 13, 2017 · 14 comments
Closed

Impossible IPState stdin EOF #1

pauledd opened this issue Aug 13, 2017 · 14 comments

Comments

@pauledd
Copy link

pauledd commented Aug 13, 2017

Hi

I run indi_wiringpi_gpio on my RaspberyPi 2 (gentoo linux).
I installed git.drogon.net/wiringPi
compiling of indi_wiringpi_gpio without errors.

After starting indiserver I only get the error
2017-08-13T12:49:57: Driver indi_wiringpi_gpio: cat: /etc/lsb-release: Datei oder Verzeichnis nicht gefunden (not found)
I think this is not critical because gentoo linux does not provide lsb-release.

But then if I connect from kstars to the server I can see this in the server log:

...
2017-08-13T12:53:59: Driver indi_wiringpi_gpio: WiringPiGPIO::ISNewSwitch CONNECTION
2017-08-13T12:53:59: Driver indi_wiringpi_gpio: WiringPiGPIO::ISNewSwitch CONNECTION
Child process 3614 died
2017-08-13T12:53:59: Driver indi_wiringpi_gpio: Impossible IPState -1877497395
2017-08-13T12:53:59: Driver indi_wiringpi_gpio: stdin EOF
2017-08-13T12:53:59: Driver indi_wiringpi_gpio: restart #1
2017-08-13T12:53:59: Driver indi_wiringpi_gpio: pid=3653 rfd=5 wfd=13 efd=14
...

In ekos it shows connected but no values in the sensor tab, some values in the system tab and
only one pin in the configuration tab ( wiPi-pin:(0) ). If I try to set this pin to output I get this error in the server log:
2017-08-13T12:59:07: Driver indi_wiringpi_gpio: indi_wiringpi_gpio dispatch error: Property PIN_0_CONFIG is not defined in WiringPi GPIO.
Any idea what is wrong here?
greets
Paul

@pauledd
Copy link
Author

pauledd commented Aug 13, 2017

I was able to attach the process to gdb an I got a backtrace:

(gdb) attach 25324
Attaching to process 25324
Reading symbols from /usr/bin/indi_wiringpi_gpio...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libindidriver.so.1...done.
Reading symbols from /usr/lib/libindiAlignmentDriver.so.1...done.
Reading symbols from /usr/lib/libwiringPi.so...(no debugging symbols found)...done.
Reading symbols from /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/5.4.0/libstdc++.so.6...(no debugging symbols found)...done.
Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done.
Reading symbols from /usr/lib/gcc/armv7a-hardfloat-linux-gnueabi/5.4.0/libgcc_s.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Reading symbols from /lib/ld-linux-armhf.so.3...(no debugging symbols found)...done.
Reading symbols from /lib/libusb-1.0.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libnova-0.15.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Reading symbols from /usr/lib/libcfitsio.so.5...(no debugging symbols found)...done.
Reading symbols from /lib/libz.so.1...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libjpeg.so.62...(no debugging symbols found)...done.
Reading symbols from /lib/libdl.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libgsl.so.0...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libgslcblas.so.0...(no debugging symbols found)...done.
Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/libcrypt.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/libudev.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/libbz2.so.1...(no debugging symbols found)...done.
Reading symbols from /lib/libcap.so.2...(no debugging symbols found)...done.
Reading symbols from /lib/libattr.so.1...(no debugging symbols found)...done.
0x76b70ae0 in select () from /lib/libc.so.6
(gdb) continue
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x76b1d22e in strlen () from /lib/libc.so.6
(gdb) bt
#0  0x76b1d22e in strlen () from /lib/libc.so.6
#1  0x76ae9f24 in vfprintf () from /lib/libc.so.6
#2  0x76b85c80 in __printf_chk () from /lib/libc.so.6
#3  0x76e2d4dc in printf (__fmt=0x76ea1cd8 "    name='%s'\n")
    at /usr/include/bits/stdio2.h:104
#4  IDDefLight (lvp=lvp@entry=0x15f67d0, fmt=0x0)
    at /home/pi/build/indi/libindi/indidriver.c:1721
#5  0x76e3b7b4 in INDI::DefaultDevice::defineLight (this=<optimized out>, 
    lvp=0x15f67d0)
    at /home/pi/build/indi/libindi/libs/indibase/defaultdevice.cpp:937
#6  0x00018fa4 in WiringPiGPIO::updateProperties() ()
#7  0x76e3cbe0 in INDI::DefaultDevice::ISNewSwitch (this=0x15ed038, 
    dev=<optimized out>, name=<optimized out>, states=<optimized out>, 
    names=0x1609938, n=1)
    at /home/pi/build/indi/libindi/libs/indibase/defaultdevice.cpp:344
#8  0x0001a3c4 in WiringPiGPIO::ISNewSwitch(char const*, char const*, ISState*, char**, int) ()
#9  0x00017504 in ISNewSwitch ()
#10 0x76e2f5f4 in dispatch (root=root@entry=0x15f6480, 
    msg=msg@entry=0x7e8a09c4 "")
    at /home/pi/build/indi/libindi/indidriver.c:1104
#11 0x76e2fc30 in clientMsgCB (fd=<optimized out>, arg=<optimized out>)
    at /home/pi/build/indi/libindi/indidriver.c:878
---Type <return> to continue, or q <return> to quit---
#12 0x76e30848 in callCallback (rfdp=0x7e8a1204) at /home/pi/build/indi/libindi/eventloop.c:347
#13 oneLoop () at /home/pi/build/indi/libindi/eventloop.c:439
#14 0x76e308f0 in eventLoop () at /home/pi/build/indi/libindi/eventloop.c:106
#15 0x76e30418 in main (ac=0, av=<optimized out>) at /home/pi/build/indi/libindi/indidrivermain.c:98
#16 0x76abf4f8 in __libc_start_main () from /lib/libc.so.6
#17 0x0001736c in _start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@magnue
Copy link
Owner

magnue commented Aug 13, 2017

Hi.
I just updated INDI to the latest version, and compiled indi_wiringpi_gpio.
Just to make sure, are you exporting WIRINGPI_GPIOMEM in your terminal before starting indiserver?

export WIRINGPI_GPIOMEM=1

I know the driver will fail if this is not done, unless you run as root (witch is not a good idea).
By the debug you posted, I'm not sure this is the issue.

@pauledd
Copy link
Author

pauledd commented Aug 13, 2017

Well, I usually run indiserver as root because another driver (astroberry focuser) uses the bcm2835 lib and wants access to /dev/mem, so I need to run it as root. BUT I just tried to run it as normal user and with just the indi_wiringpi_gpio driver, also with WIRINGPI_GPIOMEM exported it fails the same way.
Do you use latest indi from git?

@magnue
Copy link
Owner

magnue commented Aug 13, 2017

So no I have recompiled the latest INDI from git and this driver.
I did get a error, that I was not on a RaspberryPi and not supported by WiringPi.

So I cloned a new copy of WiringPi and built it, and then it worked.
For some reason I did not have to export WIRINGPI_GPIOMEM, I think this is because I'm on the PI3 now.
But it does look like there have been some changes to WiringPi. When did you clone it, could you try repeating this.

$ cd ~/Projects
$ git clone git://git.drogon.net/wiringPi wiringPi2
$ cd wiringPi2
$ ./build

The cat: /etc/lsb-release error is why there is no OS info on System tab. It's only implemented for Ubuntu. If you are missing info on the sensors tab, then make sure you installed gawk.
sudo apt-get install gawk

@magnue
Copy link
Owner

magnue commented Aug 13, 2017

Also try to go to the wiringPi directory, and gpio subdir

cd ~/Projects/wiringPi2/gpio

and issue the commands gpio -v and gpio readall
Just to make sure wiringPi is working

@pauledd
Copy link
Author

pauledd commented Aug 13, 2017

Thats weird. I rebuilt everything, libindi wiringPi kstars on the client and on the server. I still get this error.
gpio -v and gpio readall works without issues. I can also manually use gpio via /sys/class/gpio...

But you did'nt really test on raspberry hardware?

@pauledd
Copy link
Author

pauledd commented Aug 13, 2017

Well, I have another wheater station Raspberry Pi with a bit older system files. Tomorrow I'll try to install indiserver & stuff there and see if it works. Then I could rule out that the error might be indi or wiring pi but something deeper in the system.

@magnue
Copy link
Owner

magnue commented Aug 13, 2017

It has been tested on Raspberry Pi 1 type B and Raspberry Pi 3. And also Odroid C1+
I just checked that I am on the newest INDI, and rebuilt, and it still works. So I'm not able to reproduce the bug.

In the output you posted it fail in INDI::DefaultDevice::ISNewSwitch that is called from the WiringPiGPIO::updateProperties(), you also have the Impossible IPState -1877497395 witch suggest you may have a corrupt config file.

Not sure if it will help, but you can try deleting
~/.indi/WiringPi GPIO_config.xml
and
~/.indi/WiringPi GPIO_config.xml.default

if you are running as root, then it might be /root/.indi/WiringPi GPIO_config.xml

@pauledd
Copy link
Author

pauledd commented Aug 13, 2017

I deletet all configs, no success. Is it possible that this "Impossible IPState" is just the symptom of an error before that? Because it happens right after "Child process 3614 died". So there must happen something. Maybe that has to do something with my gcc upgrade from 4.9.x to 5.4.0. Maybe I need to rebuild some unknown library. Well if everything fails I will try to ask knro. Maybe he has a sudden enlightenment on this issue.

@magnue
Copy link
Owner

magnue commented Aug 13, 2017

Let me know how it goes on the other RPi tomorrow.
If it fails there too, then it's the driver for sure.

Try first without running as root.
Sorry I couldn't be of any help :\

@pauledd
Copy link
Author

pauledd commented Aug 14, 2017

Right. I tried on my old Raspberry, with indilib 1.4.1, ggc-4.9.3, same error PLUS a few more...:

2017-08-14T05:57:35: Client 0: new arrival from 192.168.1.100:53656 - welcome!
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: WiringPiGPIO::ISNewSwitch CONNECTION
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: WiringPiGPIO::ISNewSwitch CONNECTION
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: Impossible IPState -1876735020
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: Impossible IPState 284393310
Child process 17684 died
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: Impossible IPerm -1863010726
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: Impossible ISRule 269145435
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: stderr EOF
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: restart #1
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: pid=17724 rfd=3 wfd=7 efd=8
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: cat: /etc/lsb-release: Datei oder Verzeichnis nicht gefunden
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: cat: /etc/lsb-release: Datei oder Verzeichnis nicht gefunden
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: WiringPiGPIO::ISNewSwitch CONFIG_PROCESS
2017-08-14T05:57:44: Driver indi_wiringpi_gpio: WiringPiGPIO::ISNewSwitch CONFIG_PROCESS

I'm running out of ideas. I think I can rule out that there was a change in your driver nor gcc or other libraries that can be blamed as source of this errors. So if my new Raspbery Pi with up to date libs and my old Raspbery with old libs etc. behaves even worse then the last suspicious point is the client, the machine that runs kstars, maybe it also affects (through newest indilib) how the indiserver on the RPi behaves. I will downgrade indilib in my kstars machine, maybe theres a difference. If that doesnt help I will open an thread on indilib.org.

@pauledd
Copy link
Author

pauledd commented Aug 14, 2017

I will continue discussion on indilib forum until I found a solution.
http://indilib.org/forum/embedded-indi/2477-help-on-indi-wiringpi-gpio-crash.html

@magnue
Copy link
Owner

magnue commented Apr 10, 2018

Hi Paule.

Added your bugfix. Let me know when / if it's time to close this issue :)

@magnue
Copy link
Owner

magnue commented Apr 10, 2018

Fixed in commit a1e5c18

@magnue magnue closed this as completed Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants