ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube Loader

32bit ionCube Linux loaders depend on pthreads

Author Message
justamoose



Joined: 23 Aug 2012
Posts: 3

PostPosted: Fri Jun 26, 2015 12:28 am    Post subject: 32bit ionCube Linux loaders depend on pthreads Reply with quote

We build PHP from scratch on all of our (and our clients') machines, enabling only the extensions that are absolutely necessary. As a result our PHP binaries are not linked against libpthread.so.

This has never been a problem for the ionCube loaders until this week when we upgraded to ionCube Encoder v9, ionCube Loader v5.0.10, and PHP 5.6.9. On 64bit PHP builds the ionCube loader still works fine, but on 32bit builds, PHP fails to load the ionCube loader with:

Failed loading /path/to/ioncube/ioncube_loader_lin_5.6.so: /path/to/ioncube/ioncube_loader_lin_5.6.so: undefined symbol: pthread_mutexattr_init

Our PHP build config is pretty straightforward:

CFLAGS="-O3" ./configure \
--disable-all \
--enable-static \
--enable-fpm \
--enable-cli \
--prefix=/usr/local/myapp \
--with-mysql=mysqlnd \
--enable-zip \
--enable-json \
--enable-mbstring \
--enable-sockets \
--enable-hash \
--with-pcre-regex \
--with-zlib --with-zlib-dir=/usr/local \
--with-sqlite3 \
--enable-bcmath \
--enable-posix \
--with-openssl=/usr/local \
--enable-pdo --with-pdo-mysql=mysqlnd --with-pdo-sqlite \
--enable-session
make && make install

Is this some kind of necessary evil with 32bit builds, or could this be changed back to match the original loader behavior (and current 64bit behavior)?

Invoking php with LD_PRELOAD=libpthread.so.0 is working as a stopgap workaround at this point, but it's hardly a clean solution.

Any insight would be appreciated.
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Fri Jun 26, 2015 1:16 am    Post subject: Reply with quote

Loaders from 4.7.6 require mutex support from the pthreads library. A number of other standard PHP modules also require pthreads, and so both ZTS and non-ZTS builds typically include it. LD_PRELOAD or building PHP with the extra link flags var set accordingly would resolve, but an enhancement to the Loader may be able to resolve this too.
_________________
Community Admin
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Fri Jun 26, 2015 4:53 pm    Post subject: Reply with quote

A quick update to let you know that version 5.0.11 will be released in the next 48 hours that dynamically loads the pthreads library iff ionCube24 is enabled and pthreads is not already available.

In practice, PHP builds will generally have a dependency on pthreads, and on a test system we used a build with your configuration above did. Dropping sqlite3 and a few other modules still resulted in pthreads being available, which is because configure added librt.so, and librt requires pthreads. It was necessary to drop librt to get a build without pthreads. The distro used for the build may be a factor as to whether pthreads is a necessary indirect dependency, and quite a few PHP modules need it directly.
_________________
Community Admin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube Loader All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum