Reputation: 19
our application uses several memory mapped files to communicate between several processes. The production runs on a solaris with 64 bit and the development machine is a linux with 32 bit. In the future we would like to use a 64 bit linux for all environments. The compiling has already been finished and now I need the data which are stored in the memory mapped files. Unfortunately I get an "bus error", if I use the files from the 32 bit linux. If I have used the files of the 64 bit solaris, the process crashed.
As far as I understand, the bus error occurs because of an adressing error in the 32 bit files (adress beyond the file end). In addition it seems that solaris files are not compatible with a linux system. Thus I have created new memory mapped files on the 64 bit linux and the application works but has obviously no data.
Is there a way that I can read the old version of these files on my new 64 bit linux system? I would like to write my own conversion program to extract the data and to fill the new generated files.
Upvotes: 1
Views: 204
Reputation: 79537
The reason it crashes is that you load a file to memory, then try to access it using different data structures - even though they look the same in your source code, they are not the same at runtime, not when compiled for different architectures.
Upvotes: 1