Re: BerkelyDB problem - seg fault 11

[prev] [thread] [next] [Date index for 2005/04/15]

From: Perrin Harkins
Subject: Re: BerkelyDB problem - seg fault 11
Date: 22:06 on 15 Apr 2005
On Fri, 2005-04-15 at 23:46 +0200, Rick Jansen wrote:
> No, that should not be the case, I think. The env-open and the  "new
> BerkeleyDB::Hash" are actually called in the run routine, like below,
> simplified.

What you have below will call run() during startup.  All the code
outside of subs in your Application module is going to get run the first
time you use() the module.

> Application:
> 
>   use strict;
>   use Appl::ApplMain;
> 
>   Appl::ApplMain::run();
> 
> 
> Appl/ApplMain.pm:
> 
>   package Appl::ApplMain;
> 
>   my $Env;
> 
>   sub run {
>     # Open env if not open
>     $Env = new BerkeleyDB::Env if (! $Env);
> 
>     # crashes on second run if the close below is not done:
>     my $DB_Object = new BerkeleyDB::Hash
>                       -Filename => $DB,
> 	              -Env  => $Env,
>                       -Flags => DB_RDONLY ...
> 
>     $Env->close(); undef $Env;  # Else crash on 2nd run...
>   }  # run

- Perrin

BerkelyDB problem - seg fault 11
Rick Jansen 09:09 on 15 Apr 2005

Re: BerkelyDB problem - seg fault 11
Perrin Harkins 15:19 on 15 Apr 2005

Re: BerkelyDB problem - seg fault 11
Rick Jansen 21:46 on 15 Apr 2005

Re: BerkelyDB problem - seg fault 11
Perrin Harkins 22:06 on 15 Apr 2005

Generated at 12:49 on 16 Apr 2005 by mariachi v0.52