#11  
Old 2005-08-05, 06:04 PM
dcoonich dcoonich is offline
Junior Member
 
Join Date: Aug 2005
Posts: 1
Default Re: Segmentation fault (11

Hi,
On FC4 with latest patches as of this date of this message. I added the following to my .htaccess at the root of the Sugar CRM install and it appears to work. I didn't troubleshoot as to which of these two entries fix it but since geeklog also had similar behaviour and it needed this to allow logins I tried it right away and it worked.

php_value register_globals 1
php_value register_long_arrays 1

This modified .htaccess file will also now allow the sample data to populate mysql and not hang!

In a nutshell add this your .htaccess BEFORE invoking the installer through the URL. Maybe this can be added to the checklist in the installer?

Last edited by dcoonich; 2005-08-05 at 06:12 PM. Reason: update
Reply With Quote
  #12  
Old 2006-01-20, 03:03 AM
SerSiTiv SerSiTiv is offline
Member
 
Join Date: Jan 2006
Posts: 8
Default Re: Segmentation fault (11

Did as suggested and Sugar stoped crashing my Apache.

So what exactly is happening that is causing the crashes?
Reply With Quote
  #13  
Old 2006-01-20, 06:39 AM
sugarchris's Avatar
sugarchris sugarchris is offline
A Sugar Hero
 
Join Date: Sep 2005
Location: San Francisco, CA
Posts: 861
Send a message via Yahoo to sugarchris
Default Re: Segmentation fault (11

The exact reason is fairly simple but not intuitive.

In load_user() or authenticate_user(), methods in the User class, there was some old cade that performed an array_merge() on $_SESSION. In PHP:
PHP Code:
$newArr = array(xy....);
$_SESSION array_merge($_SESSION$newArr); 
Intuitively, since $_SESSION is just an array, albeit an important and unique one, the above code should not produce errors. However, in certain versions of PHP 4 and 5, one can cause an Apache segfault by performing this operation.

The technical reason (and keep in mind that this is 3rd-hand information) is that the memory space occupied by $_SESSIONs is protected, The way array_merge() operates is to take the passed arrays, merge them in some memory space, then assign that new array to the value you want. Doing this with $_SESSION corrupts the memory space, and in some cases, fails catostrophically, killing the apache instance serving that page. This extends to all Superglobal class arrays, such as $_SERVER, $_POST, etc.

I believe Jacob, our CTO, can explain it much more precisely. But in a nutshell, don't do it!
__________________
Chris Nojima
Ex-SugarCRM Software Engineer

FAQ: InboundEmail Day-to-Day Usage
FAQ: InboundEmail Setup Issues
FAQ: Schedulers Setup & Usage
Reply With Quote
Did you know that 80% of Sugar University's training offerings are available at no charge?

Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Forum Jump


All times are GMT. The time now is 05:22 PM.


Powered by: vBulletin
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SourceForge.net Logo