This is my xs file. it's 100% generated by Apache::Extutils.

Anthony

--- quote ----

#include "modules/perl/mod_perl.h"

static mod_perl_perl_dir_config *newPerlConfig(pool *p)
{
    mod_perl_perl_dir_config *cld =
        (mod_perl_perl_dir_config *)
            palloc(p, sizeof (mod_perl_perl_dir_config));
    cld->obj = Nullsv;
    cld->pclass = "Apache::AuthCAS";
    register_cleanup(p, cld, perl_perl_cmd_cleanup, null_cleanup);
    return cld;
}

static void *create_dir_config_sv (pool *p, char *dirname)
{
    return newPerlConfig(p);
}

static void *create_srv_config_sv (pool *p, server_rec *s)
{
    return newPerlConfig(p);
}

static void stash_mod_pointer (char *class, void *ptr)
{
    SV *sv = newSV(0);
    sv_setref_pv(sv, NULL, (void*)ptr);
    hv_store(perl_get_hv("Apache::XS_ModuleConfig",TRUE),
             class, strlen(class), sv, FALSE);
}

static mod_perl_cmd_info cmd_info_CASServerName = {
"Apache::AuthCAS::CASServerName", "",
};
static mod_perl_cmd_info cmd_info_CASServerPath = {
"Apache::AuthCAS::CASServerPath", "",
};
static mod_perl_cmd_info cmd_info_CASServerPort = {
"Apache::AuthCAS::CASServerPort", "",
};
static mod_perl_cmd_info cmd_info_CASCaFile = {
"Apache::AuthCAS::CASCaFile", "",
};


static command_rec mod_cmds[] = {


    { "CASServerName", perl_cmd_perl_TAKE1,
      (void*)&cmd_info_CASServerName,
      OR_AUTHCFG, TAKE1, "URL of the CAS server" },

    { "CASServerPath", perl_cmd_perl_TAKE1,
      (void*)&cmd_info_CASServerPath,
      OR_AUTHCFG, TAKE1, "Path on CAS on the server (default is /)" },

{ "CASServerPort", perl_cmd_perl_TAKE1,
(void*)&cmd_info_CASServerPort,
OR_AUTHCFG, TAKE1, "Port the CAS server is listenning on (default is 443)" },


    { "CASCaFile", perl_cmd_perl_TAKE1,
      (void*)&cmd_info_CASCaFile,
      OR_AUTHCFG, TAKE1, "Location of the CAS server public key" },

    { NULL }
};

module MODULE_VAR_EXPORT XS_Apache__AuthCAS = {
    STANDARD_MODULE_STUFF,
    NULL,               /* module initializer */
    create_dir_config_sv,  /* per-directory config creator */
    NULL,   /* dir config merger */
    create_srv_config_sv,       /* server config creator */
    NULL,        /* server config merger */
    mod_cmds,               /* command table */
    NULL,           /* [7] list of handlers */
    NULL,  /* [2] filename-to-URI translation */
    NULL,      /* [5] check/validate user_id */
    NULL,       /* [6] check user_id is valid *here* */
    NULL,     /* [4] check access by host address */
    NULL,       /* [7] MIME type checker/setter */
    NULL,        /* [8] fixups */
    NULL,             /* [10] logger */
    NULL,      /* [3] header parser */
    NULL,         /* process initializer */
    NULL,         /* process exit/cleanup */
    NULL,   /* [1] post read_request handling */
};

#define this_module "Apache/AuthCAS.pm"

static void remove_module_cleanup(void *data)
{
    if (find_linked_module("Apache::AuthCAS")) {
        /* need to remove the module so module index is reset */
        remove_module(&XS_Apache__AuthCAS);
    }
    if (data) {
        /* make sure BOOT section is re-run on restarts */
        (void)hv_delete(GvHV(incgv), this_module,
                        strlen(this_module), G_DISCARD);
         if (dowarn) {
             /* avoid subroutine redefined warnings */
             perl_clear_symtab(gv_stashpv("Apache::AuthCAS", FALSE));
         }
    }
}

MODULE = Apache::AuthCAS PACKAGE = Apache::AuthCAS

PROTOTYPES: DISABLE

BOOT:
    XS_Apache__AuthCAS.name = "Apache::AuthCAS";
    add_module(&XS_Apache__AuthCAS);
    stash_mod_pointer("Apache::AuthCAS", &XS_Apache__AuthCAS);
    register_cleanup(perl_get_startup_pool(), (void *)1,
                     remove_module_cleanup, null_cleanup);

void
END()

    CODE:
    remove_module_cleanup(NULL);

---- quote ----


Stas Bekman wrote:


Anthony Hinsinger wrote:

i restarted a gdb session so *sv has changed (backtrace is exactly the same as in previous post)


That's normal.

(gdb) p *sv
$2 = (SV *) 0x2d656863
(gdb) p **sv
Cannot access memory at address 0x2d656863
(gdb)


So *sv is bogus. That means that data->obj is bogus in:

#2  0x0807c99b in perl_cmd_perl_TAKE1 (cmd=0xbffffa10, data=0xbffffa10,
    one=0xbffffa10 "[EMAIL PROTECTED]") at perl_config.c:859

invoked by

#3  0x080b9fe9 in invoke_cmd (cmd=0x4001bc80, parms=0xbffffa10,
    mconfig=0x888fdb4, args=0xbfffd9e3 "") at http_config.c:828

You can test, by going to frame #2

gdb> up
gdb> up
gdb> p data->obj
gdb> p *data->obj

So most likely something is wrong with your XS code that creates the new directive. Show us the XS code.



--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to