|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57622 BCompiler warning when including empty file
Submitted: 2007-04-16 07:17 UTC Modified: 2007-04-22 15:54 UTC
From: kepi at igloonet dot cz Assigned: val (profile)
Status: Closed Package: bcompiler (PECL)
PHP Version: 5.2.1 OS: Debian GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kepi at igloonet dot cz
New email:
PHP Version: OS:


 [2007-04-16 07:17 UTC] kepi at igloonet dot cz
If I'm including empty file in any php script (even if it is not bcompiled) I receive warning:

PHP Warning:  bcompiler: Bad bytecode file format at 00000000 in file.php on line 1

Thanks for any help, we need to correct this bug on bcompiler side, cause we are hosting company, so make file nonempty is not good solution for us.

Reproduce code:
<?php include ""; ?>

Expected result:
no error

Actual result:
PHP Warning:  bcompiler: Bad bytecode file format at 00000000 in file.php on line 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-22 15:54 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

Fixed in CVS (bcompiler.c version 1.110)

I also put the patch to fix this bug below:
--- bcompiler.c.1       Sun Apr 22 22:21:16 2007
+++ bcompiler.c Sun Apr 22 22:25:20 2007
@@ -2081,7 +2081,12 @@
        int len = 0;
        unsigned int hi, lo;

-       DESERIALIZE_SCALAR_V(&len, int, -1);
+       /* do not use macros because of empty file problem (bug #10742) */
+       /* DESERIALIZE_SCALAR_V(&len, int, -1); */
+       {
+               size_t act = php_stream_read(BCOMPILERG(stream), &len, BCOMPILERG(bcompiler_stdsize)[BCSI_int]);
+               if (act != BCOMPILERG(bcompiler_stdsize)[BCSI_int]) return -1;
+       }
        /* just a sanity check */
        if (len <= 0 || len > 0x20) {
                return -1;
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 25 18:01:32 2024 UTC