Forum Bugs

Mercury runtime: caught bus error *** on Mac with php

mklarmann
I have been working on MAMP and everything worked well with prince.
MAMP uses:
Apache 2.0.59
MySQL 5.0.41
PHP 5.2.6

Now I switched to Leopards native apache installation and I am catching the error:

Mercury runtime: caught bus error ***
e: non-existent physical address
ess involved: 0x0
may have been caused by a stack overflow, due to unbounded recursion.
ing from signal handler


i am running the simplest form of php code:
<?php
                                include 'prince.php';
                                $prince = new Prince('/usr/local/bin/prince');
                                $webdata = 'http //www advancedaquarist com/  ##change this###';
                                $outputfile = 'test.pdf';
                                $return = $prince->convert_file_to_file($webdata,  $outputfile ,$msg);
                                print_r ( $msg );
                                ?>




as it may be of interest:
apache -V


Server version: Apache/2.2.11 (Unix)
Server built:   Feb  3 2009 01:54:45
Server's Module Magic Number: 20051115:21
Server loaded:  APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128


and PHP Version 5.2.9:
entropy Release 7

so, is this error known?
is it due to apache or php?


cheers
manuel

Additional note: Somehow without changing anything it works with the simple php-example above but not with the procedure i actually use.
mikeday
If you get this error when running under Apache but not when you run Prince from the command-line with the exact same input document then I would suspect that perhaps Apache is setting a different path for shared libraries or something similar that is causing Prince problems. Does the test document you are using contain images?

These two forum threads here and here have some tips on debugging problems with MAMP on MacOS X.
mklarmann
thanks a lot for your reply.
The Forum threads you refer to, are really important to get prince running on MAMP. So far this was already known to me.

I had trouble running prince in the native apache environment of Leopard.

As magically as the error dissapeared for my sample script, it did for my routine.

I am having no more trouble running prince, but everything leaves me behind with this suspicious feeling, not knowing what was the cause.

Yes, my document contained images which are automatically generated via: http://code.google.com/apis/chart/
for the script i used the homepage ( containing images ) refered in the script.

I am sorry, that i can't provide any usefull informations to reproduce the error, as it is working for now, and i don't know what changed.
jim_albright
Possibly a reboot?

Jim Albright
Wycliffe Bible Translators

mklarmann
restarting didn't help...
and some how the error appeared again...
mikeday
Perhaps try the new beta version of Prince 7.0? Also, is there anything you can do that makes the error go away? For example, trying to convert a simpler (or even empty) input document? Or disabling images? If you can find something that triggers the error it will be easier to figure out what kind of interaction is causing it.
mklarmann
i really want to isolate the error. But i have no idea how.

I am actually using Prince 7.0 beta 1 now.

When i go back to Prince 6.0 rev 8 everything is fine and working again!

but when using the command-line both work flawless.
mikeday
Is there a mailing list or forum dedicated to this particular Apache variant? It seems we will need to take it up with the developers in order to track down this issue. Are you able to try running Prince under gdb and see if that gives a hint in the backtrace as to where the error is occurring?