简体   繁体   English

使用从Solaris 64位或Linux 32位到Linux 64位的内存映射文件

[英]Use memory mapped files from Solaris 64 Bit or Linux 32 Bit to Linux 64 Bit

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. 生产在64位的solaris上运行,开发机是32位的linux。 In the future we would like to use a 64 bit linux for all environments. 将来,我们希望在所有环境中使用64位linux。 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. 不幸的是,如果我使用32位linux中的文件,则会收到“总线错误”。 If I have used the files of the 64 bit solaris, the process crashed. 如果我使用了64位solaris的文件,则该过程将崩溃。

As far as I understand, the bus error occurs because of an adressing error in the 32 bit files (adress beyond the file end). 据我了解,总线错误的发生是由于32位文件中的地址错误(地址超出文件末尾)。 In addition it seems that solaris files are not compatible with a linux system. 另外,solaris文件似乎与linux系统不兼容。 Thus I have created new memory mapped files on the 64 bit linux and the application works but has obviously no data. 因此,我在64位linux上创建了新的内存映射文件,该应用程序可以运行,但显然没有数据。

Is there a way that I can read the old version of these files on my new 64 bit linux system? 有没有办法可以在新的64位linux系统上读取这些文件的旧版本? I would like to write my own conversion program to extract the data and to fill the new generated files. 我想编写自己的转换程序以提取数据并填充新生成的文件。

崩溃的原因是,您将文件加载到内存中,然后尝试使用不同的数据结构进行访问- 即使它们在源代码中看起来相同,它们在运行时也不相同 ,而不是针对不同体系结构进行编译时。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM