eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.69k stars 393 forks source link

POSH__SHM_APP_SEGMENT_MAPP_ERR on restarts #2035

Open niclar opened 1 year ago

niclar commented 1 year ago

Hi, we're updating to HEAD 4fb0b5f95b620a45d68daddf01942cb445214ed4 (v2.0.x, 20230925) from 15da211f4102edd155cc8412d7ef1a6d12c29d43 (v2.0.x, 20230414). We're now encountering POSH__SHM_APP_SEGMENT_MAPP_ERR after terminating binaries and then starting them. -Is there a way to allow memory mapped file reclamation / overwrite besides removing the lockfile ourselves in the application(s) ?

< Win32API Error > C:\src\thirdparty\vcpkg\buildtrees\iceoryx\src\b445214ed4-b3f388cafc.clean\iceoryx_platform\win\source\fnctl.cpp:40 { CreateFileA } [ 183 ] ::: Cannot create a file when that file already exists. < Win32API Error > C:\src\thirdparty\vcpkg\buildtrees\iceoryx\src\b445214ed4-b3f388cafc.clean\iceoryx_platform\win\source\mman.cpp:113 { CreateFileMapping } [ 183 ] ::: Cannot create a file when that file already exists. < Win32API Error > C:\src\thirdparty\vcpkg\buildtrees\iceoryx\src\b445214ed4-b3f388cafc.clean\iceoryx_platform\win\source\stat.cpp:38 { GetFileSize } [ 6 ] ::: The handle is invalid. < Win32API Error > C:\src\thirdparty\vcpkg\buildtrees\iceoryx\src\b445214ed4-b3f388cafc.clean\iceoryx_platform\win\source\stat.cpp:38 { GetFileSize } [ 6 ] ::: The handle is invalid. < Win32API Error > C:\src\thirdparty\vcpkg\buildtrees\iceoryx\src\b445214ed4-b3f388cafc.clean\iceoryx_platform\win\source\stat.cpp:38 { GetFileSize } [ 6 ] ::: The handle is invalid. 2023-09-25 12:08:36.697 [Error]: Unable to create a shared memory object with the following properties [ name = iceoryx_windows_, sizeInBytes = 4294967295, access mode = AccessMode::READ_WRITE, open mode = OpenMode::OPEN_EXISTING, baseAddressHint = (no hint set), permissions = 0o660 ] 2023-09-25 12:08:36.697 [Error]: Unable to create SharedMemoryObject since a size of 4294967295 was requested but the object has only a size of 17163584 2023-09-25 12:08:36.697 [Error]: ICEORYX error! POSH__SHM_APP_SEGMENT_MAPP_ERR Assertion failed: false, file C:\src\thirdparty\vcpkg\buildtrees\iceoryx\src\b445214ed4-b3f388cafc.clean\iceoryx_hoofs\source\error_handling\error_handler.cpp, line 40

niclar commented 1 year ago

cmdLineArgs.monitoringMode = iox::roudi::MonitoringMode::ON; seem to remedy the above

elBoberido commented 1 year ago

@niclar this might be a Windows specific issue. On Linux (I guess more general on Unix like systems) the app can be restarted after a termination/crash and cleans up the leftovers. It seems this is not the case on Windows anymore.

Are you able to bisect the problem, e.g. trying out some of the merge commits in between the two merge commits you mentioned?

Edit: You could also try to add this to your application to get more information on what is actually going on.

#include "iox/logging.hpp"
// ...

int main() {
    iox::log::Logger::init(iox::log::LogLevel::TRACE);
// ...
}
elBoberido commented 9 months ago

@niclar is this problem solved for you? If yes, the issue could be closed. If not, we need more information to tackle the problem.

elBoberido commented 8 months ago

@niclar any updates on this?

niclar commented 8 months ago

-let me get back in a few days with trace logging set (for this commit), a bit busy atm...