MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0013106 | CMake | CMake | public | 2012-04-06 05:03 | 2013-01-09 14:05 |
| Reporter | tfischer | ||||
| Assigned To | David Cole | ||||
| Priority | normal | Severity | minor | Reproducibility | random |
| Status | closed | Resolution | no change required | ||
| Platform | Gentoo Linux | OS | Linux | OS Version | |
| Product Version | CMake 2.8.6 | ||||
| Target Version | CMake 2.8.10 | Fixed in Version | CMake 2.8.10 | ||
| Summary | 0013106: SystemTools::CopyFileAlways fails at random due to invalid kwsys_ios::ifstream fin | ||||
| Description | I am using a custom cmake script to determine the SVN revision number of my source code during build time and to write this version number into a file "version.h" so that the compiler can include the version string into the compiled code. The script works as follows: First, it determines the SVN revision (svnversion or environment variable) and writes a small header file called version.h.tmp. To avoid unnecessary recompilations, cmake's copy_if_different is used to copy version.h.tmp to version.h only if the SVN revision (therefore the file's content) has changed. When testing the script, in irregular intervals the copy_if_different call fails with error message: Error copying file (if different) from "/home/tf/programming/gna/qtcreator-build/src/parts/version.h.tmp" to "/home/tf/programming/gna/qtcreator-build/src/parts/version.h". I added print statements before each "return false" statement in SystemTools::CopyFileAlways (eventually called by copy_if_different) to check which test fails. As it turns out, the test for !fin fails in line 1849 (for CMake 2.8.6). The problem now is, that this failure does not follow any pattern as far as I can see. Running my custom script (attached to this report) 20 times in a loop (bash for-loop), the following output is generated. -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA kwsys_ios::ifstream fin is NULL Error copying file (if different) from "/home/tf/programming/gna/qtcreator-build/src/parts/version.h.tmp" to "/home/tf/programming/gna/qtcreator-build/src/parts/version.h". -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA kwsys_ios::ifstream fin is NULL Error copying file (if different) from "/home/tf/programming/gna/qtcreator-build/src/parts/version.h.tmp" to "/home/tf/programming/gna/qtcreator-build/src/parts/version.h". -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA -- SVN version was set outside through environment variable SVN_REV -- SVN version is AAA kwsys_ios::ifstream fin is NULL Error copying file (if different) from "/home/tf/programming/gna/qtcreator-build/src/parts/version.h.tmp" to "/home/tf/programming/gna/qtcreator-build/src/parts/version.h". The for-loop to call this script is: for n in {1..20} ; do /usr/bin/cmake -DSOURCE_DIR=/home/tf/programming/gna/proj/src/parts -DBINARY_DIR=/home/tf/programming/gna/qtcreator-build/src/parts -P /home/tf/programming/gna/proj/src/getsvn.cmake ; done Any ideas what could cause this behaviour? How to debug/trace this problem? | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://public.kitware.com/Bug/file/4289/getsvn.cmake https://public.kitware.com/Bug/file/4432/race.cmake | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2012-04-06 05:03 | tfischer | New Issue | |||
| 2012-04-06 05:03 | tfischer | File Added: getsvn.cmake | |||
| 2012-08-11 21:35 | David Cole | Status | new => backlog | ||
| 2012-08-11 21:35 | David Cole | Note Added: 0030389 | |||
| 2012-08-22 16:11 | tfischer | Note Added: 0030738 | |||
| 2012-08-22 16:11 | tfischer | File Added: race.cmake | |||
| 2012-08-22 16:27 | David Cole | Assigned To | => David Cole | ||
| 2012-08-22 16:27 | David Cole | Status | backlog => assigned | ||
| 2012-08-22 16:32 | David Cole | Note Added: 0030741 | |||
| 2012-08-22 16:32 | David Cole | Status | assigned => resolved | ||
| 2012-08-22 16:32 | David Cole | Fixed in Version | => CMake 2.8.10 | ||
| 2012-08-22 16:32 | David Cole | Resolution | open => no change required | ||
| 2012-08-22 16:32 | David Cole | Target Version | => CMake 2.8.10 | ||
| 2013-01-09 14:05 | Robert Maynard | Note Added: 0032079 | |||
| 2013-01-09 14:05 | Robert Maynard | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||