You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just received a TEMPerV1.2 device and started toying with it.
First thing I tried was to write a simple script to get the temperature using read-all, then update an rrd using a shell script. It worked nicely, so I started hacking my own C program to do both (get the info and update the rrd) from the same program (until adding more features).
As soon as I started accessing the device using my own code (which is basically a rip off read-all.c) my other script (which was running from crontab) stopped working (read-all reporting "No devices were found.").
Now my own code segfaults when trying to " tempered_close( device );"
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7bd8588 in tempered_close () from /usr/local/lib64/libtempered.so.0
I can read the temperature and update the rrd from my own program, it works, but it segfault when trying to close the device.
Do you have any idea of what can be wrong?
Could it be some kind of race condition between running my own program and running the script from the crontab at the same time?
Thanks in advance for your help, and thanks a lot for this very useful library.
The text was updated successfully, but these errors were encountered:
I'm pretty sure that only one program at a time can have the device open to talk with it, so it's not surprising that the cron script can't read the temperature while your own program is running - but if it still fails after your program has exited, there's something else going on. Even if the segfault means we don't close the device properly, the kernel should still close it for us when the program exits. I guess you could run into problems if your program uses the libusb version of HIDAPI while the cron script uses the hidraw version, as libusb disconnects the device from the kernel's HID driver.
The segfault is odd, as I haven't seen any myself - could your post some code that reproduces the problem?
Hi,
I just received a TEMPerV1.2 device and started toying with it.
First thing I tried was to write a simple script to get the temperature using read-all, then update an rrd using a shell script. It worked nicely, so I started hacking my own C program to do both (get the info and update the rrd) from the same program (until adding more features).
As soon as I started accessing the device using my own code (which is basically a rip off read-all.c) my other script (which was running from crontab) stopped working (read-all reporting "No devices were found.").
Now my own code segfaults when trying to " tempered_close( device );"
I can read the temperature and update the rrd from my own program, it works, but it segfault when trying to close the device.
Do you have any idea of what can be wrong?
Could it be some kind of race condition between running my own program and running the script from the crontab at the same time?
Thanks in advance for your help, and thanks a lot for this very useful library.
The text was updated successfully, but these errors were encountered: