GithubHelp home page GithubHelp logo

Comments (9)

krakjoe avatar krakjoe commented on July 16, 2024

Should be fixed in latest commit, can you confirm ?

from pthreads.

chobie avatar chobie commented on July 16, 2024

let me take a look. maybe I'll send a patch for this.

from pthreads.

chobie avatar chobie commented on July 16, 2024

sorry, I can't find how to fix this problem. probably this extension should be compile with php on linux machine.

here is my report.

Install pthreads extension as a shared lib.

cd ~/
git clone git://github.com/krakjoe/pthreads.git
cd pthreads
phpize
./configure
make
make install
# and add extension=pthreads.so to php.ini

run a thread

chobie@ubuntu:~/src/pthreads$ php -r 'class T extends Thread{function run(){}};$t = new T();$t->start();'
php: symbol lookup error: /home/chobie/.phpenv/versions/5.4.6-zts/lib/php/extensions/no-debug-zts-20100525/pthreads.so: undefined symbol: zend_activate

can't find zend_activate symbol.

okay, check zend_activate symbols

chobie@ubuntu:~/src/pthreads$ nm modules/pthreads.so | grep zend_activate
                 U zend_activate
                 U zend_activate_modules
chobie@ubuntu:~/src/pthreads$ readelf --dyn-syms /home/chobie/.phpenv/versions/5.4.6-zts/bin/php | grep zend_activate
  2206: 00000000007c9920    35 FUNC    GLOBAL DEFAULT   13 zend_activate_auto_global

there is no zend_activate symbol on php's dynamic symbols table. so pthreads extension can't lookup the function I think.

build environment

================================================================================
BUILD ENVIRONMENT
================================================================================
OS:
Linux - Linux ubuntu 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64

Autoconf:
autoconf (GNU Autoconf) 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.

Bundled Libtool:
ltmain.sh (GNU libtool) 1.5.26 (1.1220.2.492 2008/01/30 06:40:56)

Copyright (C) 2008  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

System Libtool:
libtool (GNU libtool) 2.4.2
Written by Gordon Matzigkeit <[email protected]>, 1996

Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiler:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.7-1ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.7 (Ubuntu/Linaro 4.4.7-1ubuntu2) 

Bison:
bison (GNU Bison) 2.5
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks

from pthreads.

krakjoe avatar krakjoe commented on July 16, 2024

I have a solution to this that presents an opportunity for some optimization, but haven't the time to implement it for a few days. It will be fixed in the next week or so ... hope you're getting on with it otherwise ...

from pthreads.

krakjoe avatar krakjoe commented on July 16, 2024

I'm afraid that after a closer look, this cannot be reasonable solved. Copying these functions into the pthreads source will be a maintenance nightmare ...
So I'm going to have to close this as a non-issue, pthreads will have to be statically compiled for now, it's not worth the instability, sorry.

from pthreads.

chobie avatar chobie commented on July 16, 2024

no problem, thank you!

from pthreads.

krakjoe avatar krakjoe commented on July 16, 2024

Just to give you an update, you can now build shared ... I still don't recommend it, but it's got to be an option for testing, and so it is ... in production you should compile statically, initialization of the threads environment is less than optimal when loading pthreads as a DSO.

from pthreads.

chobie avatar chobie commented on July 16, 2024

@krakjoe Thank you. this would be helpful that testing pthreads features.

Just to give you an update, you can now build shared ... I still don't recommend it, but it's got to be an option for testing, and so it is ... in production you should compile statically, initialization of the threads environment is less than optimal when loading pthreads as a DSO.

i think you should add this attention to README.md.

from pthreads.

jasondavis avatar jasondavis commented on July 16, 2024

Thanks Joe, glad you got this working. You're awesome!

from pthreads.

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.