Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#23001 closed defect (bug) (invalid)

invoking post_gallery filter causes segfault

Reported by: gcrumb's profile gcrumb Owned by:
Milestone: Priority: normal
Severity: major Version: 3.5
Component: Media Keywords: reporter-feedback
Focuses: Cc:

Description

Attempting to change some default values in the gallery_shortcode function. I copied and pasted it into functions.php, changed the values of the 'columns' and 'size' attributes, and then added the filter hook:

add_filter('post_gallery', 'pipp_gallery_shortcode', 10,1 );

Reloading a post with a gallery included causes a segmentation fault:
user@host:/srv/www-apps/folder/wp-content/themes/pipp$ sudo tail /var/log/apache2/error.log
[Wed Dec 19 16:40:06 2012] [notice] child pid 25830 exit signal Segmentation fault (11)

Commenting the add_filter line causes the post to display properly.

$uname -r
3.2.0-3-686-pae

$ apache2 -v
Server version: Apache/2.2.22 (Debian)
Server built: Aug 3 2012 22:41:19

$ cat /etc/debian_version
wheezy/sid

Wordpress v 3.5 (newly upgraded)

functions.php attached for reference.

Attachments (1)

functions.php (5.4 KB) - added by gcrumb 12 years ago.

Download all attachments as: .zip

Change History (3)

@gcrumb
12 years ago

#1 @dd32
12 years ago

I'm going to take a guess here, pipp_gallery_shortcode() calls the post_gallery filter, which calls pipp_gallery_shortcode(), which calls the post_gallery filter, which calls pipp_gallery_shortcode().. etc..

Because there's multiple layers of functions there, PHP's infinite loop protection probably doesn't kick in, remove the filter from your filter and see if that stops it, otherwise, keep debugging your filter and find what does cause it.

Last edited 12 years ago by dd32 (previous) (diff)

#2 @dd32
12 years ago

  • Keywords reporter-feedback added
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Closing as invalid unless a specific WordPress bug is found that triggers a specific PHP bug (other than infinite loops)

Note: See TracTickets for help on using tickets.