Dragonfly CMS v9 ⇒ Coppermine ⇒ Seg Fault in CPG searchnew -> functions.inc ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks Coppermine

Seg Fault in CPG searchnew -> functions.inc Reply to topic


I've had coppermine running in numerous sites, but when I copied one site to my new host I get the following error:

[Sun Apr 19 14:09:52 2009] [error] [client 82.19.162.248] php-script: line 8: 1240 Segmentation fault /usr/bin/php-cgi, referer: http://nortonandbrooksbank.co.uk/coppermine/searchnew.html [Sun Apr 19 14:09:52 2009] [error] [client 82.19.162.248] Premature end of script headers: php-script, referer: http://nortonandbrooksbank.co.uk/coppermine/searchnew.html

This is triggered in Admin > Coppermine > Batch Add, and ONLY occurs if the folder has an image file in it. (Ie. if it just has the default read.txt, then I can access the folder just fine.)

I have traced down through the code of modules/coppermine/searchnew.php to the call to the function get_cat_content in includes/coppermine/functions.inc.

If I disable the whole of function get_cat_content by commenting it out, then batch add works (but of course I can't select an album to batch add to).

If I moved the commented out down to the 1st SQL call I get the error, ervery time:function get_cat_content(&$list, $cat, $title) { echo'<br>$cat='.$cat; //if (!GALLERY_ADMIN_MODE) $upload = "AND uploads = 1"; $upload = (!GALLERY_ADMIN_MODE) ? "AND uploads = 1" : ''; global $db, $CONFIG, $module_name; $albums = $db->sql_query("SELECT aid, title, visibility FROM {$CONFIG['TABLE_ALBUMS']} WHERE category = " . $cat . " $upload ORDER BY title"); /* $ug = USER_IN_GROUPS; while ($album = $db->sql_fetchrow($albums)) {

(The echo statement was added to check where I was getting to.)

I've checked that call:SELECT aid, title, visibility FROM cms_cpg_albums WHERE category = 0 ORDER BY titlemanually in phpMyAdmin, and it returns no result - as you would expect (no albums at top level), so not likely it is taking too long - plus the seg fault is immediate.

I'm running on a Paralles pro / Ensim host set to "Highly Security" which I expected to cause file permission errors, but not MySQL issues.

I've tried raising php.ini memory_usage from 32MB to 64MB just in case, but it made no difference.

Any ides of what I should try next? Or what I should ask my Host to look into?

TIA.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Any ideas?

It actually appears to be *ANY* mySQL access from within functions.inc causes the error. While sql is being called from within searchnew.php all is well, but as soon as it calls to includes/coppermine/functions.inc for function get_albumlist() it seq faults.

Odd thing is that function get_albumlist($user_id=0) is called from many places in CPG, and these all still work, although these are called mostly with the parameter USER_ID.

This is with a vanilla 9.2.1 CPG, so I think it has to be something triggered by Parallels Pro (formerly Ensim Pro) High Security version. But what???

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


For clarification this is problem has nothing to do with the actual processing of the image files. It's failing at the 1st step, that of simply listing the images to be added.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Bump ??

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


OK, I could really do with some help from someone who understands Coppermine...

I have the full attention of my host, but nothing discovered yet.

They are running Parallels Pro Ensim in HIGH SECURITY mode - the HS mode may be the unique thing. (This SAME site is still running fine on a cPanel host without crashing.)

This - among other things - forces all folders to 755 and all files to 644. If there are no images in a folder batchadd will scan it. Ditto if folder set to 644 it will scan without crashing even if images in folder, but of course never find any.

But the strange thing I can't understand is that it is not the display of files to be imported that fails. If I comment out the calls to includes/coppermine/functions.inc I can display the list of files to be imported - but I'm missing the dropdown menu form which to select the destination album. How can an album list menu be causing a Seg Fault??? Esp. as that menu appears in many other places OK...

I'm leaning

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


Resolved by changing otherwise perfectly good (albeit somewhat unusual) code in function dirheader in modules/coppermine/searchnew.php. (See bug report for details.) Problem can occur only on hosts using Parallels/Ensim Pro in High Security mode (unknown if it occurs in Medium/Low Security mode, but possibly/probably not respectively).

Resolution reported in bug id=1091.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


I hav fixed it in CVS

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Thanks. Wouldn't want anyone to have to go through that ordeal again Wink A LOT of code tracing and echo statements ...

Any ideas as to why it failed? Host had no idea, and Parallels won't support Ensim even to ISP's unless they pay ($50 up front, returnable if Parallels deem it their fault).

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


en.wikipedia.org/wiki/...tion_fault

It is mostly a PHP sourcecode problem and it can only be debugged by compiling PHP in debug mode and run some traces.
Hard to get a clue this way without having the sourcecode.

For example, while programming some advanced PHP 5 code i had a segfault and it took 2 hours to pinpoint the issue.
Browsing on bugs.php.net it was a 5.1.x issues and i should upgrade to 5.2.x to solve the issue.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Just a note for others using a host employing Parallels Pro Ensim in HIGH SECURITY mode: as well as the fix above, you will also need to access your database using 127.0.0.1 instead of "localhost".

Use of localhost will work 'some of the time', but you may experience a DB access error following a system reboot. Edit of config.php will address/prevent this.

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4

All times are UTC


Jump to: