DocJon has asked for the wisdom of the Perl Monks concerning the following question:

I recently upgraded my servier from Fedora Core 2 to Fedora Core 4, and thus the new versions of Apache, mod_perl, and ASP as well. This seems to have broken one of my Perl modules (MdbSQL) that relies on an XS interface to the mdbtools libraries to enable me to read MDB files on my Linux machine.

I can make use of the module from console applications, so I know that MdbSQL.pm and MdbSQL.so files have been generated properly on the new system. From within an ASP page, a call to MdbSQL::new results in no response from the server (request not logged into the access log and no error listed in the error log). If I go into MdbSQL::new and comment out the call to the XS routine then the page loads fine (doesn't work as it is missing the meat of the module, but will at least load and get logged as a request).

So my guess from this result is that the ASP module is not properly loading the MdbSQL.so file. Was there a change in ASP with how the shared libraries for XS modules are loaded? Perhaps a path variable that has not been properly set on my new machine? Any other suggestions on what to look at as a possible cause of this behavior?

Thanks for your help,
DocJon

Update

Note in my reply to a reply that the problem was eventually tracked down to a mis-cast pointer variable in the XS file.

Replies are listed 'Best First'.
Re: XS module on Apache ASP
by Joost (Canon) on Nov 26, 2005 at 04:23 UTC
      I first thought it might be a permission error, but it worked from the console prompt (and all the permissions looked good).

      Finally managed this morning to track down what the problem really was ... the framework I'd originally copied for my XS file had (unfortunately) cast the C structure pointer to an integer to pass back to Perl. This worked on my old 32-bit machine, and somehow even managed to work from the command line on the current 64-bit machine, but caused a Segmentation Fault in Apache when trying to run under mod_perl.

      Was able, using the XS documentation along with an XS tutorial by Steven McDougall, to change my XS file to pass the pointer as a pointer rather than an integer. This seems to be working much better now, with everybody happy.

      Thanks for the suggestions.

      DocJon