Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#93 closed defect (worksforme)

Segfault when using variable cache increment/decrement functions

Reported by: edgaribsen Owned by: moo
Priority: major Milestone:
Component: cacher Version: 1.2-dev
Keywords: segfault variable cache Cc:
Application: PHP Version: 5.2.0
Other Exts: SAPI: FastCGI
Probability: Blocked By:
Blocking:

Description (last modified by moo)

XCache 1.2.0 segfaults when using variable increment/decrement functions:

Part of gdb output:

<?php
xcache_inc("XXX"); //first invocation does not segfault...
xcache_inc("XXX"); //but the second one does
?>

Program received signal SIGSEGV, Segmentation fault.
0xb7ebee9b in zif_xcache_get_special_value () from /usr/lib/php5/xcache.so

same with xcache_dec():

<?php
xcache_dec( "abc" );
xcache_dec( "abc" );
?>

Program received signal SIGSEGV, Segmentation fault.
0xb7f51e9b in zif_xcache_get_special_value () from /usr/lib/php5/xcache.so

Also, all of the variable API functions segfault when the variable cache is not enabled... maybe it is a good idea to have a more graceful error handler? :)

By the way, I have the varcache size set at 1M with 1K chunks.

Change History (7)

comment:1 Changed 7 years ago by moo

  • Description modified (diff)

which 1.2-dev svn-revision are you using?

there is check in the svn HEAD:

    if (!xc_var_caches) {
        VAR_DISABLED_WARNING();
        RETURN_NULL();
    }

comment:2 Changed 7 years ago by edgaribsen

Actually, I'm using 1.2.0 stable...

I see that the check would fix the segfaults when the varcache isn't enabled, but is the segfaults with xcache_inc/xcache_dec also fixed in HEAD? They occur when the varcache is enabled; using xcache_set/xcache_get is fine but not inc/dec.

comment:3 Changed 7 years ago by judas_iscariote

the segfault is fixed in svn 1.2 not sure if fixed in trunk.

comment:4 Changed 7 years ago by edgaribsen

Is there any possible way to isolate the commit? I'm running XCache on a production system and do not want to risk the possible breakage associated with svn HEAD.

comment:5 Changed 7 years ago by moo

  • Resolution set to worksforme
  • Status changed from new to closed

it was fixed in trunk and b1.2 (1.2.1-dev)

1.2@HEAD is far stabler than trunk@HEAD, but it's your own risk trying it out. here we goes the patch [328] or [329]

comment:6 Changed 7 years ago by edgaribsen

Those patches fix segfaults when the varcache isn't enabled, but what about when it is? xcache_inc/dec segfaults when varcache *is* enabled... was this actually fixed, or is it that maybe I have a rare setup where the segfault occurs?

comment:7 Changed 7 years ago by moo

u gotta provide us a gdb backtrace and the whole XCache relatived ini settings

Note: See TracTickets for help on using tickets.