Bug #81648 [NEW]: SIGSEGV on Symfony controller annotations

From: Date: Mon, 22 Nov 2021 11:06:44 +0000
Subject: Bug #81648 [NEW]: SIGSEGV on Symfony controller annotations
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237906@lists.php.net to get a copy of this message
From:             hhoechtl at 1drop dot de
Operating system: Debian 10
PHP version:      8.0.13
Package:          Reproducible crash
Bug Type:         Bug
Bug description:SIGSEGV on Symfony controller annotations

Description:
------------
We try to run a Symfony based project and have some controllers with
PHP8 annotations. But it crashes with a segmentation fault.



(gdb) run bin/console ca:c
Starting program: /usr/local/bin/php bin/console ca:c
[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/x86_64-linux-gnu/libthread_db.so.1".

 // Clearing the cache for the prod environment with debug false        
                                               

Program received signal SIGSEGV, Segmentation fault.
0x00005555559a120b in zend_observer_fcall_end ()
(gdb) bt
#0  0x00005555559a120b in zend_observer_fcall_end ()
#1  0x0000555555974eca in execute_ex ()
#2  0x00005555559076ba in zend_call_function ()
#3  0x0000555555907af5 in zend_call_known_function ()
#4  0x00005555557d0010 in ?? ()
#5  0x00005555556343e5 in ?? ()
#6  0x000055555597ceed in execute_ex ()
#7  0x0000555555990a02 in zend_generator_resume ()
#8  0x0000555555991449 in ?? ()
#9  0x000055555593bd72 in ?? ()
#10 0x0000555555944773 in ?? ()
#11 0x00005555559752b7 in execute_ex ()
#12 0x000055555597d0fe in zend_execute ()
#13 0x0000555555914e5d in zend_execute_scripts ()
#14 0x00005555558b22ae in php_execute_script ()
#15 0x00005555559a2aae in ?? ()
#16 0x000055555563dbcb in ?? ()
#17 0x00007ffff700709b in __libc_start_main () from
/lib/x86_64-linux-gnu/libc.so.6
#18 0x000055555563e30a in _start ()

I traced it down and the root case is this line:

https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php#L376

The constructor of
https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Routing/Route.php#L53
is called with 

array(8) {
  [0]=>
  array(7) {
    ["path"]=>
    string(25) "/api/customer-prices/sync"
    ["name"]=>
    string(26) "api.onedrop.customerprices"
    ["requirements"]=>
    array(0) {
    }
    ["options"]=>
    array(0) {
    }
    ["defaults"]=>
    array(0) {
    }
    ["methods"]=>
    array(1) {
      [0]=>
      string(4) "POST"
    }
    ["schemes"]=>
    array(0) {
    }
  }
  [1]=>
  string(25) "/api/customer-prices/sync"
  [2]=>
  string(26) "api.onedrop.customerprices"
  [3]=>
  array(0) {
  }
  [4]=>
  array(0) {
  }
  [5]=>
  array(0) {
  }
  [6]=>
  NULL
  [7]=>
  array(1) {
    [0]=>
    string(4) "POST"
  }
}

and finishes execution and then the segmentation fault happens. So maybe
it's the yield at that point.





-- 
Edit bug report at https://bugs.php.net/bug.php?id=81648&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=81648&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=81648&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=81648&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=81648&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=81648&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=81648&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=81648&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=81648&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=81648&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=81648&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=81648&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=81648&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=81648&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=81648&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=81648&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=81648&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=81648&r=mysqlcfg


Thread (12 messages)

« previous php.bugs (#237906) next »