1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 <2020> 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | String size limit for Eiger FileWriter when compiling with g++ > 5.2 |
From: | "Wlodek, Jakub via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Wed, 4 Mar 2020 17:12:26 +0000 |
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:
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
|