|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56196 apc_sma.c "Minor #if cleanup" seems wrong
Submitted: 2004-09-23 22:25 UTC Modified: 2004-09-24 00:10 UTC
From: xuefer at 21cn dot com Assigned: rasmus (profile)
Status: Closed Package: APC (PECL)
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
 [2004-09-23 22:25 UTC] xuefer at 21cn dot com
the #if
introduced in
but removed in

see also apc_main.c:
int apc_module_init()
    /* apc initialization */
    apc_sma_init(APCG(shm_segments), APCG(shm_size)*1024*1024, APCG(mmap_file_mask));
    apc_sma_init(APCG(shm_segments), APCG(shm_size)*1024*1024, NULL);

the NULL
make apc_sma.c apc_sma_init() always set sma_numseg=1
    if(!mmap_file_mask ||

i cannot set sma_numreg in php.ini


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-23 23:34 UTC]
That was the intent actually.  As the comment states, having multiple anonymous mmap segments doesn't make sense to me, so when no file_mask is given it means we are doing an anonymous mmap and thus we force sma_numseg to 1.  Why do you think this is wrong?
 [2004-09-24 00:00 UTC] xuefer at 21cn dot com
(sorry for my too simple explainatoin)

i'm not using MMAP, do i still have anonymous mmap?
or do i have shm instead of mmap?
i don't go against with any changes about mmap, but should shm be limited to 1 segments?

maybe i was wrong, but i failed with:
shm_size=60 (failed to create shm)
shm_seents=2 (apc limit it to 1)

in another word, i can't make cache for apc

apc_main.c is ok
for apc_sma.c:
the 1st cvs url looks good, but the 2nd removed it seems wrong.

in apc_main.c
    apc_sma_init(APCG(shm_segments), APCG(shm_size)*1024*1024, NULL);

when compiled without MMAP
do u see the NULL?
this will hit "if (!mmap_file_mask ||" in apc_sma.c
 [2004-09-24 00:10 UTC]
Ah, in the non-mmap case.  Yes, I guess you are right.  I haven't tested non-mmap in ages.  Just isn't a lot of reasons to use shm instead of mmap these days.

I have fixed this in CVS now.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 21 12:01:29 2024 UTC