Opened 13 years ago

Closed 13 years ago

#3138 closed Bugs (fixed)

Interprocess dependency on sys/shm.h

Reported by: Niklas Angare <li51ckf02@…> Owned by: Ion Gaztañaga
Milestone: Boost 1.40.0 Component: interprocess
Version: Boost 1.39.0 Severity: Regression
Keywords: QNX Cc:

Description

Since 1.39, boost/interprocess/mapped_region.hpp depends on sys/shm.h (from POSIX XSI). The QNX 6 operating system doesn't have this header and thus Interprocess no longer works.

boost/interprocess/shared_memory_object.hpp only conditionally includes sys/shm.h, like this:
#if defined(BOOST_INTERPROCESS_SYSTEM_V_SHARED_MEMORY_OBJECTS)
# include <sys/shm.h> System V shared memory...
#elif defined(BOOST_INTERPROCESS_POSIX_SHARED_MEMORY_OBJECTS)

mapped_region.hpp uses a bunch of stuff from sys/shm.h though so the fix won't be quite that easy.

Here are the rest of the errors from my NA-QNX641-qcc-gnu0x test runner:
mapped_region.hpp:402: error: '::shmid_ds' has not been declared
mapped_region.hpp:402: error: expected `;' before 'xsi_ds'
mapped_region.hpp:403: error: '::shmctl' has not been declared
mapped_region.hpp:403: error: 'IPC_STAT' was not declared in this scope
mapped_region.hpp:403: error: 'xsi_ds' was not declared in this scope
mapped_region.hpp:419: error: 'SHM_RDONLY' was not declared in this scope
mapped_region.hpp:426: error: '::shmat' has not been declared
mapped_region.hpp:552: error: '::shmdt' has not been declared

Full log: http://tinyurl.com/onnn2t

Attachments (1)

mapped_region.hpp.patch (509 bytes ) - added by Niklas Angare <li51ckf02@…> 13 years ago.
Ugly patch to ifdef out the include

Download all attachments as: .zip

Change History (4)

comment:1 by Ion Gaztañaga, 13 years ago

Resolution: fixed
Status: newclosed

Fixed for Boost 1.40

comment:2 by Niklas Angare <li51ckf02@…>, 13 years ago

Resolution: fixed
Status: closedreopened

Thanks! You forgot to ifdef out the actual include but if I do that almost all interprocess tests pass on QNX 6.4.1.

As a side note, there's a bug in the QNX kernel that I found when running the interprocess regression tests six months ago, that forces me to disable managed_mapped_file_test, managed_shared_memory_test and doc_managed_copy_on_write:
If you create a shared memory object, mmap() it with MAP_SHARED, create a synchronization object (e.g. a mutex) in it, and then mmap() with MAP_PRIVATE to the same offset in the shared object, then the application and some some programs such as pidin and shutdown may hang. (Ref# 63369)

by Niklas Angare <li51ckf02@…>, 13 years ago

Attachment: mapped_region.hpp.patch added

Ugly patch to ifdef out the include

comment:3 by Ion Gaztañaga, 13 years ago

Resolution: fixed
Status: reopenedclosed

Fixed for Boost 1.40

Note: See TracTickets for help on using tickets.