t/dynclass/gdbmhash.t failures

6 views
Skip to first unread message

Tim Bunce

unread,
Aug 15, 2005, 3:05:13 PM8/15/05
to Internals List
Configure.pl said

Determining if your platform supports gdbm.............................yes.

But t/dynclass/gdbmhash.t fails completely:

Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/dynclass/gdbmhash.t 13 3328 13 13 100.00% 1-13

with errors like:

t/dynclass/gdbmhash............NOK 1
# Failed test (t/dynclass/gdbmhash.t at line 43)
# got: 'no extension: file 'libgdbm'
# '
# expected: 'GDBMHash
# '
# './parrot --gc-debug "/Users/timbo/perl/parrot/t/dynclass/gdbmhash_1.pir"' failed with exit code 42
t/dynclass/gdbmhash............NOK 2
# Failed test (t/dynclass/gdbmhash.t at line 56)
# got: 'no extension: file 'libgdbm'
# '
# expected: '0
# 1
# 0
# '

The compiler complained about gdbmhash.c but didn't fail:

cc -c -fno-common -no-cpp-precomp -DDEBUGGING -pipe -I/opt/local/include -pipe -fno-common -Wno-long-double -g -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -Winline -W -Wno-unused -Wsign-compare -Wformat-nonliteral -Wformat-security -Wpacked -Wdisabled-optimization -falign-functions=16 -Wno-shadow -DHAS_JIT -DPPC -DHAVE_COMPUTED_GOTO -o gdbmhash.o -I/Users/timbo/perl/parrot/include -I/Users/timbo/perl/parrot/classes gdbmhash.c
In file included from gdbmhash.pmc:49:
/opt/local/include/gdbm.h:85: warning: function declaration isn't a prototype
gdbmhash.pmc: In function `Parrot_GDBMHash_get_integer':
gdbmhash.pmc:145: warning: function call has aggregate value
gdbmhash.pmc:147: warning: function call has aggregate value
gdbmhash.pmc: In function `Parrot_GDBMHash_get_string_keyed':
gdbmhash.pmc:229: warning: function call has aggregate value
gdbmhash.pmc: In function `Parrot_GDBMHash_get_bool':
gdbmhash.pmc:171: warning: function call has aggregate value

/opt/local/include/gdbm.h:85 reads:

extern GDBM_FILE gdbm_open __P((char *, int, int, int, void (*)()));

This is on OSX 10.4 with a recent svn update:

Last Changed Rev: 8966
Last Changed Date: 2005-08-15 04:57:58 +0100 (Mon, 15 Aug 2005)

Tim.

Andy Dougherty

unread,
Aug 17, 2005, 12:35:36 PM8/17/05
to Tim Bunce, Internals List
On Mon, 15 Aug 2005, Tim Bunce wrote:

> Configure.pl said
>
> Determining if your platform supports gdbm.............................yes.
>
> But t/dynclass/gdbmhash.t fails completely:
>
> Failed Test Stat Wstat Total Fail Failed List of Failed
> -------------------------------------------------------------------------------
> t/dynclass/gdbmhash.t 13 3328 13 13 100.00% 1-13
>
> with errors like:
>

> # './parrot --gc-debug "/Users/timbo/perl/parrot/t/dynclass/gdbmhash_1.pir"' failed with exit code 42
> t/dynclass/gdbmhash............NOK 2
> # Failed test (t/dynclass/gdbmhash.t at line 56)
> # got: 'no extension: file 'libgdbm'
> # '

> This is on OSX 10.4 with a recent svn update:


>
> Last Changed Rev: 8966
> Last Changed Date: 2005-08-15 04:57:58 +0100 (Mon, 15 Aug 2005)

Yes, I've been seeing that same failure for ages on Solaris. The gdbmhash
test has never worked for me; I had just assumed it was the same for
everyone else too.

The error message is, at best, unhelpful. I'd suggest applying the
patch below and then rerunning the test.

Here's some of what's going on: In src/dynext.c, get_path() tries to open
"libgdbm". It has the following algorithm: First it tries to add an
extension PARROT_LOAD_EXT to libgdbm. (I'd guess that the extension used
in config/init/hints doesn't match the extension used when gdbm was built
for OS X.) get_path() then calls src/library:Parrot_locate_runtime_file()
to try to look in various standard paths. That is failing.

Finally, after trying various prefixes, get_path() simply tries finding
"libgdbm" without any extensions. However, Parrot_locate_runtime_file()
throws the internal_exception "no extension" in that case, so it's
pointless.

The patch below lets you call Parrot_locate_runtime_file() without any
extension. That will also fail to find a bare "libgdbm". However, and
here's the point, get_path() will report the result from dlerror(), and
you'll get a useful error message back.

You can then take that error message, see what Parrot was looking for, and
see what the libgdbm file is actually called on your system.

--- parrot-current/src/library.c Tue Aug 16 13:22:34 2005
+++ parrot-andy/src/library.c Tue Aug 16 15:46:49 2005
@@ -212,9 +212,11 @@
* if the extension is given use it
* TODO if not try extensions according to type
*/
+ /*
if (!ext) {
internal_exception(UNIMPLEMENTED, "no extension: file '%s'", file_name);
}
+ */

/* use absolute paths as is */
#ifdef WIN32

--
Andy Dougherty doug...@lafayette.edu

Jerry Gay

unread,
Aug 17, 2005, 1:10:53 PM8/17/05
to Andy Dougherty, Tim Bunce, Internals List
> --- parrot-current/src/library.c Tue Aug 16 13:22:34 2005
> +++ parrot-andy/src/library.c Tue Aug 16 15:46:49 2005
> @@ -212,9 +212,11 @@
> * if the extension is given use it
> * TODO if not try extensions according to type
> */
> + /*
> if (!ext) {
> internal_exception(UNIMPLEMENTED, "no extension: file '%s'", file_name);
> }
> + */
>
> /* use absolute paths as is */
> #ifdef WIN32
>
this patch causes gdbm tests to be run on win32 when gdbm is
installed, but the tests all fail with a message similar to

t\dynclass\gdbmhash............NOK 1# Failed test
(t\dynclass\gdbmhash.t at line 43)
# got: 'GDBMHash
# Couldn't load 'gdbm3': unknown reason
# Couldn't load 'gdbm3': unknown reason


# '
# expected: 'GDBMHash
# '

applied as r8980.
~jerry

Reply all
Reply to author
Forward
0 new messages