After 1.3 upgrade: exit signal Segmentation fault


(kkretsch) #1

[size=x-large]Piwik segmentation fault FAQ with solution list now published. Check it out: Troubleshooting - Analytics Platform - Matomo

I used 1.2.1 without any message like this in error.log
Now I updated to 1.3 and I get many of these errors. I tried to disable xcache, same problem. Connector is already MYSQLI
System uses a standard debian install.
PHP 5.2.6-1+lenny10 with Suhosin-Patch 0.9.6.2

Even the archive.sh now gets an error:
ALERT - canary mismatch on efree() - heap overflow detected (attacker ‘REMOTE_ADDR not set’, file ‘unknown’)


(Matthieu Aubry) #2

Can you try using PDO? this can be changed in config file


(kkretsch) #3

Good idea!
I switched to the PDO connector and now the segfaults vanished and it counts the hits again. Before that I just saw no /piwik.php requests in my access.log anymore! PPM -> PersonalPanicMode :wink:


#4

I had PDO_MYSQL in my config file and received a lot of Segmentation fault (Signal 11). I switched to MYSQLI but this didn’t help. The only plugin taht is working is the live plugin. All others result in segmentation faults of the apache thread.
How can I go back to version 1.2.1?


(vipsoft) #5

Pluckerwank: what version of PHP are you using? In all likelihood, upgrading to a newer version of PHP will resolve the segmentation fault, but also address security issues in older PHP versions.

If you really want to downgrade, you can download 1.2.1 from http://builds.piwik.org. You’ll have to recover your database from a backup, or manually rollback the schema changes.


#6

I’m back on version 1.2. I just download the archive from the piwik website and put it on my server. Now I can wait until the problem is solved.


(vipsoft) #7

We can’t fix the segfaul because it’s a bug in the PHP binary. We might be able to workaround it if we knew what was triggering it, but that entails troubleshooting on your part and/or rebuilding PHP with --enable-debug and capturing a stacktrace.


#8

Why does ver 1.2 not trigger this bug?


(vipsoft) #9

There are a lot of changes between 1.2 and 1.3, including updates to third-party libraries. This could mean calling PHP functions that we didn’t call before, or exercising existing PHP functions in new ways, etc.

The fact is, Piwik is written in PHP code with no direct access to pointers or memory allocation. If PHP crashes, it’s a bug in PHP. Differences in how your version of PHP is built (e.g., configuration options, extensions, compiler optimizations, version of libc, etc) can also affect the runtime behaviour of PHP. Generally, the latest version of PHP is the most stable.


#10

Hm, we’re running apache with php 5.3.0


(Thomas Seifert) #11

latest php 5.3.x is 5.3.6


(nsproductions) #12

I had this problem with PHP5.2.10. Disabled eaccelerator and restarted apache- Problem solved.

…Looking for replacement for eaccelerator now :slight_smile:


(Matthieu Aubry) #13

[quote=Pluckerwank]
Hm, we’re running apache with php 5.3.0[/quote]

this version is 2 years old and a first major release. time to upgrade !!!


#14

Hi all,

I upgrade my debian Lenny with PHP 5.2.17 and it solves the problem. Actually the last version for Lenny is 5.2.6
http://packages.debian.org/lenny/php5

You can use the packages provides by dotdeb.org
Instructions | Dotdeb
to upgrade to v5.2.17 our v5.3

Hope thi will help


#15

I have the same problem with SEGFAULT since piwik 1.2.1.
Server: ubuntu server x64, PHP 5.3.6, Zend Engine v2.3.0, nginx+php-fpm.
I found, that this problem raised after last line in index.php.
In core dump I found these lines:


Program terminated with signal 11, Segmentation fault.
#0  0x00000000007a5ae2 in gc_zval_possible_root (zv=0x7f94bd6642f8)
    at /usr/local/src/php-5.3.6/Zend/zend_gc.c:143
143                     GC_ZOBJ_CHECK_POSSIBLE_ROOT(zv);

So, problem in php after-run garbage colllection. Google said: problem in setting “zend.enable_gc”.
My solution:

  1. In archive.sh change all

CMD="$PHP_BIN  -q $PIWIK_PATH ... "
$CMD

to


CMD="$PHP_BIN  [b]-d zend.enable_gc=0[/b] -q $PIWIK_PATH ... "
[b]MALLOC_CHECK_=1[/b] $CMD

And I have no problems with archiving.


#16

Perhaps it’s also time to update the requirements on the piwik webpage:

Required configuration to run Piwik

To run Piwik your host needs just a couple of things:

PHP version 5.1.3 or greater
MySQL version 4.1 or greater
(enabled by default) PHP extension pdo and pdo_mysql, or the mysqli extension.
Recommended configuration

We highly recommend using at least PHP 5.3 as it is much more memory efficient than previous PHP versions.


(Thomas Seifert) #17

You mean adding the requirement for a “non-buggy php version”? :wink:


(vipsoft) #18

If you’re using Ubuntu, please apt-get the new packages. There was apparently a regression (or two) in the Ubuntu builds that would cause a seg fault.

  • Ubuntu 11.04
  • Ubuntu 10.10
  • Ubuntu 10.04 LTS
  • Ubuntu 9.10
  • Ubuntu 8.04 LTS
  • Ubuntu 6.06 LTS

#19

Hiq

I’m running Ubuntu 8.04.4 LTS and Piwik 1.4 and the problem persists, even after the fixes given in this thread. (ie. installing the latest php packages, malloc_check etc).

Database Connector is PDO_MYSQL (with MYSQLI I get Apache Segfaults for every request), PHP is loaded is a module. I don’t use Zend Cache but php5_xcache.

The problem seems to have somewhat shifted. With 1.3 I would get messages like this

ALERT - canary mismatch on efree() - heap overflow detected (attacker ‘203.198.169.140’, file ‘/var/www/www_v2/app/webroot/piwik/piwik.php’)

With 1.4 these messages have dissappeared but after about 24h of continuous operation I start getting efree messages on all sorts of random files from my website

ALERT - canary mismatch on efree() - heap overflow detected (attacker ‘67.195.111.246’, file ‘/var/www/www_v2/app/views/layouts/fullscreen_v2.ctp’, line 41)

This is a file from CakePHP, the site has been running this system for over a year now and never did it have any problems in it. After about 20 lines like these, apache stalls. It is still running but only returns empty replies. After restarting Apache, the site is fully operational again.

I’m positive that this has something to do with Piwik, because when I disable it, all of this doesn’t happen.

So guys, please admit … who broke it :slight_smile:

I’m just kidding, this seems to have something to do with a heap/memory corruption but this is really outside of my knowledge of PHP

All the best and thanks for this awesome software!

wirtsi


(Matthieu Aubry) #20

This is a bug in php, or pdo, or something else. It is triggered by Piwik but this is not a piwik issue.