[Dbix-class] Problem with DBIx::Class::Schema::Loader or

james at masters.me.uk james at masters.me.uk
Tue Sep 5 22:51:55 CEST 2006


I think I've finally got rid of my unreferenced scalar messages thanks to
some pointers from Matt Trout and others.  I've tried all sorts of ways
around the problem but in the end, here is a summary of my final solution
for the record.  Experts might like to correct me, where I've been
particularly amateur.

The DBI  that comes with Active State Perl has problems (probably to do with
threading) which cause errors like this:

Attempt to free unreferenced scalar: SV 0x1fa7a5c, Perl interpreter:
0x224234 at C:/Perl/site/lib/SQL/Abstract/Limit.pm line 325.

in a number of situations and certainly when using DBIx modules on Windows.

DBI is one of those modules that isn't just interpreted - part of it is
compiled C++.  A way to fix the problem is to overwrite DBI with a version
that has been compiled using a different C++ compiler - recommended is gcc.
gcc is the defacto standard open source C++ compiler.  And, incidentally,
MingW seems to be the most popular pre-compiled version of gcc and other
related stuff for Windows.  If one looks at the documentation that comes
with gcc and one is not a C++ programmer, one becomes mightily scared.  It
appears that all sorts of stuff needs to be configured and downloaded and
compiled so downloading and installing a pre-packaged C++ compiler seems a
hugely attractive option by comparison.  But, even with the free Microsoft
C++ compiler or the free Intel C++ compiler or the free MingW C++ compiler,
installation is not straightforward and for a non-C++ programmer, extremely
off-putting.  CamelPerl is a version of Perl that bundles Active State Perl
together with MingW C++ compiler into a simple install package.

So first install CamelPerl including the C++ stuff.
DBI comes with CamelPerl of course.  If you try to install it using CPAN it
will say "DBI is up to date." which leaves you up the creek without a
paddle.
So, being not easily put off, decide to do this by hand.  As per the
standard module installation instructions you (within CPAN) do the
following:
make DBI
test DBI
at which point one of the tests fails - as is often the case with Windows.
One wonders why the tests are even bothered with since they always seem to
fail in fact.  Based on this pessimistic outlook and despite the fact that
you aren't really supposed to install unless all tests pass, ignore this and
also override the "DBI is up to date" message by typing
force install DBI

This seems to work and, for me, at least the unreferenced scalar messages
and the inconsistent behaviour instantly disappeared.

I hope this non-expert perspective helps someone in the future.

James Masters
www.tradgames.org.uk


> -----Original Message-----
> From: dbix-class-bounces at lists.rawmode.org
> [mailto:dbix-class-bounces at lists.rawmode.org]On Behalf Of Matt S Trout
> Sent: 02 September 2006 19:25
> To: dbix-class at lists.rawmode.org
> Subject: Re: [Dbix-class] Problem with DBIx::Class::Schema::Loader or
>
>
> James Masters wrote:
> > Just to give feedback on this, I have completely
> reinstalled Perl using
> > IndigoPerl (installing all the modules for DBIx was a long winded
> > business I can tell you).  And that didn't work so then I
> completely
> > reinstalled Active State Perl.
> >
> > But now it's even worse - the DBIx Loader itself is now not working
> > AND produces a whole load of these unreferenced scalar
> messages.  I've
> > tried a variety of different tinkerings with different modules from
> > active state and Winnipeg without success.  I haven't tried
> recompiling
> > DBI with gcc because I'm not even sure what that means.  I
> looked up
> > what gcc is but I thought Perl was an interpreted language
> so I can't
> > see how I can compile the DBI module.
>
> The DBI module has large chunks of C code in it that are
> accessed from perl
> space so that DBDs can glue in C/C++ database client libraries.
>
> If you grab bloodshed dev-c++, install that, add
> C:\dev-c++\bin or whatever
> the path ends up being to your DOS PATH env, grab nmake from
> microsoft, unpack
> it somewhere and add that to your PATH as well, CPAN.pm will
> be able to
> compile the glue code stuff - including DBI.
>
> --
>       Matt S Trout       Offering custom development,
> consultancy and support
>    Technical Director    contracts for Catalyst, DBIx::Class
> and BAST. Contact
> Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for
> more information
>
> + Help us build a better perl ORM:
> http://dbix-class.shadowcatsystems.co.uk/ +
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>




More information about the Dbix-class mailing list