Answers.Body: <p>I have finally tracked it down to an API call that I used to get the values of a particular option group. The code was:</p>
  <pre><code>$optionValues = \Civi\Api4\OptionValue::get()
    -&gt;addWhere('option_group_id:name', '=', 'my_group')
    -&gt;execute();
  </code></pre>
  <p>When I went through the debugger, I noticed that the call just went through a loop until memory was just exhausted, hence the segmentation fault.  I changed this to:</p>
  <pre><code>$optionValues = \Civi\Api4\OptionValue::get(FALSE)
    -&gt;addWhere('option_group_id:name', '=', 'my_group')
    -&gt;execute();
  </code></pre>
  <p>This solved the issue and so it seems that the default of check permisions is now TRUE by default.</p>
  <p>The good news is that managed files (mgd.php) are handled by the Mixin <code>mgd-php@1.0.0</code>.  Running <code>civix upgrade</code> on the extension removed the code that previously dealt with all that, so that slims the code base down a bit.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-02T11:20:17.097Z
Answers.LastActivityDate: 2024-04-02T11:20:17.097Z
Answers.UserDisplayName: ChumKui
Body: <p>I'm using Drupal 10.2.4 with Apache 2.4, PHP8.1.2 and MySQl 8</p>
  <p>I have just tested locally on Docker upgrading from CiviCRM 5.70.2 to 5.71.1 and get an immediate crash.  Here is the Docker output:</p>
  <pre><code>2024-03-14 17:09:38 [Thu Mar 14 17:09:38.810014 2024] [core:notice] [pid 1] AH00052: child pid 249 exit signal Segmentation fault (11)
  </code></pre>
  <p>I thought it might be database related so tried doing a database update first before accessing CiviCRM (the Drupal database is already up to date).  I get a segmentation fault, along with several Smarty notices:</p>
  <pre><code>    www-bridge-user@bfdbdd09a7a9:/var/www/html$ cv upgrade:db
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/org.civicrm.shoreditch/shoreditch.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/eu.businessandcode.notepermissions-master/notepermissions.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/checksum/checksum.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/uk.countrytrust.securenotesfromexport/securenotesfromexport.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/configitems-2.0.0/civiconfig.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/uk.countrytrust.additional-permissions/additional_permissions.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/uk.countrytrust.reroute_email/reroute_email.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/summernote-1.2.2/summernote.civix.php:100
  Found CiviCRM database version 5.70.2.
  Found CiviCRM code version 5.71.1.
  Checking pre-upgrade messages...
  (No messages)
  Dropping SQL triggers...
  Preparing upgrade...
  Executing upgrade...
  ..................Segmentation fault
  </code></pre>
  <p>I've never ever seen a segmentation fault before and so its really odd. The same happens on a clone of my live environment, so I do not think this is anything to do with my local Docker development environment (which mimics Live anyway).</p>
  <p>Has anyone else seen this? Does anyone have any thoughts on how I troubleshoot this? It maybe something is using all the memory in some way.</p>
  <p>In addition, what are the Smarty notices? (I have already added the define statement for CIVICRM_SMARTY3_AUTOLOAD_PATH).</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-03-27T11:17:59.197Z
Comments.Text: I have finally tracked this down to an inhouse extension that adds addtional Drupal permissions to control some aspects of CiviCRM like SearchKit reports.  The issue seems to lie with the handling of Managed i.e. the single mgd.php we have.  Somewhere from 5.70 to 5.71, there must have been a change and I'll need to try to understand where that is and how mgd files are picked up now.  when I know for sure,I'll report back
Comments.UserDisplayName: ChumKui
Tags: <upgrade><civix><apiv4>
Title: Upgrading to CiviCRM 5.71.1 from 5.70.2 causes a crash (Segmentation fault)
ThreadText: # Upgrading to CiviCRM 5.71.1 from 5.70.2 causes a crash (Segmentation fault)
  
  (Asked by: username_0 on 2024-03-14)
  
  I'm using Drupal 10.2.4 with Apache 2.4, PHP8.1.2 and MySQl 8
  
  I have just tested locally on Docker upgrading from CiviCRM 5.70.2 to 5.71.1 and get an immediate crash. Here is the Docker output:
  
  ```
  2024-03-14 17:09:38 [Thu Mar 14 17:09:38.810014 2024] [core:notice] [pid 1] AH00052: child pid 249 exit signal Segmentation fault (11)
  
  ```
  
  I thought it might be database related so tried doing a database update first before accessing CiviCRM (the Drupal database is already up to date). I get a segmentation fault, along with several Smarty notices:
  
  ```
      www-bridge-user@bfdbdd09a7a9:/var/www/html$ cv upgrade:db
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/org.civicrm.shoreditch/shoreditch.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/eu.businessandcode.notepermissions-master/notepermissions.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/checksum/checksum.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/uk.countrytrust.securenotesfromexport/securenotesfromexport.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/configitems-2.0.0/civiconfig.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/uk.countrytrust.additional-permissions/additional_permissions.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/uk.countrytrust.reroute_email/reroute_email.civix.php:100
  [PHP Notice] Indirect modification of overloaded property CRM_Core_Smarty::$template_dir has no effect at /var/www/html/web/sites/default/files/civicrm/ext/summernote-1.2.2/summernote.civix.php:100
  Found CiviCRM database version 5.70.2.
  Found CiviCRM code version 5.71.1.
  Checking pre-upgrade messages...
  (No messages)
  Dropping SQL triggers...
  Preparing upgrade...
  Executing upgrade...
  ..................Segmentation fault
  
  ```
  
  I've never ever seen a segmentation fault before and so its really odd. The same happens on a clone of my live environment, so I do not think this is anything to do with my local Docker development environment (which mimics Live anyway).
  
  Has anyone else seen this? Does anyone have any thoughts on how I troubleshoot this? It maybe something is using all the memory in some way.
  
  In addition, what are the Smarty notices? (I have already added the define statement for CIVICRM\_SMARTY3\_AUTOLOAD\_PATH).
  
  **Tags:** upgrade, civix, apiv4
  
  > **Comments:**
  > **username_0**: I have finally tracked this down to an inhouse extension that adds addtional Drupal permissions to control some aspects of CiviCRM like SearchKit reports.  The issue seems to lie with the handling of Managed i.e. the single mgd.php we have.  Somewhere from 5.70 to 5.71, there must have been a change and I'll need to try to understand where that is and how mgd files are picked up now.  when I know for sure,I'll report back  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-04-02. Score: 1 | Accepted answer
  
  I have finally tracked it down to an API call that I used to get the values of a particular option group. The code was:
  
  ```
  $optionValues = \Civi\Api4\OptionValue::get()
    ->addWhere('option_group_id:name', '=', 'my_group')
    ->execute();
  
  ```
  
  When I went through the debugger, I noticed that the call just went through a loop until memory was just exhausted, hence the segmentation fault. I changed this to:
  
  ```
  $optionValues = \Civi\Api4\OptionValue::get(FALSE)
    ->addWhere('option_group_id:name', '=', 'my_group')
    ->execute();
  
  ```
  
  This solved the issue and so it seems that the default of check permisions is now TRUE by default.
  
  The good news is that managed files (mgd.php) are handled by the Mixin `mgd-php@1.0.0`. Running `civix upgrade` on the extension removed the code that previously dealt with all that, so that slims the code base down a bit.
  
  
  ---
  
  