bcompiler core dump?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

bcompiler core dump?

Post by mchaggis »

Hi,

I am trying to play with bcompiler, I manage to get it all install after a bit of work, however when I try to execute some code I get a "Segmentation fault (core dumped)"

The class file that I am trying to compile is:

Code: Select all

<?
class test {
        function test() {
                print "This Does Nothing";
        }
}
?>
When I compile is I get:

Code: Select all

[root@web1 examples]# php bcompiler_compile.php class.test.php
WRITING TO class.test.php.phb
PARSE: ./class.test.php
ADDED CLASS: test
Array
(
    [0] => test
)
Compiling test
COMPILE test extends ''
DONE test
Which looks fine to me, but when I try and run the following code:

Code: Select all

<?
dl('bcompiler.so');
bcompiler_load('/root/bcompiler/examples/class.test.php.phb');
?>
It just results in a segmentation fault.... Anyone have any ideas?

Oh, and the output of bcompiler_read.php is:

Code: Select all

load class.test.php.phb
Array
(
    [0] => /root/bcompiler/examples/bcompiler_read.php
)
Array
(
    [0] => stdClass
    [1] => __PHP_Incomplete_Class
    [2] => Directory
    [3] => test
)
Done
The __PHP_Incomplete_Class is probably the only thing that worries me
User avatar
mchaggis
Forum Contributor
Posts: 150
Joined: Mon Mar 24, 2003 10:31 am
Location: UK

Post by mchaggis »

Ok, looks like I have made some progress... After my posting I decided to take a look at what bcompiler_read.php was actually doing, and it turns out that if I use the following code it works:

Code: Select all

<?
dl('bcompiler.so');


$fh = fopen('class.test.php.phb',"r");
bcompiler_read($fh);
fclose($fh);

$test = new test();
?>
Which outputs:

Code: Select all

This does nothing
I'm still intruiged why the bcompiler_load() function seg faults
Post Reply