Re: Debugging custom streams
| From: | Jochem Maas | Date: | Fri, 10 Feb 2006 14:53:13 +0000 |
| Subject: | Re: Debugging custom streams | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-230204@lists.php.net to get a copy of this message | ||
Jared Williams wrote:
why not let your zip class keep a list of opened streams (I can't imagine that it's not doing that already) and write a function which will output a list of 'registered' stream resources that are still open [mis]using ftell() or feof() to check which streams are still 'active'.-----Original Message----- From: Jochem Maas [mailto:jochem@iamjochem.com] Sent: 10 February 2006 14:17 To: Jared.Williams@ntlworld.com Cc: php-general@lists.php.net Subject: Re: [PHP] Debugging custom streams Jared Williams wrote:Hi, Short version, is there any way of listing all openresources fromwithin a PHP script? Think I may have a problem relating tothe object/resource shutdown order within PHP, but cant see which custom stream handler still has an open resource.
...
was worth a guess :-)I don't suppose that your closing a stream twice? [ once with fclose() and one inside $zip->close() ]$zip->close() doesn't (yet) ensure that internal streams are closed. So don't think it can be that.
I have the same thing occur on windows machines with some setups (running certain code) - and the same situation where the code seems to work regardless of the error. I would suspect that it's an internal 'bug' and that there is nothing you can do at the php level to fix it (at least there is nothing you should need to do - made there _is_ actually something you can do at the php level). have you tried running the code on a linux machine? (maybe using strace or gdb) - personally I only use windows for preliminary development, all production machines are linux (and the odd errors/exceptions that popup in windows never seem to have a corresponding problem in linux)--------------------------- php.exe - Application Error --------------------------- The instruction at "0x100ac22f" referenced memory at "0x0000004c". The memory could not be "read". Click on OK to terminate the program Click on CANCEL to debug the program --------------------------- OK Cancel ---------------------------unset($zip); I get an application exception on PHP shutdown, thoughthe zip file is valid with 2 files. what exactly is the exception?