# UNKNOW:0, what is it?

- Thread: https://externals.io/message/67888
- Original archive: https://news-web.php.net/php.internals/67888
- Started by Ivan Enderlin @ Hoa on 2013-06-26T16:05:32+00:00
- Messages: 10
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #67888 — Ivan Enderlin @ Hoa — 2013-06-26T16:05:32+00:00

URL: https://externals.io/message/67888#67888

Hello,

Again, I have a segfault with RecursiveDirectoryIterator when I extend 
it. This time, I have a very strange value on my SplFileInfo extension 
(subclass). When I var_dump the value, I have UNKNOWN:0. This is not a 
string, not null, not false, just UNKNOW:0, without type. Any idea of 
what is it?

Thanks :-).

-- 
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/

PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/

Member of HTML and WebApps Working Group of W3C
http://w3.org/

---

## #67891 — johannes@schlueters.de — 2013-06-26T16:19:24+00:00

URL: https://externals.io/message/67888#67891 · In reply to: #67888

> Hello,
> 
> Again, I have a segfault with RecursiveDirectoryIterator when I extend 
> it. This time, I have a very strange value on my SplFileInfo extension 
> (subclass). When I var_dump the value, I have UNKNOWN:0. This is not a 
> string, not null, not false, just UNKNOW:0, without type. Any idea of 
> what is it?
> 
> Thanks :-).

Unknown is an unknown value in a structure when a zval is not properly
set. Most likely you didn't call the parent's constructor.

johannes

---

## #67892 — Ivan Enderlin @ Hoa — 2013-06-26T16:21:37+00:00

URL: https://externals.io/message/67888#67892 · In reply to: #67891

> 
> > […]
> Unknown is an unknown value in a structure when a zval is not properly
> set. Most likely you didn't call the parent's constructor.
To bad, the constructor has been called :-(.
The error is here: 
https://github.com/hoaproject/Iterator/blob/master/Recursive/Directory.php#L125. 
This is a line that causes the segfault. And at line 109, 
$this->getRelativePath() returns UNKNOWN:0. But if I var_dump 
$this->_relativePath directly (without using the method), I have a real 
value. I can't explain this.

-- 
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/

PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/

Member of HTML and WebApps Working Group of W3C
http://w3.org/

---

## #67898 — johannes@schlueters.de — 2013-06-26T16:30:51+00:00

URL: https://externals.io/message/67888#67898 · In reply to: #67892

> 
> > […]
> To bad, the constructor has been called :-(.
> The error is here: 
> https://github.com/hoaproject/Iterator/blob/master/Recursive/Directory.php#L125. 
> This is a line that causes the segfault. And at line 109, 
> $this->getRelativePath() returns UNKNOWN:0. But if I var_dump 
> $this->_relativePath directly (without using the method), I have a real 
> value. I can't explain this.

Try calling the parent ctor before doing anything with properties (i.e.
setting _splFileInfoClass)

If it doesn't fit please provide a complete reproduce script (and report
a bug in any case)

johannes

---

## #67899 — Stas Malyshev — 2013-06-26T16:31:13+00:00

URL: https://externals.io/message/67888#67899 · In reply to: #67888

Hi!

> Again, I have a segfault with RecursiveDirectoryIterator when I extend 
> it. This time, I have a very strange value on my SplFileInfo extension 
> (subclass). When I var_dump the value, I have UNKNOWN:0. This is not a 
> string, not null, not false, just UNKNOW:0, without type. Any idea of 
> what is it?

Most likely it is a bug, unless you did something wrong. I'd suggest
submitting bug report with reproducing code.
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

---

## #67901 — Ivan Enderlin @ Hoa — 2013-06-26T16:47:13+00:00

URL: https://externals.io/message/67888#67901 · In reply to: #67898

> 
> > […]
> Try calling the parent ctor before doing anything with properties (i.e.
> setting _splFileInfoClass)
>
> If it doesn't fit please provide a complete reproduce script (and report
> a bug in any case)
https://bugs.php.net/65136 here we are :-).

-- 
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/

PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/

Member of HTML and WebApps Working Group of W3C
http://w3.org/

---

## #67918 — Laruence — 2013-06-27T04:40:03+00:00

URL: https://externals.io/message/67888#67918 · In reply to: #67901

On Thu, Jun 27, 2013 at 12:47 AM, Ivan Enderlin @ Hoa
<ivan.enderlin@hoa-project.net> wrote:
>
> 
> > […]
>
> https://bugs.php.net/65136 here we are :-).
thanks for the report, fixed in
https://github.com/php/php-src/commit/fa8611c81ee72839cdff3e72b18cc586feb4aa29

thanks
>
>
> --
> Ivan Enderlin
> Developer of Hoa
> http://hoa-project.net/
>
> PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
> http://disc.univ-fcomte.fr/ and http://www.inria.fr/
>
> Member of HTML and WebApps Working Group of W3C
> http://w3.org/
>
>
>
> --
> 
> 
>



--
Laruence  Xinchen Hui
http://www.laruence.com/

---

## #67930 — Ivan Enderlin @ Hoa — 2013-06-27T09:31:40+00:00

URL: https://externals.io/message/67888#67930 · In reply to: #67918

>
> thanks for the report, fixed in
> https://github.com/php/php-src/commit/fa8611c81ee72839cdff3e72b18cc586feb4aa29
>
> thanks
Thank you!
But it seems that it is a regression because I didn't have this bug before.
How can I fix this in my code? Any idea?

Cheers.

-- 
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/

PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/

Member of HTML and WebApps Working Group of W3C
http://w3.org/

---

## #67932 — Julien Pauli — 2013-06-27T10:15:46+00:00

URL: https://externals.io/message/67888#67932 · In reply to: #67930

On Thu, Jun 27, 2013 at 11:31 AM, Ivan Enderlin @ Hoa <
ivan.enderlin@hoa-project.net> wrote:

>
> 
>
> > […]
> Thank you!
> But it seems that it is a regression because I didn't have this bug before.
> How can I fix this in my code? Any idea?
>

What do you mean ?
You may have this in your code since long time, but not the exact scenario
that triggers it.
The patch let me think this bug has always been here (use of stack based
pointer after the stack has been cleaned), simply noone did hit it before.

Julien

---

## #67962 — Laruence — 2013-06-27T15:44:49+00:00

URL: https://externals.io/message/67888#67962 · In reply to: #67932

> On Thu, Jun 27, 2013 at 11:31 AM, Ivan Enderlin @ Hoa
> <ivan.enderlin@hoa-project.net> wrote:
> > […]
>
>
> What do you mean ?
yes, I was confused too :)

thanks
> You may have this in your code since long time, but not the exact scenario
> that triggers it.
> The patch let me think this bug has always been here (use of stack based
> pointer after the stack has been cleaned), simply noone did hit it before.
>
> Julien



--
Laruence  Xinchen Hui
http://www.laruence.com/
