You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running the test shm_test in this PR we kept running into the error OSError: [Errno 63] File name too long. After hard coding the filename to not include a UUID and be much shorter, the test succeeded. This left us puzzled as we weren't passing a gigantic string for a filename. However, after looking into the OSX Posix shm header files, we found that there's an arbitrary length of 31 characters for file names in the shared memory buffer here:
in posix_smh.h
#define _SYS_POSIX_SHM_H_
#include <sys/appleapiopts.h>
#include <sys/types.h>
#include <sys/proc.h>
struct label;
#define PSHMNAMLEN 31 /* maximum name segment length we bother with */
struct pshminfo {
unsigned int pshm_flags;
unsigned int pshm_usecount;
off_t pshm_length;
mode_t pshm_mode;
uid_t pshm_uid;
gid_t pshm_gid;
char pshm_name[PSHMNAMLEN + 1];
void *pshm_memobject;
struct label *pshm_label;
};
#endif
goodboy
changed the title
shared memory file name length limitation causing error
OS X: shared memory file name length limitation causing error
Oct 21, 2022
When running the test
shm_test
in this PR we kept running into the errorOSError: [Errno 63] File name too long
. After hard coding the filename to not include a UUID and be much shorter, the test succeeded. This left us puzzled as we weren't passing a gigantic string for a filename. However, after looking into the OSX Posix shm header files, we found that there's an arbitrary length of 31 characters for file names in the shared memory buffer here:in
posix_smh.h
Linked issues:
pikers/piker#306
Linked PRs
#338
Stackoverflow threads
https://stackoverflow.com/questions/38049068/osx-shm-open-returns-enametoolong
To Do:
The text was updated successfully, but these errors were encountered: