You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Perrin Harkins <pe...@elem.com> on 2004/01/31 00:44:23 UTC

SDBM_File issues?

Has anyone ever had trouble with SDBM_File not being able to open dbm
files created under mod_perl from a command line script?  I noticed that
apache 1.x seems to include an sdbm library, and I wonder if that is
being used by mod_perl, making the dbm file it writes incompatible with
the sdbm library that perl is using.

Not sure how best to solve this at the moment, but I'm just wondering if
anyone else has seen it.

- Perrin


-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2004-01-30 at 20:04, Stas Bekman wrote:
> Aha. So it's not direct SDBM_File. Can you first test with SDBM_File itself, 
> so that we may be can point the fat finger at MLDBM::Sync?

It's not MLDBM::Sync.  I get the exact same results when using
SDBM_File.  Also, the error is thrown when MLDBM makes the first call to
SDBM_File to read data.

- Perrin


-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Stas Bekman <st...@stason.org>.
Perrin Harkins wrote:
> On Fri, 2004-01-30 at 19:45, Stas Bekman wrote:
> 
>>I'm not familiar with SDBM guts, but it could be that mod_perl and perl have a 
>>different idea about some data type used by SDBM. like 32/64 bits so LFS could 
>>be an issue. Are you sure it's the same perl?
> 
> 
> At first I thought it wasn't, but strings /usr/local/apache/bin/httpd
> says it is.  By the way, if there's a better way to tell, I'd love to
> hear it.

I don't know any better if it's a static-linked executable.

>>How did you manipulate this 
>>file? Via mod_perl or some other module?
> 
> 
> Via MLDBM::Sync, from mod_perl.  The command-line script is identical,
> but doesn't work.

Aha. So it's not direct SDBM_File. Can you first test with SDBM_File itself, 
so that we may be can point the fat finger at MLDBM::Sync? Starting with a 
fresh file and inserting one key/val via gdb/ddd may help to figure out where 
things go wrong. The trick is to figure out where to breakpoint.

>>If it's the same perl then it should 
>>probably work just fine, because I think perl brings in its own SDBM 
>>implementation and doesn't link against an external library.
> 
> 
> That's what I thought, but it doesn't work.  That led me to wonder if
> mod_perl is using the apache version of the lib.

It does not, AFAIK.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2004-01-30 at 19:45, Stas Bekman wrote:
> I'm not familiar with SDBM guts, but it could be that mod_perl and perl have a 
> different idea about some data type used by SDBM. like 32/64 bits so LFS could 
> be an issue. Are you sure it's the same perl?

At first I thought it wasn't, but strings /usr/local/apache/bin/httpd
says it is.  By the way, if there's a better way to tell, I'd love to
hear it.

> How did you manipulate this 
> file? Via mod_perl or some other module?

Via MLDBM::Sync, from mod_perl.  The command-line script is identical,
but doesn't work.

> If it's the same perl then it should 
> probably work just fine, because I think perl brings in its own SDBM 
> implementation and doesn't link against an external library.

That's what I thought, but it doesn't work.  That led me to wonder if
mod_perl is using the apache version of the lib.

- Perrin


-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi Perrin,

On 1 Feb 2004, Perrin Harkins wrote:

> On Fri, 2004-01-30 at 19:52, Ged Haywood wrote:
> > Another one: is mod_ssl involved anywhere?
> 
> It is.
> 
> > NOTE: The --enable-rule=SSL_SDBM option
> 
> As far as I can tell from httpd -V, that option was not used ...
> I may end up just writing some code to run under mod_perl ...

I always say if you can't solve a problem, go around it. :)

73,
Ged.



-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2004-01-30 at 19:52, Ged Haywood wrote:
> Another one: is mod_ssl involved anywhere?

It is.

> From mod_ssl-2.8.16-1.3.29/INSTALL
> 
> NOTE: The --enable-rule=SSL_SDBM option enabled the use of the
>       built-in SDBM library instead of a custom defined or vendor
>       supplied DBM library. This can be useful when...

As far as I can tell from httpd -V, that option was not used during the
compile.  (I didn't compile this mod_perl.)

I may end up just writing some code to run under mod_perl that will read
the existing database and write it to something else, like DB_File or
GDBM_File.

- Perrin


-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi guys,

On Fri, 30 Jan 2004, Stas Bekman wrote:

> I think perl brings in its own SDBM implementation

Another one: is mod_ssl involved anywhere?

>From mod_ssl-2.8.16-1.3.29/INSTALL

NOTE: The --enable-rule=SSL_SDBM option enabled the use of the
      built-in SDBM library instead of a custom defined or vendor
      supplied DBM library. This can be useful when...

73,
Ged.


-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Stas Bekman <st...@stason.org>.
Perrin Harkins wrote:
> On Fri, 2004-01-30 at 18:59, Ged Haywood wrote:
> 
>>Stupid question: this isn't the old "first 4k not getting flushed" 
>>file locking bug?

That was an issue with Berkley DB (via DB_File), not SDBM_File, AFAIK.

> I don't see how it could be.  The mod_perl code unties the file after
> using it.
> 
> The message I get is "panic: sv_setpvn called with negative strlen" and
> it doesn't happen when the file is used from mod_perl.

I'm not familiar with SDBM guts, but it could be that mod_perl and perl have a 
different idea about some data type used by SDBM. like 32/64 bits so LFS could 
be an issue. Are you sure it's the same perl? How did you manipulate this 
file? Via mod_perl or some other module? If it's the same perl then it should 
probably work just fine, because I think perl brings in its own SDBM 
implementation and doesn't link against an external library.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi Perrin,

On Fri, 30 Jan 2004, Perrin Harkins wrote:

> > file locking bug?
> 
> The mod_perl code unties the file  after using it.
> 
> The message I get is "panic: sv_setpvn called with negative strlen"

Yikes!  Misconfigured build, nasty bug, linked with wrong library...??

73,
Ged.


-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2004-01-30 at 18:59, Ged Haywood wrote:
> Stupid question: this isn't the old "first 4k not getting flushed" 
> file locking bug?

I don't see how it could be.  The mod_perl code unties the file after
using it.

The message I get is "panic: sv_setpvn called with negative strlen" and
it doesn't happen when the file is used from mod_perl.

- Perrin


-- 
Reporting bugs: 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


Re: SDBM_File issues?

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi Perrin,

On Fri, 30 Jan 2004, Perrin Harkins wrote:

> Has anyone ever had trouble with SDBM_File not being able to open dbm
> files created under mod_perl from a command line script?

Stupid question: this isn't the old "first 4k not getting flushed" 
file locking bug?

73
Ged.



-- 
Reporting bugs: 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