kint-php / kint

Kint - Advanced PHP dumper
https://kint-php.github.io/kint/
MIT License
2.78k stars 291 forks source link

Kint modifying internal variables... fatal error #246

Closed SrikalyanBurra closed 7 years ago

SrikalyanBurra commented 7 years ago

I am using Kint by simply including the mentioned file in my project. A mere Kint::trace() call is conditionally causing serious issues. In some cases its working fine but in certain places(like the one mentioned below) it is modifying my internal variable.

del

If I just remove the trace, its working fine. Originally that variable is an array, but after calling d(1) the variable became 'Kint_Object_Instance'. this is quite surprising. Any help is greatly appreciated

cheers!!

jnvsor commented 7 years ago

That's really scary and I want to find out what's causing it. That said, I can't find the word "global" anywhere in the kint source code. It could perhaps be that the debug backtrace arguments are being altered during parse (Again, really scary)

  1. Can you make a reduced test case?
  2. Can you send me a var_dump or var_export of the effected variable before and after the trace?
  3. Can you send me a debug_backtrace(true) from just before and after the trace?
  4. Can you try disabling certain Kint plugins and see if it's reproducible? (Ideally if it's reproducible with Kint::$plugins = ['Kint_Parser_Trace'] that narrows it down a lot)
jnvsor commented 7 years ago

@SrikalyanBurra Please tell me what type of variable it was and which combination of plugins is required for it to trigger - remove as many plugins as possible from the Kint::$plugins array while still reproducing the bug and tell me what's in the array

jnvsor commented 7 years ago

A bit of doxing led me to the file in question - thanks for the bug report! It's fixed in the latest release (2.1.1) and I highly advise all Kint users to upgrade at their earliest convenience.

SrikalyanBurra commented 7 years ago

@jnvsor sorry for late response, I was away for a while. The update is working fine, please tell me if u still need the reduced test case.

jnvsor commented 7 years ago

No problem - I was able to find out through your github and screenshot where you were dumping code so once I cloned it and dumped it I was able to reproduce it and fix it