LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
 
Search this Thread
Old 11-22-2013, 04:11 PM   #1
Jeronimo Barros
LQ Newbie
 
Registered: Oct 2010
Location: Brazil
Distribution: Slackware since 1996
Posts: 16

Rep: Reputation: 0
PHP-5.5.x with Zend OPCache enabled causing segfault error 14 in libc-2.17.so


Hi guys !!!

I need to optimize a PHP application using Zend OPCache in a Slackware64-14.1 server fresh installed.

I was compiling PHP-5.5.6 with a lot of default options that we use regularly, but when I noticed the error I tried with only "--disable-all --enable-opcache" options and the error persists when the "zend_extension=opcache.so" is enableb at php.ini.

Error with "php -i":

Code:
PHP Warning:  Zend OPcache: module registration failed! in Unknown on line 0
And the segfault:

Code:
Nov 22 19:02:12 slack-test kernel: [ 7731.937367] php[32051]: segfault at 7f73b6b53c40 ip 
00007f73b6b53c40 sp 00007fff06cdd6a8 error 14 in libc-2.17.so[7f73b6d6f000+1bf000]
I tried but I got no clues about what is the "error 14" of libc...

I'd like to know if someone has managed to compile a PHP-5.5.x with opcache enableb and working.

By the way, the same compile options in a Debian Wheezy works ok.

Thanks in advance for any help or hint to solve this problem.

Best regards,

Jero
 
Old 11-23-2013, 12:28 AM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,587

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
opcache build is enabled by default in php-5.5.6: to build it I just used the official slackware build script for slackware-14.1 that has recently been modified to support also php-5.5.x (if you want to use that you need that folder and the alpine one).

I just tried enabling it on my test machine (running a full installation of slackware64-14.1) with a testing joomla: these are the modifications I have done to my /etc/httpd/php.ini

- add a line
Code:
zend_extension=opcache.so
just before the block with the listing of extensions

- set this two parameters
Code:
opcache.enable=1
opcache.enable_cli=1
tested both with mod_php and php-fpm.
Attached Thumbnails
Click image for larger version

Name:	opcache.png
Views:	14
Size:	67.6 KB
ID:	14036  

Last edited by ponce; 11-23-2013 at 11:00 AM.
 
Old 11-23-2013, 03:21 PM   #3
Jeronimo Barros
LQ Newbie
 
Registered: Oct 2010
Location: Brazil
Distribution: Slackware since 1996
Posts: 16

Original Poster
Rep: Reputation: 0
Ponce, thanks for the reply.

I installed a new fresh server and still getting the same error. This time at least I figured out that the segmentation fault is ocurring during the configure stage yet using only "configure --disable-all". The config.log shows the segfault on the extended DES and Blowfish crypt test:

Code:
configure:86292: checking for extended DES crypt
configure:86322: cc -o conftest -g -O2 -fvisibility=hidden   conftest.c -lcrypt -lrt -lm -ldl -lnsl  -lcrypt >&5
conftest.c: In function 'main':
conftest.c:241:3: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default]
   exit (strcmp((char *)crypt("rasmuslerdorf","_J9..rasm"),"_J9..rasmBYk8r9AiWNc"));
   ^
configure:86322: $? = 0
configure:86322: ./conftest
./configure: line 2347: 19629 Segmentation fault      ./conftest$ac_exeext
configure:86322: $? = 139
configure: program exited with status 139
.
.
.
configure:86395: checking for Blowfish crypt
configure:86431: cc -o conftest -g -O2 -fvisibility=hidden   conftest.c -lcrypt -lrt -lm -ldl -lnsl  -lcrypt >&5
conftest.c: In function 'main':
conftest.c:244:5: warning: incompatible implicit declaration of built-in function 'strcat' [enabled by default]
     strcat(salt,"rasmuslerd............");
     ^
conftest.c:245:5: warning: incompatible implicit declaration of built-in function 'strcpy' [enabled by default]
     strcpy(answer,salt);
     ^
conftest.c:247:5: warning: incompatible implicit declaration of built-in function 'exit' [enabled by default]
     exit (strcmp((char *)crypt("rasmuslerdorf",salt),answer));
     ^
configure:86431: $? = 0
configure:86431: ./conftest
./configure: line 2347: 19652 Segmentation fault      ./conftest$ac_exeext
configure:86431: $? = 139
configure: program exited with status 139
I tested in an old 13.37 server (GCC 4.7.0) and the config.log shows only the warnings without the segfaults and so opcode works fine.

Could you please check if your config.log shows any segfault and the gcc version you have ?
 
Old 11-24-2013, 12:43 AM   #4
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,587

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
those happens also here during its tests (gcc 4.8.2, but I built version 5.5.4 on slackware 14.0 that got gcc-4.7.1, haven't checked on 13.37), but the configure phase finishes correctly and I can build it fine.

why aren't you using the official SlackBuild (FYI, I linked it above)? is this for any reason?

it makes more sense that you use that launching it like
Code:
NUMJOBS="-j1" ./php.SlackBuild
and then post the error it gives when it breaks.

remember that only full installations of Slackware are supported.

Last edited by ponce; 11-24-2013 at 01:15 AM.
 
Old 11-24-2013, 02:02 AM   #5
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,587

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
as I'm curious, I tried also building php-5.5.6 with the build script for 14.1 on 13.37: besides that I had to use the alpine build script fom 13.37 (because the one of 14.1 requires a newer openssl), it built and at a first glance seems to run fine (also with opcache enabled as I wrote above) with just these modifications to the SlackBuild
Code:
--- php.SlackBuild.orig	2013-10-12 03:37:27.000000000 +0200
+++ php.SlackBuild	2013-11-24 08:57:12.503175163 +0100
@@ -25,7 +25,7 @@
 
 
 VERSION=${VERSION:-$(echo php-*.tar.xz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-ALPINE=2.11
+ALPINE=2.00
 BUILD=${BUILD:-1}
 
 # Automatically determine the architecture we're building on:
@@ -150,7 +150,7 @@
   --datadir=/usr/share \
   --infodir=/usr/info \
   --mandir=/usr/man \
-  --with-apxs2=/usr/bin/apxs \
+  --with-apxs2=/usr/sbin/apxs \
   --enable-fpm \
   --with-fpm-user=apache \
   --with-fpm-group=apache \
@@ -222,7 +222,6 @@
   --with-xsl=shared,/usr \
   --enable-zip=shared \
   --with-tsrm-pthreads \
-  --enable-intl=shared \
   --enable-shared=yes \
   --enable-static=no \
   --with-gnu-ld \
no need to say that we're going deeper on completely unsupported paths (but I'll stop now).

Last edited by ponce; 11-24-2013 at 02:07 AM.
 
Old 11-24-2013, 04:29 AM   #6
Jeronimo Barros
LQ Newbie
 
Registered: Oct 2010
Location: Brazil
Distribution: Slackware since 1996
Posts: 16

Original Poster
Rep: Reputation: 0
Ponce,

Sorry, I forgot to say I did a full 14.1 64 bits installation without any customization. After the boot I tried, first, the "configure --disable-all" to see if it causes any segfault (it did), then I tried the official build script with your patch and during the configure stage the segfault occurred again (what indicates that the opcode won't work).

The build script's patches don't modify any font. Anyway, a simple "configure --disable-all" shouldn't be causing segfault...

As I said,s in an old 13.37 the PHP 5.5.6 configures, compiles and works fine with opcode.

I'll try now with the 14.0.

Regards,

Jero
 
Old 11-24-2013, 07:34 AM   #7
Jeronimo Barros
LQ Newbie
 
Registered: Oct 2010
Location: Brazil
Distribution: Slackware since 1996
Posts: 16

Original Poster
Rep: Reputation: 0
Ponce, with Slackware64 14.0 (GCC 4.7.1) I got no problems compiling and running PHP-5.5.6 with opcache enabled:

Code:
phpinfo()
PHP Version => 5.5.6

System => Linux lhasa 3.2.45 #2 SMP Fri May 31 20:14:55 CDT 2013 x86_64
Build Date => Nov 24 2013 09:37:34
Configure Command =>  './configure'  '--disable-all' '--enable-opcache'

Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
    with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies

Zend OPcache

Opcode Caching => Up and Running
Optimization => Enabled
Startup => OK
I'll ask now at PHP list if there is any problem with newer GCC versions.

But I still can't understand how you managed to compile PHP-5.5 on the 14.1... maybe I'm missing something...
 
Old 11-24-2013, 08:24 AM   #8
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,587

Rep: Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996Reputation: 996
as I told you above, I just used the SlackBuild, without any modification.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] libc segfault after upgrade to -current. upowerd issue? Martinus2u Slackware 4 07-28-2012 04:10 PM
[SOLVED] C sprintf() causing segfault and not sure why raevin Programming 8 07-07-2011 11:10 PM
C - Malloc causing segfault golmschenk Programming 3 03-21-2010 03:21 PM
Segfault in libc thenob Slackware 1 02-19-2009 11:24 AM
strcpy causing segfault jpbarto Programming 17 04-07-2004 09:40 PM


All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration