apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dirk Groeneveld <dgroe...@uci.edu>
Subject bug in apr_shm_create?
Date Sat, 11 Feb 2006 01:24:30 GMT
Hi!

I think I found a bug in shmem/unix/shm.c around line 317.

In line 302, the file is created with the flags APR_CREATE | APR_EXCL 
(among others), and in line 316 shmget is called with IPC_CREAT | 
IPC_EXCL, which fails because the first call already created the file. It 
seems to work without IPC_CREAT, but I am no expert on shmget and am not 
sure if this is the way to fix it.

The attached patch takes out both the IPC_CREAT and IPC_EXCL flags. I 
wasn't sure whether to keep IPC_CREAT. It might make a difference if 
someone else is messing with the file at the same time, so I decided to 
prefer failing due to a missing file over continuing with potentially 
undefined results.

Dirk
Mime
View raw message