July 14th, 2004


Possible BML bug

Can someone else please verify for me if this is a bug or a "feature" in BML.

If I have a BML that includes more than one file, and the BML=> option is set to 1 is more than one of those files, I am returned a 500 error and " Modification of non-creatable array value attempted, subscript -1
at /home/lj/cgi-bin/Apache/BML.pm line 719.\n" is dumped into my error_log.

If anyone can verify this I'll go ahead and open a bug in zilla about this.

(no subject)

I just now upgraded to latest lj CVS code (I am really excited about recent_comments tool), and it all went pretty smooth! Except for one thing - for some people their 'friends' was gone missing...

(i.e. site returns "we are currently working on something" error.)

I saw that my server's error.log shows some errors like this:

[Wed Jul 14 23:43:57 2004] [error] Can't use string ("24493") as an ARRAY ref while "strict refs" in use at /home/lj2004/live/cgi-bin/ljlib.pl line 4122.\n
[Wed Jul 14 23:44:00 2004] [error] Can't use string ("16052") as an ARRAY ref while "strict refs" in use at /home/lj2004/live/cgi-bin/ljlib.pl line 4122.\n

Of course first thing I did is restarted memcached. (Which I forget to do all the time. Gotta clean out them possibly outdated objects from cache first, after code is updated...). But it did not help.

Then, well, I started looked at that line, and I see it's some perl voodoo, which I can't wrap my mind around... for now I "fixed" it like this - wrapping the offending line inside eval{} so it does not crash the whole routine (sub load_userpics):

--- cgi-bin/ljlib.pl (revision 163)
+++ cgi-bin/ljlib.pl (working copy)
@@ -4119,7 +4119,9 @@
my @load_list;
foreach my $row (@{$idlist})
- my ($u, $id) = @$row;
+ my $u;
+ my $id;
+ eval { ($u, $id) = @$row; };
next unless ref $u;


It's not crashing anymore, but I don't know about any side-effects I might have produced :-)
Please help me understand what is happening in that ill line "my ($u, $id) = @$row" and why it might fail for some users - but not everybody!