[Alibava-general] Segmentation fault
Brought to you by:
lacasta
|
From: Daniel C. <da...@ce...> - 2010-07-09 11:43:45
|
Dear all, we've had some trouble running ALiBaVa DAQ software and consequently the provided ROOT macros on different PCs. You can verify that a part of the macros responsible for reading data files (the AsciiRoot class, specifically the open() method) does so on a read-sizeof-something-bytes basis. With the first thing to be read being a time stamp saved as time_t data type specified in the ISO C standard. However, this standard does not specify any particular size. Usually 32-bit systems use a 32-bit integer or floating type variables for time_t, while 64-bit systems use 64-bit variables. I believe (maybe someone here can confirm this or correct me) that the ALiBaVa software uses the same approach when creating the data files. Therefore, acquiring data on a 32-bit system and analyzing them on a 64-bit system results in a segmentation fault. For anyone having the same problem, a quick and dirty solution is to use: ifile->read((char *)&_t0, 4*sizeof(char)); instead of ifile->read((char *)&_t0, sizeof(time_t)); in the open() method of the AsciiRoot class. Kind regards, Daniel Cervenkov -- Charles University in Prague Faculty of Mathematics and Physics Institute of Particle and Nuclear Physics |