Hi there....the following code causes the following to happen:  And I have no 
idea why [grin].  I'm assuming something in my requires and such is balking 
out, but what?

Program received signal SIGSEGV, Segmentation fault.
0x80a2605 in ap_table_get ()
(gdb) backtrace
#0  0x80a2605 in ap_table_get ()
#1  0x808961e in XS_Apache__Table_FETCH ()
#2  0x812727b in Perl_pp_entersub ()
#3  0x81218d3 in Perl_runops_debug ()
#4  0x80e4302 in Perl_call_sv ()
#5  0x80e406e in Perl_call_sv ()
#6  0x806617a in perl_call_handler ()
#7  0x8065833 in perl_run_stacked_handlers ()
#8  0x8063a28 in perl_handler ()
#9  0x80a688d in ap_invoke_handler ()
#10 0x80ba8e8 in ap_some_auth_required ()
#11 0x80ba952 in ap_process_request ()
#12 0x80b1bc3 in ap_child_terminate ()
#13 0x80b1d81 in ap_child_terminate ()
#14 0x80b1efa in ap_child_terminate ()
#15 0x80b2508 in ap_child_terminate ()
#16 0x80b2d20 in main ()
#17 0x80620f5 in _start ()    

(NOTE: WebAPI is a wrapper to Apache::Request and Apache::Cookie)
(it segfaults with all types ofmodule and screen parameters, valid and 
invalid)

#!/usr/bin/perl -w

use Magrathea::WebTemplate;
use Magrathea::WebAPI;


my $api = Magrathea::WebAPI->new();
my $tmpl = Magrathea::WebTemplate->new();

my $mod = $api->getparam('module');
if (!$mod) { $mod = 'start'; }
my $scr = $api->getparam('screen');
if (!$scr) { $scr = 'start'; }
my $modd = "Magrathea::Web::".$mod;
eval "package Magrathea::_firesafe; require $modd ";
my $obj = eval { $modd->new() };
if (!$obj) {
    $api->canned_html;
    
    print "<html><head><title>ND</title></head><body><p>No driver for 
<i>$mod</i>!</body></html>\n";
    die "No driver.  I can't do anything about that. Sorry";
}

$obj->webaction($scr);

(and just for completness, here is the WebAPI loader, modelled on DBI)


package Magrathea::WebAPI;


use Carp;
use Magrathea::MyConfig;

# Simple module...simple stuff

my $driver;    

sub new {
    my $self = {};
    bless $self;
    my $cfg = Magrathea::MyConfig->new();
    if (!$driver) {
        my $mod = "Magrathea::WebAPI::".$cfg->webapi;
        eval "package Magrathea::_firesafe; require $mod ";
        $driver = eval { $mod->driver() };
        if (!$driver) {
            print "No driver!\n";
            die "Ouch...\n";
        }
    }
    return $driver;

}


-- 

--------------------------------------------------------------------
Yann Ramin                      [EMAIL PROTECTED]
Atrus Trivalie Productions      www.redshift.com/~yramin
Monterey High IT                www.montereyhigh.com
AIM                             oddatrus
Marina, CA

IRM Developer                   Network Toaster Developer
SNTS Developer                  KLevel Developer
--------------------------------------------------------------------








Reply via email to