Hello all,
I have an interesting issue that I wanted to get some feedback on. One of our beamlines is running several Eiger detectors that were recently moved to a Debian 9 system,
and as soon as they were moved, we recieved feedback that the FileWriter was not saving the h5 files to the local storage.
After some testing, this was confirmed, however, only when the FilePattern PV was longer than 15 characters. The h5 file would be saved to the Eiger server and was visible
through the web interface, but was not copied to the local storage. Seeing as 15 characters was the limit, and the call sizeof(std::string) would return 15 with g++ > 5.2, we figured
out that somewhere there was an issue stemming from this, especially since on Debian 7 (g++ version 4.7.2) we did not see the problem.
I found that the following structure is sent on a message queue:
epicsMessageQueue mPollQueue:
bool saveFiles, parseFiles, removeFiles; |
}acquisition_t;
And calling pattern.c_str() before it was sent on the queue would print the full value, but on the recieve pattern.c_str() would be empty whenever the string
was longer than 15 characters. The queue was initialized with:
mPollQueue(1,
sizeof(acquisition_t)),
My first idea was to simply increase the size of this second parameter for the epicsMessageQueue, but that did not solve the problem.
What did was changing the string pattern to char pattern[MAX_BUF_SIZE], and ensure that any time this pattern variable was called a conversion from string
to char[] was done.
My question is, is there a better way to fix this where the driver can continue to use std::string? And why did increasing the max transport size for the queue not
also fix the issue?
Regards,
Jakub
|