View Issue Details

IDProjectCategoryView StatusLast Update
0002192XdebugStep Debuggingpublic2023-11-30 14:26
Reporteralexander.willner Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionno change required 
Platformarm64OSmacOSOS Version13.5
Product Version3.2.2 
Summary0002192: Xdebug v3.2.2 crash on PHP 8.3.0-dev with EXC_BAD_ACCESS (phpzend_hash_str_find + 336 / xdebug.soxdebug_base_rinit + 72)
Description

Xdebug 3.2.2 crashes within PHP 8.3.0-dev by opening a self developed web application (based on Symfony). This happens on arm64/mac and does not occur on PHP 8.2.8 and is directly related to Xdebug (no crash if Xdebug is not loaded).

Steps To Reproduce

% php -v
PHP 8.3.0-dev (cli) (built: Jul 29 2023 16:55:23) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.0-dev, Copyright (c) Zend Technologies
with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans
with Zend OPcache v8.3.0-dev, Copyright (c), by Zend Technologies
% export USE_ZEND_ALLOC=0 ; export ZEND_DONT_UNLOAD_MODULES=1
% (sleep 5 ; curl http://localhost:8196) &
% lldb php -- -S 0.0.0.0:8196 -t web web/router.php
(lldb) target create "php"
Current executable set to 'php' (arm64).
(lldb) settings set -- target.run-args "-S" "0.0.0.0:8196" "-t" "web" "web/router.php"
(lldb) run
Process 80558 launched: '/opt/homebrew/bin/php' (arm64)
[Mon Jul 31 23:00:25 2023] PHP 8.3.0-dev Development Server (http://0.0.0.0:8196) started
[Mon Jul 31 23:00:26 2023] 127.0.0.1:63212 Accepted
Process 80558 stopped

  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x317)
    frame #0: 0x0000000100383940 phpzend_hash_str_find + 336 phpzend_hash_str_find:
    -> 0x100383940 <+336>: ldr x21, [x0, #0x10]
    0x100383944 <+340>: ldr w8, [x0, #0xc]
    0x100383948 <+344>: orr w8, w8, w9
    0x10038394c <+348>: ldr w8, [x21, w8, sxtw 0000002]
    Target 0: (php) stopped.
    (lldb) bt all
  • thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x317)
    • frame #0: 0x0000000100383940 phpzend_hash_str_find + 336 frame #1: 0x000000010255b5ec xdebug.soxdebug_base_rinit + 72
      frame 0000002: 0x000000010255923c xdebug.sozm_activate_xdebug + 936 frame 0000003: 0x00000001003771bc phpzend_activate_modules + 52
      frame 0000004: 0x000000010030f148 phpphp_request_startup + 504 frame 0000005: 0x000000010045dcd0 phpphp_cli_server_recv_event_read_request + 468
      frame 0000006: 0x000000010045e6b0 phpphp_cli_server_do_event_for_each_fd_callback + 164 frame 0000007: 0x000000010045c700 phpdo_cli_server + 2144
      frame 0000008: 0x00000001004577c0 phpmain + 756 frame 0000009: 0x0000000185e6bf28 dyldstart + 2236
      thread 0000002
      frame #0: 0x0000000186185c08 libsystem_kernel.dylib__workq_kernreturn + 8 thread 0000003 frame #0: 0x0000000186185c08 libsystem_kernel.dylib__workq_kernreturn + 8
      (lldb)
TagsNo tags attached.
Operating System
PHP Version8.3-dev

Activities

derick

2023-08-01 09:24

administrator   ~0006616

I can't reproduce this.

Can you try to recompile Xdebug? It is possible that it didn't get the latest data structures right from PHP, especially if you have recently upgraded that, but not Xdebug.

If that doesn't work, I need more information. For example, the data values that lead to this situation:

  1. In Linux' GDB, you can do bt full, it seems that on OSX (which I don't have) with lldb, you can use bt all.
  2. frame 1
  3. fr v -a
  4. p core_globals.http_globals
  5. frame 0
  6. fr v -a
  7. p *ht
  8. p str
  9. p len

alexander.willner

2023-08-01 13:06

reporter   ~0006628

True, doesn't happen if I compile it from master (I installed a version via package manager brew). I guess we can close this.

derick

2023-11-30 14:26

administrator   ~0006688

OK, closing it then. FWIW, Xdebug 3.2 should not even have compiled with PHP 8.3, so I don't know what's going on there either.

Issue History

Date Modified Username Field Change
2023-07-31 21:10 alexander.willner New Issue
2023-08-01 09:24 derick Assigned To => derick
2023-08-01 09:24 derick Status new => feedback
2023-08-01 09:24 derick Note Added: 0006616
2023-08-01 13:06 alexander.willner Note Added: 0006628
2023-08-01 13:06 alexander.willner Status feedback => assigned
2023-11-30 14:26 derick Status assigned => resolved
2023-11-30 14:26 derick Resolution open => no change required
2023-11-30 14:26 derick Note Added: 0006688