Open neorevx opened 5 years ago
I am facing the same issue on a Pi3 B Plus running Raspberry Pi OS (32-bit) Lite release date 2020-08-20
The USB ports in question are either a BLE dongle or a modem - but neither should ordinarily become "unavailable" in my setup. The crash occurs sometime within 24 hours of a reboot. hs_err_pid815.log
Hello,
my application is finishing abruptly and I believe the problem is related to Pi4J.
I Respond in #281 but I thought maybe no one would see it, so I decided to open this new issue.
I use Pi4J 1.2 for GPIO control for years without problems. So I had to use a serial to read data from a usb modem. All tests went smoothly. But now I've seen that my system is experiencing an problem:
I run my app over 300 raspberry pi 3 / 3+ (literally). And I began to realize that several are presenting the problem. Both version of raspberry shows the problem. Searching the internet I found the issue #281. Reading the log report, I found records references linked directly to the native Pi4J library:
serial_callback_method+0 in /tmp/libpi4j659262621625719903.so at 0x65610000
See below:
...
I believe the problem is related to the following fact:
The Serial port becomes unavailable while reading the data, and the Serial callback attempts to read a resource that does not exist.
Why?
I have two processes using Pi4J in Raspberry. 1) A process controls the connection using a USB modem. When the modem has some serious problems (hangs) I send a RESET or IOCTL command to restart the usb. 2) The second process (which is having problems) just reads some information from the modem. This process does not control USB, it does not reset the modem. However, it also does not know when the other process resets the modem.
Only the second process (2) crashs. The first process knows when the modem will no longer exist (due to the reset) and does not have an open connection at that time. Therefore, this process apparently has no problems.
The error may also be related to WiringPi. But I do not know. I use 'gpio version: 2.44' and 'gpio version: 2.46'. I like Pi4J, I think it's a great project, and I would not want to have to use another library for serial access.