Edit report at http://bugs.php.net/bug.php?id=51868&edit=1

 ID:               51868
 User updated by:  frame at mudox dot de
 Reported by:      frame at mudox dot de
-Summary:          PHP should crash or abort  instead wrong messages
                   appear
+Summary:          Possible memleak detected
-Status:           Open
+Status:           Closed
 Type:             Bug
 Package:          Class/Object related
 Operating System: Windows x32/Unix x64
 PHP Version:      Irrelevant

 New Comment:

I noticed, that previous comment isn't liked to that "bug" - Because the
constructer called a method which takes a log and call __toString() on
the object. As the construct isn't finished the value isn't there.



But this doesn't explain why PHP doesn't find hardcoded Class-Definition
at runtime, see post #1. If something went wrong with my code than PHP
should give a warning if it detects such things?

"in line 0" clearly says that PHP doesn't know whats going on here
because there is no stack. Why isn't?



I think the method is called again in a throwed exception. Therefore
line 0. But this behaviour is not the best one...


Previous Comments:
------------------------------------------------------------------------
[2010-05-30 05:23:21] frame at mudox dot de

http://bugs.php.net/how-to-report.php -> useless!



PHP isn't crashing or something. PHP just outputs an error message where
no error is...



A simple example:



I get a "must not throw within __toString()"-Error in line 0

because a NULL-Value is supplied to a function where a integer is
expected. Fine.



This is the stack:



#0  mdx_driver->getInfo() called at ...

#1  mdx_driver->__toString() called at ....

#2  mdx_driver->__construct(mdx_error_handler, 10000000, Array ())
called at ...

...



This value is hold on class construct:



public function __construct($intern_name, $version, $config = array())
{

    $this->_config = $config;

    $this->_private = $config;

    $this->_version = $version;

    $this->_intern_name = $intern_name;

}



Before getInfo() is called, I put a 

var_dump($this->_version);



And I get: NULL!!! But you can see, on construct $version is 1000000!



See the stack. There is not other method changing the value from
$_version. The value will change in NULL. 



Other observations:



The $_version is declared and I get this error.

If $_version is generated by runtime, I get no error from this var.
Instead, the

next declared class variable will "recognized" as Null.



That I know: The error isn't specific. It can happening whereever the
situation is suitable and gives "not exists" or wrong-value-messages.



The error is a result of object-recursion and callbacks. When the call
will turn into a loop. PHP should crash or abort through canceling
call-loop at time limit. Instead various wrong error messages occur.

------------------------------------------------------------------------------



Anyway. It's there. If you like to get my files to see with own eyes, I
will do.



I would say it is a memleak. Caused by my code so there is my bug but
that shouldn't be possible and somebody could use it.

------------------------------------------------------------------------
[2010-05-20 11:43:27] m...@php.net

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.




------------------------------------------------------------------------
[2010-05-20 09:36:27] frame at mudox dot de

Description:
------------
Unfortanley, I cannot reproduce the code (expect I can send you the
files) so I can just describe whats going on:



I have registered a loader for some classes. These classes are container
for holding further classes of the same type. A simple tree structure.



Last I changed some static function in the class and wrote instead of
the self-keyword the classname, which also should work.



e.g.:

self::myfunction() to myclass::myfunction()



But the result was depending on script line and method after executing
the 

affected class method:



"class not found in line 0" or (the same class was loaded few line
before without problems)

"undefined class constant xzy in line 0" (which was actually defined)



Changing the classname-word to self has solved the problem.



I have testing the script on Windows 5.3.0 and Unix 5.2.6 with the same
result.



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51868&edit=1

Reply via email to