# Exception segfault

- Thread: https://externals.io/message/39963
- Original archive: https://news-web.php.net/php.internals/39963
- Started by Lupus Michaelis on 2008-08-14T18:42:23+00:00
- Messages: 5
- 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

---

## #39963 — Lupus Michaelis — 2008-08-14T18:42:23+00:00

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

Hi,

   At first time, it was a bug in the useful xdebug, and I follow it to 
the PHP code <http://bugs.xdebug.org/bug_view_page.php?bug_id=0000340>.

   When exception::$message, exception::$line are not of the initial 
type, it segfaults (for strings) or display non-predictible data. The 
next snipset for test :

<?php

class my_file
{
         public  function __toString()
         {
                 return "somebuildfilename" ;
         }
}

class my_exception extends exception
{
         public  function __construct()
         {
                 $this->message = new stdclass ;
                 $this->file = new my_file ;
                 $this->line = "12" ;
         }
}

throw new my_exception ;

?>

   I attach a patch that correct the segfault. Diff was produced with 
this line : diff php5.3-200808141030{,-lupus}/Zend/zend_exceptions.c

   Regards, Mickaël.
-- 
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org

---

## #39964 — Marcus Boerger — 2008-08-14T19:17:34+00:00

URL: https://externals.io/message/39963#39964 · In reply to: #39963

Hello Lupus,

Thursday, August 14, 2008, 8:42:23 PM, you wrote:

>    Hi,

>    At first time, it was a bug in the useful xdebug, and I follow it to 
> the PHP code <http://bugs.xdebug.org/bug_view_page.php?bug_id=0000340>.

>    When exception::$message, exception::$line are not of the initial 
> type, it segfaults (for strings) or display non-predictible data. The 
> next snipset for test :

> <?php

> class my_file
> {
>          public  function __toString()
>          {
>                  return "somebuildfilename" ;
>          }
> }

> class my_exception extends exception
> {
>          public  function __construct()
>          {
>                  $this->message = new stdclass ;
>                  $this->file = new my_file ;
>                  $this->line = "12" ;
>          }
> }

> throw new my_exception ;

?>>

>    I attach a patch that correct the segfault. Diff was produced with 
> this line : diff php5.3-200808141030{,-lupus}/Zend/zend_exceptions.c

Thanks for letting us know. Can you provide the diff using 'cvs di -uwp'.

Best regards,
 Marcus

---

## #39965 — Marcus Boerger — 2008-08-14T19:18:55+00:00

URL: https://externals.io/message/39963#39965 · In reply to: #39964

Hello Marcus,

Thursday, August 14, 2008, 9:17:34 PM, you wrote:

> Hello Lupus,

> Thursday, August 14, 2008, 8:42:23 PM, you wrote:

> > […]

> > […]

> > […]

> > […]

> > […]

> > […]

> > […]

?>>>

> > […]

> Thanks for letting us know. Can you provide the diff using 'cvs di -uwp'.

Well, Felipe was much faster than I. He applied your patch already. Thanks
again a lot.



Best regards,
 Marcus

---

## #39966 — Felipe Pena — 2008-08-14T19:25:21+00:00

URL: https://externals.io/message/39963#39966 · In reply to: #39965

Em Qui, 2008-08-14 às 21:18 +0200, Marcus Boerger escreveu:
> Hello Marcus,
> 
> Thursday, August 14, 2008, 9:17:34 PM, you wrote:
> 
> > […]
> 
> > […]
> 
> > […]
> 
> > […]
> 
> > […]
> 
> > […]
> 
> > […]
> 
> > […]
> 
> > […]
> 
> ?>>>
> 
> > […]
> 
> > […]
> 
> Well, Felipe was much faster than I. He applied your patch already. Thanks
> again a lot.
> 
> 

Hello, 

I don't applied your patch, because I can reproduce it only in HEAD,
then I added the convert_* that are missing in HEAD in same place where
they are found in 5_3.

-- 
Regards,
Felipe Pena.

---

## #39967 — Lupus Michaelis — 2008-08-14T19:58:14+00:00

URL: https://externals.io/message/39963#39967 · In reply to: #39964

Marcus Boerger a écrit :

> Thanks for letting us know. Can you provide the diff using 'cvs di -uwp'.

   I'll do it in the future. Sorry for the inconvenient, I didn't found 
what you're waiting for. So, I did a simple diff :)

   Thanks to you and Felipe.

-- 
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
