{"thread":{"id":"20451","subject":"Gitweb giving me some warnings in Apache's error_log","startedAt":"2009-08-07T13:00:12Z","lastAt":"2009-08-10T14:57:11Z","messageCount":4,"participants":["Mark A Rada","Jakub Narebski","Mark Rada"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"119902","messageId":"533D6DDF-4DAC-4A86-A6F7-95B54B77E48B@gmail.com","threadId":"20451","inReplyTo":null,"subject":"Gitweb giving me some warnings in Apache's error_log","fromName":"Mark A Rada","fromEmail":"markrada26@gmail.com","sentAt":"2009-08-07T13:00:12Z","receivedAt":"2009-08-07T13:00:12Z","isPatch":false,"sender":{"key":"markrada26@gmail.com","avatar":"https://gravatar.com/avatar/01650ee0e05cc7d0d23b4fc6163279a6c09a4dada1ed9a04ffadbd2c6a347170?d=mp&s=160"},"body":"It doesn't seem to cause any other problems, but I don't know if it is  \nsignificant or not.\n\n[Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$project_maxdepth\"  \nmay be unavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line  \n2296.\n[Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$projectroot\" may be  \nunavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line 2304.\n\n\nApache 2.2.12/ mod_perl 2.04/ perl 5.8.8\n\n\n--\nMark A Rada (ferrous26)\nmarada@uwaterloo.ca\n"},{"id":"119905","messageId":"m3my6bpv6v.fsf@localhost.localdomain","threadId":"20451","inReplyTo":"533D6DDF-4DAC-4A86-A6F7-95B54B77E48B@gmail.com","subject":"Re: Gitweb giving me some warnings in Apache's error_log","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-08-07T14:14:52Z","receivedAt":"2009-08-07T14:14:52Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Mark A Rada <markrada26@gmail.com> writes:\n\n> It doesn't seem to cause any other problems, but I don't know if it is\n> significant or not.\n> \n> [Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$project_maxdepth\"\n> may be unavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line\n> 2296.\n> [Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$projectroot\" may be\n> unavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line 2304.\n> \n> \n> Apache 2.2.12/ mod_perl 2.04/ perl 5.8.8\n\n>From perldiag(1) manpage:\n\n  Variable \"%s\" may be unavailable\n\n    (W closure) An inner (nested) anonymous subroutine is inside a\n    named subroutine, and outside that is another subroutine; and the\n    anonymous (innermost) subroutine is referencing a lexical variable\n    defined in the outermost subroutine.  For example:\n\n      sub outermost { my $a; sub middle { sub { $a } } }\n\n    If the anonymous subroutine is called or referenced (directly or\n    indirectly) from the outermost subroutine, it will share the\n    variable as you would expect.  But if the anonymous subroutine is\n    called or referenced when the outermost subroutine is not active,\n    it will see the value of the shared variable as it was before and\n    during the *first* call to the outermost subroutine, which is\n    probably not what you want.\n\n    In these circumstances, it is usually best to make the middle\n    subroutine anonymous, using the \"sub {}\" syntax.  Perl has\n    specific support for shared variables in nested anonymous\n    subroutines; a named subroutine in between interferes with this\n    feature.\n\nThe warning is about 'wanted' anonymous subroutine passed to\nFile::Find::find.  The \"middle\" subroutine is git_get_projects_list,\nand the \"outermost\" is mod_perl / ModPerl::Registry request loop.\n\nWe can't make git_get_projects_list anonymous, but anonymous\nsubroutine is not called or referenced outside git_get_projects_list,\nnor it is called or referenced outside mod_perl request/event loop.\n\nThis warning is harmless... but I do not know how to silence it.\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"119915","messageId":"88f4c4ee0908071056g5d9da83ft77d56ec2e5e84bac@mail.gmail.com","threadId":"20451","inReplyTo":"m3my6bpv6v.fsf@localhost.localdomain","subject":"Re: Gitweb giving me some warnings in Apache's error_log","fromName":"Mark Rada","fromEmail":"markrada26@gmail.com","sentAt":"2009-08-07T17:56:03Z","receivedAt":"2009-08-07T17:56:03Z","isPatch":false,"sender":{"key":"markrada26@gmail.com","avatar":"https://gravatar.com/avatar/01650ee0e05cc7d0d23b4fc6163279a6c09a4dada1ed9a04ffadbd2c6a347170?d=mp&s=160"},"body":"Let me double check my understanding.\n\nThe warnings will not occur if Gitweb is run as a regular CGI script\nbecause then it won't be nested inside a call from\nModPerl::Registry?\n\nWill it also not complain if I provided my own $project_list in the first place?\n\nAlso, I looked at some examples from the second and third page of an article\non the subject, http://www.perl.com/pub/a/2002/05/07/mod_perl.html?\nand it looks \"fixable\". Is there a particular reason why any of them are not\ndesirable?\n\nNote: I haven't tried anything yet, just wondering if you know off hand\n\n--\nMark A Rada (ferrous26)\nmarada@uwaterloo.ca\n\n\n\nOn Fri, Aug 7, 2009 at 10:14 AM, Jakub Narebski<jnareb@gmail.com> wrote:\n> Mark A Rada <markrada26@gmail.com> writes:\n>\n>> It doesn't seem to cause any other problems, but I don't know if it is\n>> significant or not.\n>>\n>> [Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$project_maxdepth\"\n>> may be unavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line\n>> 2296.\n>> [Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$projectroot\" may be\n>> unavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line 2304.\n>>\n>>\n>> Apache 2.2.12/ mod_perl 2.04/ perl 5.8.8\n>\n> From perldiag(1) manpage:\n>\n>  Variable \"%s\" may be unavailable\n>\n>    (W closure) An inner (nested) anonymous subroutine is inside a\n>    named subroutine, and outside that is another subroutine; and the\n>    anonymous (innermost) subroutine is referencing a lexical variable\n>    defined in the outermost subroutine.  For example:\n>\n>      sub outermost { my $a; sub middle { sub { $a } } }\n>\n>    If the anonymous subroutine is called or referenced (directly or\n>    indirectly) from the outermost subroutine, it will share the\n>    variable as you would expect.  But if the anonymous subroutine is\n>    called or referenced when the outermost subroutine is not active,\n>    it will see the value of the shared variable as it was before and\n>    during the *first* call to the outermost subroutine, which is\n>    probably not what you want.\n>\n>    In these circumstances, it is usually best to make the middle\n>    subroutine anonymous, using the \"sub {}\" syntax.  Perl has\n>    specific support for shared variables in nested anonymous\n>    subroutines; a named subroutine in between interferes with this\n>    feature.\n>\n> The warning is about 'wanted' anonymous subroutine passed to\n> File::Find::find.  The \"middle\" subroutine is git_get_projects_list,\n> and the \"outermost\" is mod_perl / ModPerl::Registry request loop.\n>\n> We can't make git_get_projects_list anonymous, but anonymous\n> subroutine is not called or referenced outside git_get_projects_list,\n> nor it is called or referenced outside mod_perl request/event loop.\n>\n> This warning is harmless... but I do not know how to silence it.\n>\n> --\n> Jakub Narebski\n> Poland\n> ShadeHawk on #git\n>\n"},{"id":"120160","messageId":"200908101657.13301.jnareb@gmail.com","threadId":"20451","inReplyTo":"88f4c4ee0908071056g5d9da83ft77d56ec2e5e84bac@mail.gmail.com","subject":"Re: Gitweb giving me some warnings in Apache's error_log","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-08-10T14:57:11Z","receivedAt":"2009-08-10T14:57:11Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Fri, 7 Aug 2009, Mark Rada wrote:\n> On Fri, Aug 7, 2009 at 10:14 AM, Jakub Narebski<jnareb@gmail.com> wrote:\n>> Mark A Rada <markrada26@gmail.com> writes:\n>>\n>>> It doesn't seem to cause any other problems, but I don't know if it is\n>>> significant or not.\n>>>\n>>> [Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$project_maxdepth\"\n>>> may be unavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line\n>>> 2296.\n>>> [Fri Aug  7 08:51:13 2009] gitweb.cgi: Variable \"$projectroot\" may be\n>>> unavailable at /var/www/private/gitweb/cgi-bin/gitweb.cgi line 2304.\n>>>\n>>>\n>>> Apache 2.2.12/ mod_perl 2.04/ perl 5.8.8\n>>\n>> From perldiag(1) manpage:\n>>\n>>  Variable \"%s\" may be unavailable\n>>\n>>    (W closure) An inner (nested) anonymous subroutine is inside a\n>>    named subroutine, and outside that is another subroutine; and the\n>>    anonymous (innermost) subroutine is referencing a lexical variable\n>>    defined in the outermost subroutine.\n[...]\n\n>> The warning is about 'wanted' anonymous subroutine passed to\n>> File::Find::find.  The \"middle\" subroutine is git_get_projects_list,\n>> and the \"outermost\" is mod_perl / ModPerl::Registry request loop.\n>>\n>> We can't make git_get_projects_list anonymous, but anonymous\n>> subroutine is not called or referenced outside git_get_projects_list,\n>> nor it is called or referenced outside mod_perl request/event loop.\n>>\n>> This warning is harmless... but I do not know how to silence it.\n\n> Let me double check my understanding.\n> \n> The warnings will not occur if Gitweb is run as a regular CGI script\n> because then it won't be nested inside a call from ModPerl::Registry?\n\nYes, it is true that this happens only when running gitweb as mod_perl\nlegacy script using ModPerl::Registry.  Otherwise it would be caught\nwhen running t/t9500-gitweb-standalone-no-errors.sh test.\n\n> \n> Will it also not complain if I provided my own $projects_list in the\n> first place?\n\nYes, it would not, because the code is run only when $projects_list is\na directory to search for git repositories.  If $projects_list is\na file you wouldn't get this warning (and it might be slightly faster,\nif less flexible, as you would need to regenerate this file when adding\nor removing, or renaming, or changing owner of repositories).\n\n-- \nJakub Narebski\nPoland\n"}]}