Thanks Chris,

I'd be willing to contribute some time to adding the missing my statements and providing patches. If that's all it is, that's an easy fix. I'll work on that today and submit the patches to Dieter and post the patches to [email protected]

...Izzy

Chris Travers wrote:
I too had some interesting discussions on #perl about the issues we
found in LedgerSMB (Presumably the same problems since it was in the
codebase we inherited from SQL-Ledger).

The main issues we saw were the "Attempt to free unreferenced scalar"
issues at various points.

On Thu, Feb 18, 2010 at 9:34 AM, Izzy Blacklock <[email protected]> wrote:
Thanks Raphael,

I'll see what I can shake loose on the sql-ledger side of things.  I have to
admit I don't fully understand the problem and don't know the sql-ledger
code base enough to really be much help on this myself.  Dieter (the lead
developer for SQL-Ledger) seems to think this is a perl bug, but in the
chat's I've had in #perl channels, threads support as it is now is here to
stay and if it breaks code, that code needs to be updated to compensate.
Since I don't understand the problem myself, I'm not sure who is right. :(
 I don't think threads are in use in sql-ledger, so I'm not sure why its
inclusion would trigger a bug.

Ok, let me explain the problem.  In a word, both are right.  There is
a Perl bug which causes some loops where scoping issues occur to throw
 "Attempt to free unreferenced scalar" errors.  This was a change in
5.10 and I have never seen this issue prior to the release of that
version.  While there are some reports of more recent 5.8 variants
having the same behavior, we haven't had experience with this in
LedgerSMB because we fixed problems in the code.

I am not entirely sure what the technical problem is but it has
something to do with variable reassignment in loops, and properly
thought-out scoping fixes the problem.  The problem seems to occur
when a variable (usually in my experience, a reference) is freed at
the end of the loop but still implicitly in the current scope until
some time later.  At that point you get an error echoed.  This is a
bug but probably not a very high priority one for the Perl team
because, quite frankly, no sane code would ever trigger it.

The problem here is that Dieter either doesn't understand what to do
to fix the problem (add "my" scopes to variable declarations in loop
structures).

I haven't been able to create a simple code test on my current
workstation (Fedora 12) which means either the problem has been fixed
in Perl (unlikely) or that more is required than a simple loop (more
likely),  However, I am not sure.


At the end of the day, I need a functioning sql-ledger and right know it
looks like that means I need to compile perl without threads.  According to
Dieter this is a problem for other projects as well, so maybe there is a
need to provide a debian package of perl without threads.

Most other projects have isolated the resulting issues and fixed them.
 LedgerSMB included.

 I know perl is
used all over the place in a Debian system, so I'm not sure if doing so will
break other things.  This is frankly a problem beyond my ability, but I'd be
more then happy to do some testing.  I may even be able to provide a test
system or a reproducible test case.

Dieter, perhaps you could shed some more light on the details of the
problem.  Is there an open perl bug that you could point to?  Do you have a
reproducible test case?  Could you provide a list of other projects
affected?
Thanks everyone for your help in resolving this.  I don't think it makes
sense for Debian to be distributing a broken package in stable which I
believe is currently the case with the sql-ledger package in Lenny.  If the
only short term solution is to provide a threads free version of perl, is
that doable?

The best solution is to isolate the loops where this happens and add
"my" to the variable name.

Best Wishes,
Chris Travers
LedgerSMB Core Member
_______________________________________________
SQL-Ledger mailing list
[email protected]
http://lists.ledger123.com/mailman/listinfo/sql-ledger





--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to