GithubHelp home page GithubHelp logo

Comments (14)

TysonAndre avatar TysonAndre commented on June 14, 2024

Hi - Not a maintainer, but at a glance, it looks like you need to start memcached on port 11212 as well to run the tests that failed. You probably already have one running on port 11211. See https://github.com/websupport-sk/pecl-memcache/blob/NON_BLOCKING_IO_php7/tests/connect.inc#L17-L18

The test failures are probably unrelated to the segmentation fault you're seeing in your configuration. Are you able to provide stack traces or core dumps for the segmentation fault?

You can run make test TESTS=--show-diff to show the test output.

from pecl-memcache.

nicolacontu avatar nicolacontu commented on June 14, 2024

from pecl-memcache.

TysonAndre avatar TysonAndre commented on June 14, 2024
---------------------------------------------------------------------
memcache::connect() with unix domain socket [tests/035.phpt]
ini_set('session.save_handler') with unix domain socket [tests/053.phpt]

$domainsocket = 'unix:///var/run/memcached/memcached.sock';

The tests are unrelated to the segfault. You need to mkdir -p /var/run/memcached and memcached -s /var/run/memcached/memcached.sock to run those tests.

t might be useful if the test scripts skip if those memcached servers don't exist, but that's up to the maintainers to decide

@nicolacontu

  1. How was PHP being run when it segfaulted? If it was a web server, what type of webserver (apache? php-fpm? other?)
  2. What memcached server/proxy software (and version) were you connecting to?
  3. Can you provide a core dump (e.g. https://bugs.php.net/bugs-generating-backtrace.php - instructions may vary based on server software and os versions)
  4. How is "memcache" being used? Is this pecl module used for sessions through the session handler?

from pecl-memcache.

nicolacontu avatar nicolacontu commented on June 14, 2024

from pecl-memcache.

TysonAndre avatar TysonAndre commented on June 14, 2024
  1. It would help if you attach the output of (gdb) bt to print the backtrace of that. To get a useful backtrace, installing debugging info would help get line numbers and file names, but that doesn't seem to include php, so it probably wouldn't help much.

    Missing separate debuginfos, use: debuginfo-install aspell-0.60.6.1-9.el7.x86_64 audit-libs-2.8.5-4.el7.x86_64 bzip2-libs-1.0.6-13.el7.x86_64 cairo-1.15.12-4.el7.x86_64 cyrus-sasl-lib-2.1.26-23.el7.x86_64 elfutils-libelf-0.176-4.el7.x86_64 elfutils-libs-0.176-4.el7.x86_64 expat-2.1.0-11.el7.x86_64 fontconfig-2.13.0-4.3.el7.x86_64 freetype-2.8-14.el7.x86_64 fribidi-1.0.2-1.el7_7.1.x86_64 gdbm-1.10-8.el7.x86_64 glib2-2.56.1-5.el7.x86_64 glibc-2.17-307.el7.1.x86_64 gmp-6.0.0-15.el7.x86_64 graphite2-1.3.10-1.el7_3.x86_64 harfbuzz-1.7.5-2.el7.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 krb5-libs-1.15.1-46.el7.x86_64 libX11-1.6.7-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.3-3.el7.x86_64 libXrender-0.9.10-1.el7.x86_64 libaio-0.3.109-13.el7.x86_64 libattr-2.4.46-13.el7.x86_64 libc-client-2007f-16.el7.x86_64 libcap-2.22-11.el7.x86_64 libcap-ng-0.7.5-4.el7.x86_64 libcom_err-1.42.9-17.el7.x86_64 libcurl-7.65.3-4.0.cf.rhel7.x86_64 libffi-3.0.13-19.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libgcrypt-1.5.3-14.el7.x86_64 libglvnd-1.0.1-0.8.git5baa1e5.el7.x86_64 libglvnd-egl-1.0.1-0.8.git5baa1e5.el7.x86_64 libglvnd-glx-1.0.1-0.8.git5baa1e5.el7.x86_64 libgpg-error-1.12-3.el7.x86_64 libicu-50.2-4.el7_7.x86_64 libjpeg-turbo-1.2.90-8.el7.x86_64 libnghttp2-1.31.1-2.el7.x86_64 libpng-1.5.13-7.el7_2.x86_64 libpsl-0.7.0-1.el7.x86_64 libselinux-2.5-15.el7.x86_64 libssh2-1.9.0-2.0.cf.rhel7.x86_64 libstdc++-4.8.5-39.el7.x86_64 libthai-0.1.14-9.el7.x86_64 libtool-ltdl-2.4.2-22.el7_3.x86_64 libuuid-2.23.2-63.el7.x86_64 libwbclient-4.10.4-11.el7_8.x86_64 libxcb-1.13-1.el7.x86_64 libxml2-2.9.1-6.el7.4.x86_64 libxslt-1.1.28-5.el7.x86_64 nspr-4.21.0-1.el7.x86_64 nss-3.44.0-7.el7_7.x86_64 nss-softokn-freebl-3.44.0-8.el7_7.x86_64 nss-util-3.44.0-4.el7_7.x86_64 openldap-2.4.44-21.el7_6.x86_64 openssl-libs-1.0.2k-19.el7.x86_64 pam-1.1.8-23.el7.x86_64 pango-1.42.4-4.el7_7.x86_64 pcre-8.32-17.el7.x86_64 pixman-0.34.0-1.el7.x86_64 rrdtool-1.4.8-9.el7.x86_64 samba-client-libs-4.10.4-11.el7_8.x86_64 samba-winbind-modules-4.10.4-11.el7_8.x86_64 systemd-libs-219-73.el7_8.5.x86_64 unixODBC-2.3.1-14.el7.x86_64 xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-18.el7.x86_64

  2. What mpm module are you using? At a glance at the gdb output, I'm guessing you're using a threaded one (I'm not very familiar with apache's internals). Which mpm module are you using? Does the issue go away if you switch to prefork? (Knowing if an issue is limited to threaded apache will help maintainers diagnose/fix this)

For example, my centos config in /etc/httpd/conf.modules.d/00-mpm.conf is using mpm_prefork_module. It'll probably be in a folder starting with /etc/httpd or /etc/apache, which varies based on OS (grep -Ri for mpm)

# Select the MPM module which should be used by uncommenting exactly
# one of the following LoadModule lines:

# prefork MPM: Implements a non-threaded, pre-forking web server
# See: http://httpd.apache.org/docs/2.4/mod/prefork.html
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

# worker MPM: Multi-Processing Module implementing a hybrid
# multi-threaded multi-process web server
# See: http://httpd.apache.org/docs/2.4/mod/worker.html
#
#LoadModule mpm_worker_module modules/mod_mpm_worker.so

# event MPM: A variant of the worker MPM with the goal of consuming
# threads only for connections with active processing
# See: http://httpd.apache.org/docs/2.4/mod/event.html
#
#LoadModule mpm_event_module modules/mod_mpm_event.so

from pecl-memcache.

TysonAndre avatar TysonAndre commented on June 14, 2024

I'd have thought it might be due to servers getting shared somehow, but I'm unfamiliar with the codebase. The memcache server string (tcp://) doesn't have persistent (which is correct if threads are used), and it looks like memcache shouldn't be sharing servers/pool structs at a glance.

from pecl-memcache.

nicolacontu avatar nicolacontu commented on June 14, 2024

from pecl-memcache.

nicolacontu avatar nicolacontu commented on June 14, 2024

from pecl-memcache.

TysonAndre avatar TysonAndre commented on June 14, 2024

What's the full output of php --version (including NTS/ZTS)? If it's an NTS build, I don't think this module would work with mpm "Threaded: yes" - you'd need to switch to zts (a php build that supports running with threads) or to mpm prefork (to stop using threads).

The MEMCACHE_G(session_key_prefix) would be using a thread-local in ZTS but what seems like a static variable in NTS

#ifdef ZTS
#define MEMCACHE_G(v) TSRMG(memcache_globals_id, zend_memcache_globals *, v)
#else
#define MEMCACHE_G(v) (memcache_globals.v)
#endif

from pecl-memcache.

TysonAndre avatar TysonAndre commented on June 14, 2024
  1. apache is compiled and it is uses the default one. it should be prefork.
    ...
    I was able to take a look at the MPM module :

MPM Name: event

If you refer to https://httpd.apache.org/docs/2.4/mod/#core , the "event" mpm is a variation of the "worker" mpm, both of which are threaded. That is a different mpm from the non-threaded "prefork" mpm. (Not 100% sure if that is what you meant by that)

from pecl-memcache.

nicolacontu avatar nicolacontu commented on June 14, 2024

from pecl-memcache.

TysonAndre avatar TysonAndre commented on June 14, 2024

Okay, not completely sure what's causing the segfault, then

  • Could be the string that MEMCACHE_G(session_key_prefix) was initially valid, but no longer became valid
  • Maybe the order in which extensions are loaded matters? Does it help to put extension=memcache.so before extension=session.so (or if they're in php.d/, change the file order?) (did php_request_startup initialize session before memcache got initialized - if so, that would explain why session_key_prefix pointed to invalid memory)

from pecl-memcache.

nicolacontu avatar nicolacontu commented on June 14, 2024

from pecl-memcache.

thesource93 avatar thesource93 commented on June 14, 2024

this should be fixed in recent version, closing

from pecl-memcache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.