Project

General

Profile

Demande #3983

Passage à php 7.3

Added by François Poulain 18 days ago. Updated 16 days ago.

Status:
En cours de traitement
Priority:
Immédiate
Target version:
-
Start date:
11/02/2019
Due date:
% Done:

0%

Estimated time:

Description

Coucou,

Le passage à php 7.3 a nécessite un munge de ma part, en prod :

(April) root@dtc:/var/www/adherents.april.org/gdtc[production*$ u=]# git diff
diff --git a/gdtc/include/coherence.php b/gdtc/include/coherence.php
index 9c3e5da..f20033e 100644
--- a/gdtc/include/coherence.php
+++ b/gdtc/include/coherence.php
@@ -807,7 +807,7 @@ function check_cmcic_amount_is_fucked ($filter = '')
       }
     }

-  $output[0] = "Problème de montant récurrent : " . sizeof($output[3]). " résultat(s)";
+  $output[0] = "Problème de montant récurrent : « FIXME: PHP7.3 casse ici » résultat(s)";

   if ( $output[3] )
     return $output;

Autrement, ça c'est plutôt bien passé. Il a essentiellement fallu installer des dépendances :
php7.3-mbstring php7.3-recode php7.3-gd php7.3-mysql

History

#1

Updated by François Poulain 18 days ago

  • Subject changed from Passgae à php 7.3 to Passage à php 7.3
#2

Updated by Benjamin Drieu 16 days ago

  • Status changed from Nouveau to En cours de traitement
  • Priority changed from Élevée to Immédiate

Sur certaines pages, comme https://adherents.april.org/admin/?action=edit&table=actor&id=404 on a un gros bortch (segfault Apache2). La backtrace est la suivante :

#0  0x00007faa5c8cf61d in _emalloc () from target:/usr/lib/apache2/modules/libphp7.3.so
#1  0x00007faa5c8f67a0 in add_next_index_stringl () from target:/usr/lib/apache2/modules/libphp7.3.so
#2  0x00007faa5c7a1e28 in php_pcre_match_impl () from target:/usr/lib/apache2/modules/libphp7.3.so
#3  0x00007faa5c7a2fbf in ?? () from target:/usr/lib/apache2/modules/libphp7.3.so
#4  0x00007faa5c979394 in execute_ex () from target:/usr/lib/apache2/modules/libphp7.3.so
#5  0x00007faa5c97b437 in zend_execute () from target:/usr/lib/apache2/modules/libphp7.3.so
#6  0x00007faa5c8f4073 in zend_execute_scripts () from target:/usr/lib/apache2/modules/libphp7.3.so
#7  0x00007faa5c894838 in php_execute_script () from target:/usr/lib/apache2/modules/libphp7.3.so
#8  0x00007faa5c97d672 in ?? () from target:/usr/lib/apache2/modules/libphp7.3.so
#9  0x000055e76bba5a40 in ap_run_handler ()
#10 0x000055e76bba5fd6 in ap_invoke_handler ()
#11 0x000055e76bbbe453 in ap_process_async_request ()
#12 0x000055e76bbbe5be in ap_process_request ()
#13 0x000055e76bbba82d in ?? ()
#14 0x000055e76bbaf8b0 in ap_run_process_connection ()
#15 0x00007faa5d8a43df in ?? () from target:/usr/lib/apache2/modules/mod_mpm_prefork.so
#16 0x00007faa5d8a46d4 in ?? () from target:/usr/lib/apache2/modules/mod_mpm_prefork.so
#17 0x00007faa5d8a53bf in ?? () from target:/usr/lib/apache2/modules/mod_mpm_prefork.so
#18 0x000055e76bb8867e in ap_run_mpm ()
#19 0x000055e76bb80f57 in main ()
#3

Updated by François Poulain 16 days ago

Je suis intéressé de voir comment tu sors la strack trace.

Un strace me sussure que le code qui traite les emails de contact se poutre sur un vieux mojibake :

[pid 17085] sendto(19, "R\0\0\0\3  SELECT *     FROM contact    WHERE actor_id = '404' ORDER BY contact_date"..., 86, MSG_DONTWAIT, NULL, 0) = 86
[pid 17085] poll([{fd=19, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=19, revents=POLLIN}])
[pid 17085] recvfrom(19, "\1\0\0\1\v<\0\0\2\3def\4gdtc\7contact\7contact\ncontact_id\ncontact_id\f?\0\v\0\0\0\3\vB\0\0\08\0\0\3\3def\4gd"..., 32768, MSG_DONTWAIT, NULL, NULL) = 32768
[pid 17085] poll([{fd=19, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=19, revents=POLLIN}])
[pid 17085] recvfrom(19, "ssag\303\250res mais que vous\nsouhaitez rester membre de l'April, pr\303\251venez-moi pour q"..., 32768, MSG_DONTWAIT, NULL, NULL) = 32768
[pid 17085] poll([{fd=19, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=19, revents=POLLIN}])
[pid 17085] recvfrom(19, " (ou plus) le cas, merci d'envoyer un courriel \303\240\nsecretaire@april.org\n\373\373\373\373\373\344\7\0#"..., 32768, MSG_DONTWAIT, NULL, NULL) = 32768
[pid 17085] poll([{fd=19, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=19, revents=POLLIN}])
[pid 17085] recvfrom(19, "@metrodore.fr>,\n  \"secretaire\\@april.org\" <secretaire@april.org>,  tresorier\n <t"..., 32768, MSG_DONTWAIT, NULL, NULL) = 32768
[pid 17085] poll([{fd=19, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=19, revents=POLLIN}])
[pid 17085] recvfrom(19, "> Ce n'est en aucun cas sp\303\251cifique aux emails. Aucun service sur\n>> Internet ne"..., 32768, MSG_DONTWAIT, NULL, NULL) = 32768
[pid 17085] poll([{fd=19, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=19, revents=POLLIN}])
[pid 17085] recvfrom(19, "de quoi s'asseoir, se restaurer, s'abreuver.\r\n\r\nEt pourquoi pas des jeux... au h"..., 32768, MSG_DONTWAIT, NULL, NULL) = 32768
[pid 17085] poll([{fd=19, events=POLLIN|POLLERR|POLLHUP}], 1, 86400000) = 1 ([{fd=19, revents=POLLIN}])
[pid 17085] recvfrom(19, "os activit\303\251s. Recommandez \303\240 ces personnes\nd'adh\303\251rer \303\240 l'April. Vous pouvez \303"..., 32768, MSG_DONTWAIT, NULL, NULL) = 1426
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/Contracts/CharsetManager.php", {st_mode=S_IFREG|0644, st_size=566, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/Contracts/Middleware.php", {st_mode=S_IFREG|0644, st_size=519, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/Parser.php", {st_mode=S_IFREG|0644, st_size=27438, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/Middleware.php", {st_mode=S_IFREG|0644, st_size=560, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/MiddlewareStack.php", {st_mode=S_IFREG|0644, st_size=2062, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/MimePart.php", {st_mode=S_IFREG|0644, st_size=2073, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/Attachment.php", {st_mode=S_IFREG|0644, st_size=3708, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/Exception.php", {st_mode=S_IFREG|0644, st_size=84, ...}) = 0
[pid 17085] stat("/var/www/adherents.april.org/gdtc/gdtc/vendor/php-mime-mail-parser/src/Charset.php", {st_mode=S_IFREG|0644, st_size=16229, ...}) = 0
[pid 17085] --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
[pid 17085] chdir("/etc/apache2")       = 0
[pid 17085] rt_sigaction(SIGSEGV, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_INTERRUPT, sa_restorer=0x7f0f189a3730}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER|SA_RESETHAND, sa_restorer=0x7f0f189a3730}, 8) = 0
[pid 17085] getpid()                    = 17085
[pid 17085] getpid()                    = 17085
[pid 17085] kill(17085, SIGSEGV)        = 0
[pid 17085] rt_sigreturn({mask=[]})     = 9155561690729807872
[pid 17085] --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_USER, si_pid=17085, si_uid=33} ---
[pid 17085] +++ killed by SIGSEGV +++
#4

Updated by François Poulain 16 days ago

en attendant correction, j'ai contourné avec

diff --git a/gdtc/include/contact.php b/gdtc/include/contact.php
index 303c458..016c011 100644
--- a/gdtc/include/contact.php
+++ b/gdtc/include/contact.php
@@ -125,7 +125,7 @@ function get_contacts ( $actor_id, $full = false )

-       if (version_compare(phpversion(), '7.0.0', '<')) {
+       if (true || version_compare(phpversion(), '7.0.0', '<')) {
        }
        else
        {

Also available in: Atom PDF