View Issue Details

IDProjectCategoryView StatusLast Update
0002328XdebugUncategorizedpublic2025-03-07 12:53
Reportertenzap Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status assignedResolutionopen 
Product Version3.4.1 
Summary0002328: tests failing with zend_mm_heap corrupted
Description

Running the tests of php-league-csv leads to crash.

phpunit --exclude-group network --no-coverage

Running it with
export USE_ZEND_ALLOC=0
export ZEND_DONT_UNLOAD_MODULES=1
doesn't lead to crash

Steps To Reproduce

Run the test suite of https://github.com/thephpleague/csv/ version 9.22.0

Command:

vendor/bin/phpunit --exclude-group network --no-coverage

You could also try this command which results into the same crash:

composer run-script phpunit-min

Be sure to not have XDEBUG_MODE=coverage, because when it is set, the tests don't fail.

If Xdebug is not installed, it doesn't fail either.

Output is

PHPUnit 11.5.11 by Sebastian Bergmann and contributors.

Runtime: PHP 8.4.4
Configuration: /mnt/packages/git_repos/dpkg/php-league-csv/phpunit.xml

............................................................... 63 / 678 ( 9%)
............................................................... 126 / 678 ( 18%)
..........DDDDD................................................ 189 / 678 ( 27%)
....................................DDDDDDDDDDD.............zend_mm_heap corrupted
Aborted (core dumped)

I also attach the output of valgrind, invoked with various parameters.

TagsNo tags attached.
Attached Files
valgrind.log.gz (1,096 bytes)
Operating SystemDebian trixie
PHP Version8.4-dev

Activities

tenzap

2025-03-07 07:36

reporter   ~0007196

There is a typo. It's not

composer run-script phpunit-min

but

composer run-script phpunit:min

derick

2025-03-07 12:07

administrator   ~0007198

Hi,

I can't seem to be able to reproduce this.

  1. Could you share the output of php -r 'xdebug_info();'
  2. You say that you're using Debian trixie, which is "testing". I wonder whether that is the problem. Can you try with "bookwork" perhaps?
  3. Your reproduce case runs through a lot of tests. Would you be able to narrow it down into running just the test that makes things fail? You can use phpunit's --debug flag for that

cheers,
Derick

tenzap

2025-03-07 12:33

reporter   ~0007202

  1. See attachement
  2. It works on bookworm but this is with php 8.2 & xdebug 3.2. We can only say that the problem is probably not in league/csv
  3. Running only the crashing test succeeds when run alone. Even running the tests ot the class that contain it succeeds.
xdebug_info.txt (5,279 bytes)   
__   __   _      _                 
\ \ / /  | |    | |                
 \ V / __| | ___| |__  _   _  __ _ 
  > < / _` |/ _ \ '_ \| | | |/ _` |
 / . \ (_| |  __/ |_) | |_| | (_| |
/_/ \_\__,_|\___|_.__/ \__,_|\__, |
                              __/ |
                             |___/ 

Version => 3.4.1
Support Xdebug on Patreon, GitHub, or as a business: https://xdebug.org/support

             Enabled Features (through 'xdebug.mode' setting)             
Feature => Enabled/Disabled
Development Helpers => ✔ enabled
Coverage => ✘ disabled
GC Stats => ✘ disabled
Profiler => ✘ disabled
Step Debugger => ✘ disabled
Tracing => ✘ disabled

                            Optional Features                            
Compressed File Support => yes (gzip)
Clock Source => clock_gettime
TSC Clock Source => unavailable
'xdebug://gateway' pseudo-host support => yes
'xdebug://nameserver' pseudo-host support => yes
Systemd Private Temp Directory => not enabled

                              Diagnostic Log                              
[Config] WARN: Not setting up control socket with default value due to unavailable 'tsc' clock

                                   PHP                                   
                           Build Configuration                           
Version (Run Time) => 8.4.4
Version (Compile Time) => 8.4.3
Debug Build => no
Thread Safety => disabled
                                 Settings                                 
Configuration File (php.ini) Path => /etc/php/8.4/cli
Loaded Configuration File => /etc/php/8.4/cli/php.ini
Scan this dir for additional .ini files => /etc/php/8.4/cli/conf.d
Additional .ini files parsed => /etc/php/8.4/cli/conf.d/10-mysqlnd.ini,
/etc/php/8.4/cli/conf.d/10-opcache.ini,
/etc/php/8.4/cli/conf.d/10-pdo.ini,
/etc/php/8.4/cli/conf.d/15-xml.ini,
/etc/php/8.4/cli/conf.d/20-calendar.ini,
/etc/php/8.4/cli/conf.d/20-ctype.ini,
/etc/php/8.4/cli/conf.d/20-curl.ini,
/etc/php/8.4/cli/conf.d/20-dom.ini,
/etc/php/8.4/cli/conf.d/20-exif.ini,
/etc/php/8.4/cli/conf.d/20-ffi.ini,
/etc/php/8.4/cli/conf.d/20-fileinfo.ini,
/etc/php/8.4/cli/conf.d/20-ftp.ini,
/etc/php/8.4/cli/conf.d/20-gettext.ini,
/etc/php/8.4/cli/conf.d/20-iconv.ini,
/etc/php/8.4/cli/conf.d/20-intl.ini,
/etc/php/8.4/cli/conf.d/20-mbstring.ini,
/etc/php/8.4/cli/conf.d/20-mysqli.ini,
/etc/php/8.4/cli/conf.d/20-pdo_mysql.ini,
/etc/php/8.4/cli/conf.d/20-pdo_pgsql.ini,
/etc/php/8.4/cli/conf.d/20-pdo_sqlite.ini,
/etc/php/8.4/cli/conf.d/20-pgsql.ini,
/etc/php/8.4/cli/conf.d/20-phar.ini,
/etc/php/8.4/cli/conf.d/20-posix.ini,
/etc/php/8.4/cli/conf.d/20-readline.ini,
/etc/php/8.4/cli/conf.d/20-shmop.ini,
/etc/php/8.4/cli/conf.d/20-simplexml.ini,
/etc/php/8.4/cli/conf.d/20-sockets.ini,
/etc/php/8.4/cli/conf.d/20-sqlite3.ini,
/etc/php/8.4/cli/conf.d/20-sysvmsg.ini,
/etc/php/8.4/cli/conf.d/20-sysvsem.ini,
/etc/php/8.4/cli/conf.d/20-sysvshm.ini,
/etc/php/8.4/cli/conf.d/20-tokenizer.ini,
/etc/php/8.4/cli/conf.d/20-xdebug.ini,
/etc/php/8.4/cli/conf.d/20-xmlreader.ini,
/etc/php/8.4/cli/conf.d/20-xmlwriter.ini,
/etc/php/8.4/cli/conf.d/20-xsl.ini,
/etc/php/8.4/cli/conf.d/20-zip.ini


Directive => Local Value => Master Value
xdebug.mode => develop => develop
xdebug.start_with_request => default => default
xdebug.start_upon_error => default => default
xdebug.output_dir => /tmp => /tmp
xdebug.use_compression => 1 => 1
xdebug.trigger_value => no value => no value
xdebug.file_link_format => no value => no value
xdebug.filename_format => no value => no value
xdebug.control_socket => off => off
xdebug.log => no value => no value
xdebug.log_level => 7 => 7
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3
xdebug.max_nesting_level => 512 => 512
xdebug.cli_color => 0 => 0
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.halt_level => 0 => 0
xdebug.max_stack_frames => -1 => -1
xdebug.show_error_trace => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.profiler_append => Off => Off
xdebug.cloud_id => no value => no value
xdebug.client_host => localhost => localhost
xdebug.client_port => 9003 => 9003
xdebug.discover_client_host => Off => Off
xdebug.client_discovery_header => HTTP_X_FORWARDED_FOR,REMOTE_ADDR => HTTP_X_FORWARDED_FOR,REMOTE_ADDR
xdebug.idekey => no value => no value
xdebug.connect_timeout_ms => 200 => 200
xdebug.scream => Off => Off
xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_params => On => On
xdebug.collect_return => Off => Off
xdebug_info.txt (5,279 bytes)   

tenzap

2025-03-07 12:34

reporter   ~0007203

By the way it also fais on debian's CI, so my system is not particularly in cause.

tenzap

2025-03-07 12:53

reporter   ~0007204

I found that:

test suite succeeds with
xdebug.mode = debug,coverage

test suite crashes when xdebug.mode is not set, which corresponds to
xdebug.mode = develop

Issue History

Date Modified Username Field Change
2025-03-07 07:34 tenzap New Issue
2025-03-07 07:34 tenzap File Added: valgrind--leak-check=full--show-leak-kinds=all.log.xz
2025-03-07 07:34 tenzap File Added: valgrind--leak-check=full.log.xz
2025-03-07 07:34 tenzap File Added: valgrind.log.gz
2025-03-07 07:36 tenzap Note Added: 0007196
2025-03-07 12:07 derick Assigned To => derick
2025-03-07 12:07 derick Status new => feedback
2025-03-07 12:07 derick Note Added: 0007198
2025-03-07 12:33 tenzap Note Added: 0007202
2025-03-07 12:33 tenzap File Added: xdebug_info.txt
2025-03-07 12:33 tenzap Status feedback => assigned
2025-03-07 12:34 tenzap Note Added: 0007203
2025-03-07 12:53 tenzap Note Added: 0007204