niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Berkeley DB
mod_perl problem - seg fault 11
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Rick Jansen
*nix forums beginner


Joined: 21 Jul 2005
Posts: 2

PostPosted: Tue Apr 12, 2005 7:52 pm    Post subject: mod_perl problem - seg fault 11 Reply with quote

I'm converting an existing CGI-script that uses Berkely DB with CDB to a
mod_perl version, and I'm running into a problem. The first run works
fine, but the second hit causes a "child pid ... exit signal
Segmentation fault (11)" in the following line, UNLESS I close the
environment after each run, and re-open it for the next run. Alas, this
causes overhead that I'd rather get rid of:

sub Something {

# crashes:
my $DB_Object = new BerkeleyDB::Hash
-Filename => $DB,
-Env => $Env,
-Flags => DB_RDONLY ...
}

To avoid name collisions the application is split in a main program
calling a run-routine from a separate module, as follows:

use strict;
use Appl::ApplMain;

Appl::ApplMain::run();


This is the separate module Appl/ApplMain.pm:

package Appl::ApplMain;

my $Env = new BerkeleyDB::Env ....

sub run {
<open env if not open>
<processing>
<*close env*>
}

1;

If I leave out the <close env> the app gets killed on the second run, if
I close the environments it runs fine.

Interestingly, if I don't put the run-subroutine in a separate module,
but in a *library* that is require-d in the main program, no crash
happens, but this has other implications for name space collisions.

What am I missing? Thanks!
--
Rick Jansen
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 2:38 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Unknown in header problem -SOLVED- Light Speed Postfix 0 Thu Jul 03, 2008 10:40 am
No new posts problem with sending mail nuxia Postfix 0 Mon Apr 21, 2008 3:58 am
No new posts Postfix 2.3.8 Virtual problem Blotto Postfix 0 Fri Apr 04, 2008 6:11 am
No new posts Postfix sending problem for local domain remote email monkey_magix Postfix 0 Mon Sep 10, 2007 10:17 am
No new posts bounce problem murkis Postfix 0 Sun Oct 08, 2006 3:45 pm

Magazine Subscriptions | Mortgages uk | Loans | Loans | Bankruptcy
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.2078s ][ Queries: 16 (0.1380s) ][ GZIP on - Debug on ]