Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Memory Error in class.dynamic_forms.php #1707

Closed
infectormp opened this issue Jan 30, 2015 · 13 comments
Closed

PHP Memory Error in class.dynamic_forms.php #1707

infectormp opened this issue Jan 30, 2015 · 13 comments
Labels

Comments

@infectormp
Copy link

on nginx with installed osTicket v1.9.5.1 and get this error when try open ticket:

FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 130968 bytes) in ..../include/class.dynamic_forms.php on line 1137

i set memmory limit to 512MB and get
FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 130968 bytes) in ..../include/class.dynamic_forms.php on line 1137

Server info:
nginx 1.7.8 (Linux)
PHP 5.6.5

@Hamsteren
Copy link
Contributor

nginx isnt officially supported, you might be better off asking for help on the forum.

@ntozier
Copy link
Contributor

ntozier commented Jan 30, 2015

@Hamsteren
Copy link
Contributor

Sorry didn't know that.

@ntozier
Copy link
Contributor

ntozier commented Jan 30, 2015

No worries. :)

@infectormp
Copy link
Author

problem in PHP-FPM not in nginx.

@greezybacon
Copy link
Contributor

I'd love to get to the bottom of this. I have observed the issue consistently using PHP-FPM — at a different location in the codebase, but haven't stumbled across a solution yet.

@infectormp
Copy link
Author

look like problem in database. i drop osticket database and install it again. with clean database all work fine.

then i drop clear db and restore "broken" and get same error.

@rp-tech
Copy link

rp-tech commented Feb 24, 2015

Mine seems to work fine (so far).

-OSTicket 1.9.5.1
-Debian 7
-Nginx 1.2.1 -> older version, possibly because of Debian 'stable' release cycle (acquired using apt)

What flavor is your linux server? Perhaps the issue is that you are running a newer version of Nginx (more unstable?) I used to run Arch for giggles but never in a production environment!

PS - please check the following link: http://wiki.nginx.org/OSTicket

It helped me configure it to work properly!

@infectormp
Copy link
Author

osTicket work fine if i make clean install of osTicket 1.9.5.1
-Gentoo x64
-nginx 1.9.8
-mariadb 10.0.16

i get this error after update osticket from 1.9.4 to 1.9.5.1. I reproduce this error after restore 1.9.4 db to 1.9.5.1 instalation.

@rp-tech
Copy link

rp-tech commented Feb 25, 2015

Hmm, I'm also running Maria DB 10.0.16 and I updated to NGINX 1.6.2 and it's working as well. On the other hand, I use Debian (not Gentoo).

Coincidentally, I imported my database from 1.9.4 -> 1.9.5 as well but mine works. Possibly database corruption?

EDIT: Greezy mentioned an issue with PHP-FPM... I am on v 5.4.36-0 in case you are wondering.

@infectormp
Copy link
Author

i can upload db dump to somewhere. this is test db.

@greezybacon
Copy link
Contributor

@infectormp hmm. I wonder if this is a recursion loop. We implemented a fix for a such issue on develop-next, 4b5b69d

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 8baf336..11bb389 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -1154,9 +1154,13 @@ function getField() {
     }

     function getValue() {
-        if (!$this->_value && isset($this->value))
+        if (!isset($this->_value) && isset($this->value)) {
+            //XXX: We're settting the value here to avoid infinite loop
+            $this->_value = false;
             $this->_value = $this->getField()->to_php(
                 $this->get('value'), $this->get('value_id'));
+        }
+
         return $this->_value;
     }

@infectormp
Copy link
Author

@greezybacon, this is magic! Your fix is work.

I restore old database, check for error and error still here, apply your patch and MAGIC... ticket open correctly. Fix work.

Restore new database and osTicket sill work with this patch 👍

@greezybacon greezybacon added the bug label Mar 1, 2015
zaphoyd added a commit to HumanitiesComputing/osTicket-1.8 that referenced this issue Mar 27, 2015
v1.9.6

Maintenance release for the osTicket 1.9 series

Enhancements
  * New Message-Id system allowing for better threading in mail clients (osTicket#1549, osTicket#1730)
  * Fix forced session expiration after 24 hours (osTicket#1677)
  * Staff panel logo is customizable (osTicket#1718)
  * Priority fields have a selectable default (instead of system default) (osTicket#1732)
  * Import/Export support for file contents via cli (osTicket#1661)

Improvements
  * Fix broken links in documentation, thanks @Chefkeks (osTicket#1675)
  * Fix handling of some Redmond-specific character set encoding names (osTicket#1698)
  * Include the user's name in the "To" field of outbound email (osTicket#1549)
  * Delete collaborators when deleting tickets (osTicket#1709)
  * Fix regression preventing auto-responses for staff new tickets (osTicket#1712)
  * Fix empty export if ticket details form has multiple priority fields (osTicket#1732)
  * Fix filtering by list item properties in ticket filters (osTicket#1741)
  * Fix missing icon for "add new filter", thanks @Chefkeks (osTicket#1735)
  * Support Firefox v6 - v12 on the file drop widget (osTicket#1776)
  * Show update errors on access templates (osTicket#1778)
  * Allow empty staff login banner on update (osTicket#1778)
  * Fix corruption of text thread bodies for third-party collaborator email posts (osTicket#1794)
  * Add some hidden template variables to pop out content (osTicket#1781)
  * Fix missing validation for user name and email address (osTicket#1816, eb8858e)
  * Turn off search indexing when complete, disable incorrectly implemented work breaking, squelch error 1062 email from search backend (afa9692)
  * Fix possible out of memory crash in custom forms (osTicket#1707, 0440111)

Performance and Security
  * Fix generation of random data on Windows® platforms (osTicket#1672)
  * Fix possible DoS and brute force on login pages (osTicket#1727)
  * Fix possible redirect away from HTTPS on client login page, thanks @ldrumm (osTicket#1782)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants