View Issue Details

IDProjectCategoryView StatusLast Update
0001282XdebugUncategorizedpublic2016-03-15 11:40
ReporterProfic Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.4.0 
Fixed in Version2.4.1 
Summary0001282: var_dump() of integers > 32 bit is broken
Description

This is 64 bit Windows, PHP and Xdebug. It seems any integer with more than 32 bit value are truncated to 32 bits in Xdebug's var_dump(). Examlpe uses PHP_INT_MAX but any value outside of 32 bit integer range is affected.

Steps To Reproduce

D:\devel\rgu-bars-forms>php -r "var_dump(PHP_INT_SIZE, PHP_INT_MAX);"
Command line code:1:
int(8)
Command line code:1:
int(-1)

D:\devel\rgu-bars-forms>php -d xdebug.overload_var_dump=0 -r "var_dump(PHP_INT_SIZE, PHP_INT_MAX);"
int(8)
int(9223372036854775807)

Additional Information

D:\devel\rgu-bars-forms>php -v
PHP 7.0.4 (cli) (built: Mar 2 2016 14:42:25) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans

TagsNo tags attached.
Operating SystemWindows 7 x64
PHP Version7.0.0-7.0.4

Relationships

has duplicate 0001332 resolvedderick Int overflow 
has duplicate 0001293 resolvedderick Great integer values ( bigger then 2 ^35 ) are wrong in the debug output, but right in the final php-output 

Activities

derick

2016-03-04 15:46

administrator   ~0003547

I can't easily see what the problem is by looking at the code, so I'm going to have to get back to this once I make it home and have access to Windows again. On Linux, this works "just fine"™.

Profic

2016-03-04 15:59

reporter   ~0003551

I may be wrong, but after quick search line 1031 in xdebug_var.c may be the cause (https://github.com/xdebug/xdebug/blob/master/xdebug_var.c#L1031): on Windows to print long long "%lld" is required.

derick

2016-03-04 16:01

administrator   ~0003553

Sure, but I'd like to test it before committing something like that. And Windows uses some other format specifiers too in places. I'll get to it :-)

derick

2016-03-15 11:40

administrator   ~0003570

Fixed in GitHub for 2.4.1. Thanks for your report!

Issue History

Date Modified Username Field Change
2016-03-04 13:16 Profic New Issue
2016-03-04 15:46 derick Note Added: 0003547
2016-03-04 15:59 Profic Note Added: 0003551
2016-03-04 16:01 derick Note Added: 0003553
2016-03-15 11:40 derick Note Added: 0003570
2016-03-15 11:40 derick Status new => closed
2016-03-15 11:40 derick Assigned To => derick
2016-03-15 11:40 derick Resolution open => fixed
2016-03-15 11:40 derick Fixed in Version => 2.4.1
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-08-01 20:26 derick Relationship added has duplicate 0001332
2016-08-01 20:27 derick Relationship added has duplicate 0001293
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized