A
A
Alexey2014-03-06 17:06:35
linux
Alexey, 2014-03-06 17:06:35

Why does Raspberry PI write to files incorrectly?

Actually, I have a raspberry with Raspbian, which drags some equipment and receives data from it. The data is written to text files. Data collection is carried out by a self-written C/C++ program. In addition, the program pulls data from an external network database and also writes them to files. The files are pulled by a program written in Fortran. Further, these data are picked up by scripts, draw beautiful graphics, etc.
And in both programs, at random times, the same bug is observed - instead of the expected line, a pack of zero bytes as long as the expected line (+/- one character) falls into the file, and then the expected string is already being written. Accordingly, the scripts find zeros in the string and the graphs suddenly become ugly.
Accordingly, the question is: what is going on here? The error is not in the programs, because they are written in different languages ​​and have nothing in common. The error is not in the original data, since they are taken from fundamentally different sources. Operating system? But where and how does it affect writing to files?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GavriKos, 2014-03-06
@GavriKos

Your confidence in the infallibility of self-written software is incomprehensible. It is unlikely that iron can lead to such a bug, as well as OS. I would look for an error in the software, in the transmission protocol.

Z
zxmd, 2014-03-06
@zxmd

And if a similar stack is placed on which thread x86 computer, there will be no problem?
What file system, what kernel, what encoding?

E
Espresso, 2014-03-07
@Espresso

The usual series of measures, if iron is suspected (sorted in the order of attempts):
update the firmware of the board
close the polyfuses
install a more reliable power supply
replace the memory card
shield the constructive

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question