# static crashes

- Thread: https://externals.io/message/8383
- Original archive: https://news-web.php.net/php.internals/8383
- Started by Christian Stocker on 2004-03-05T16:37:16+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

---

## #8383 — Christian Stocker — 2004-03-05T16:37:16+00:00

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

Hi

The following segfaults on my linux server...

<?php
class bla {
     static $instance = null;
     static function getInstance() {}
}
$n = bla::getInstance();
?>

if you comment out the "static $instance" line, it works...

fresh HEAD checkout 15 minutes ago..

strangely enough, this works on OSX...

backtrace can be found here -> http://trash.chregu.tv/bt.txt

chregu


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  chregu@bitflux.ch  |  gnupg-keyid 0x5CE1DECB

---

## #8385 — Andi Gutmans — 2004-03-05T17:12:02+00:00

URL: https://externals.io/message/8383#8385 · In reply to: #8383

Can't reproduce this.

At 05:37 PM 3/5/2004 +0100, Christian Stocker wrote:
>Hi
>
>The following segfaults on my linux server...
>
><?php
>class bla {
>     static $instance = null;
>     static function getInstance() {}
>}
>$n = bla::getInstance();
>?>
>
>if you comment out the "static $instance" line, it works...
>
>fresh HEAD checkout 15 minutes ago..
>
>strangely enough, this works on OSX...
>
>backtrace can be found here -> http://trash.chregu.tv/bt.txt
>
>chregu
>
>
>--
>christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
>phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
>http://www.bitflux.ch  |  chregu@bitflux.ch  |  gnupg-keyid 0x5CE1DECB

---

## #8386 — Andi Gutmans — 2004-03-05T17:18:09+00:00

URL: https://externals.io/message/8383#8386 · In reply to: #8383

I actually couldn't reproduce the crash with your script but I found 
problems with my patch using valgrind.
Commit coming up in a second.
Let me know if it solves your problem.
Thanks for the short reproducing script.
Andi

At 07:12 PM 3/5/2004 +0200, Andi Gutmans wrote:
>Can't reproduce this.
>
>At 05:37 PM 3/5/2004 +0100, Christian Stocker wrote:
> > […]

---

## #8389 — Pierre-Alain Joye — 2004-03-05T18:15:16+00:00

URL: https://externals.io/message/8383#8389 · In reply to: #8386

On Fri, 05 Mar 2004 19:18:09 +0200
andi@zend.com (Andi Gutmans) wrote:

> I actually couldn't reproduce the crash with your script but I
> found problems with my patch using valgrind.
> Commit coming up in a second.
> Let me know if it solves your problem.
> Thanks for the short reproducing script.

Fixed, here and christian's host.

thanks,

pierre

---

## #8392 — Christian Stocker — 2004-03-05T18:29:54+00:00

URL: https://externals.io/message/8383#8392 · In reply to: #8386

> I actually couldn't reproduce the crash with your script but I found 
> problems with my patch using valgrind.
> Commit coming up in a second.
> Let me know if it solves your problem.

as pierre already said, it works again on my server

thanks for the quick fix

chregu

> Thanks for the short reproducing script.
> Andi
> 
> At 07:12 PM 3/5/2004 +0200, Andi Gutmans wrote:
> 
> > […]
> 
> 

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  chregu@bitflux.ch  |  gnupg-keyid 0x5CE1DECB
