What a strange error...
I have an application with a program called [mailfile.pl] which runs under MP::Registry and is accessed via some mod_rewrites. Today I pushed a new version from my DEV server to the WWW server using rsync. Obviously it was working perfectly on DEV. However the new [mailfile.pl] died with an error on WWW: [error] (2)No such file or directory: exec of '/srv/www/htdocs/b2b/mailfile.pl' failed [error] Premature end of script headers: mailfile.pl, referer: http://www... I have no idea why that is happening, and here is where things get strange: I copied [mailfile.pl] to [mailfile2.pl] and rolled back to the previous working version of [mailfile.pl] so now everything is back to how it was before. Now if I make a call to [mailfile2.pl] (broken as mailfile.pl) that works like a charm. So to recap: [mailfile.pl] = old version, [mailfile2.pl] = new. Both of the above work. Rename [mailfile2.pl] to [mailfile.pl] then it dies with the above error. Naturally this was all accompanied by generous stopping and starting of Apache. Has anyone come across anything like this before? Any ideas where to start looking for a solution other than just mod_rewrite mailfile.pl mailfile2.pl ? Thanks! -- McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
Re: What a strange error...
On Tue, 29 Jun 2010 14:37:38 +0200, Tosh Cooey wrote: I have an application with a program called [mailfile.pl] which runs under MP::Registry and is accessed via some mod_rewrites. Today I pushed a new version from my DEV server to the WWW server using rsync. Obviously it was working perfectly on DEV. However the new [mailfile.pl] died with an error on WWW: [error] (2)No such file or directory: exec of '/srv/www/htdocs/b2b/mailfile.pl' failed [error] Premature end of script headers: mailfile.pl, referer: http://www... That reminds me: 1) chmod +x mailfile.pl 2) dos2unix mailfile.pl -- Cosimo
Re: What a strange error...
Ha ha... Yes I wondered about that too, except then why would it run as mailfile2.pl after only: cp mailfile.pl mailfile2.pl ? However the programmer working on that file uses Windows and so who knows, maybe this is the solution, but not the answer... Thanks! Tosh Cosimo Streppone wrote: On Tue, 29 Jun 2010 14:37:38 +0200, Tosh Cooey wrote: I have an application with a program called [mailfile.pl] which runs under MP::Registry and is accessed via some mod_rewrites. Today I pushed a new version from my DEV server to the WWW server using rsync. Obviously it was working perfectly on DEV. However the new [mailfile.pl] died with an error on WWW: [error] (2)No such file or directory: exec of '/srv/www/htdocs/b2b/mailfile.pl' failed [error] Premature end of script headers: mailfile.pl, referer: http://www... That reminds me: 1) chmod +x mailfile.pl 2) dos2unix mailfile.pl -- McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
Re: What a strange error...
Maybe I should have followed up instead of sending this so quickly, oh well. Yes the Windows CR/LF was the problem. So the situation is resolved, but I have no clue why the same file with different names was inconsistent in execution. Oh well, don't look a gift horse in the mouth I guess, thanks Cosimo! Tosh Tosh Cooey wrote: Ha ha... Yes I wondered about that too, except then why would it run as mailfile2.pl after only: cp mailfile.pl mailfile2.pl ? However the programmer working on that file uses Windows and so who knows, maybe this is the solution, but not the answer... Thanks! Tosh Cosimo Streppone wrote: On Tue, 29 Jun 2010 14:37:38 +0200, Tosh Cooey wrote: I have an application with a program called [mailfile.pl] which runs under MP::Registry and is accessed via some mod_rewrites. Today I pushed a new version from my DEV server to the WWW server using rsync. Obviously it was working perfectly on DEV. However the new [mailfile.pl] died with an error on WWW: [error] (2)No such file or directory: exec of '/srv/www/htdocs/b2b/mailfile.pl' failed [error] Premature end of script headers: mailfile.pl, referer: http://www... That reminds me: 1) chmod +x mailfile.pl 2) dos2unix mailfile.pl -- McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
Re: What a strange error...
Tosh Cooey wrote: Maybe I should have followed up instead of sending this so quickly, oh well. Yes the Windows CR/LF was the problem. So the situation is resolved, but I have no clue why the same file with different names was inconsistent in execution. Oh well, don't look a gift horse in the mouth I guess, thanks Cosimo! Tosh Tosh Cooey wrote: Ha ha... Yes I wondered about that too, except then why would it run as mailfile2.pl after only: cp mailfile.pl mailfile2.pl ? However the programmer working on that file uses Windows and so who knows, maybe this is the solution, but not the answer... Thanks! Tosh Cosimo Streppone wrote: On Tue, 29 Jun 2010 14:37:38 +0200, Tosh Cooey wrote: I have an application with a program called [mailfile.pl] which runs under MP::Registry and is accessed via some mod_rewrites. Today I pushed a new version from my DEV server to the WWW server using rsync. Obviously it was working perfectly on DEV. However the new [mailfile.pl] died with an error on WWW: [error] (2)No such file or directory: exec of '/srv/www/htdocs/b2b/mailfile.pl' failed [error] Premature end of script headers: mailfile.pl, referer: http://www... That reminds me: 1) chmod +x mailfile.pl 2) dos2unix mailfile.pl Perhaps cp removes the wrong line endings? Anyway, you can also fix files with vi :%s/ctrl-v ctrl-m//g Works like a charm. I don't have dos2unix. Chris Bennett
Re: What a strange error...
On Tue, 2010-06-29 at 09:33 -0500, Chris Bennett wrote: > Tosh Cooey wrote: > > Maybe I should have followed up instead of sending this so quickly, oh > > well. > > > > Yes the Windows CR/LF was the problem. So the situation is resolved, > > but I have no clue why the same file with different names was > > inconsistent in execution. > > > > Oh well, don't look a gift horse in the mouth I guess, thanks Cosimo! > > > > Tosh > > > > > > Tosh Cooey wrote: > >> Ha ha... Yes I wondered about that too, except then why would it run > >> as mailfile2.pl after only: cp mailfile.pl mailfile2.pl ? > >> > >> However the programmer working on that file uses Windows and so who > >> knows, maybe this is the solution, but not the answer... > >> > >> Thanks! > >> > >> Tosh > >> > >> > >> Cosimo Streppone wrote: > >>> On Tue, 29 Jun 2010 14:37:38 +0200, Tosh Cooey > >>> wrote: > >>> > I have an application with a program called [mailfile.pl] which runs > under MP::Registry and is accessed via some mod_rewrites. > > Today I pushed a new version from my DEV server to the WWW server > using rsync. Obviously it was working perfectly on DEV. > > However the new [mailfile.pl] died with an error on WWW: > > [error] (2)No such file or directory: exec of > '/srv/www/htdocs/b2b/mailfile.pl' failed > [error] Premature end of script headers: mailfile.pl, referer: > http://www... > >>> > >>> That reminds me: > >>> > >>> 1) chmod +x mailfile.pl > >>> 2) dos2unix mailfile.pl > >>> > >> > > > > Perhaps cp removes the wrong line endings? > > Anyway, you can also fix files with vi > :%s/ctrl-v ctrl-m//g > > Works like a charm. I don't have dos2unix. > > Chris Bennett > Another way in vi ... Set "fileformat" to "unix": :set ff=unix :w -- Cheers, Devin Teske -> CONTACT INFORMATION <- Business Solutions Consultant II FIS - fisglobal.com 510-735-5650 Mobile 510-621-2038 Office 510-621-2020 Office Fax 909-477-4578 Home/Fax devin.te...@fisglobal.com -> LEGAL DISCLAIMER <- This message contains confidential and proprietary information of the sender, and is intended only for the person(s) to whom it is addressed. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you have received this message in error, please notify the e-mail sender immediately, and delete the original message without making a copy. -> END TRANSMISSION <-
Re: What a strange error...
vi? I just send mine to India and pay some guy $1 to remove them with his teeth. Tosh Devin Teske wrote: On Tue, 2010-06-29 at 09:33 -0500, Chris Bennett wrote: Tosh Cooey wrote: Maybe I should have followed up instead of sending this so quickly, oh well. Yes the Windows CR/LF was the problem. So the situation is resolved, but I have no clue why the same file with different names was inconsistent in execution. Oh well, don't look a gift horse in the mouth I guess, thanks Cosimo! Tosh Tosh Cooey wrote: Ha ha... Yes I wondered about that too, except then why would it run as mailfile2.pl after only: cp mailfile.pl mailfile2.pl ? However the programmer working on that file uses Windows and so who knows, maybe this is the solution, but not the answer... Thanks! Tosh Cosimo Streppone wrote: On Tue, 29 Jun 2010 14:37:38 +0200, Tosh Cooey wrote: I have an application with a program called [mailfile.pl] which runs under MP::Registry and is accessed via some mod_rewrites. Today I pushed a new version from my DEV server to the WWW server using rsync. Obviously it was working perfectly on DEV. However the new [mailfile.pl] died with an error on WWW: [error] (2)No such file or directory: exec of '/srv/www/htdocs/b2b/mailfile.pl' failed [error] Premature end of script headers: mailfile.pl, referer: http://www... That reminds me: 1) chmod +x mailfile.pl 2) dos2unix mailfile.pl Perhaps cp removes the wrong line endings? Anyway, you can also fix files with vi :%s/ctrl-v ctrl-m//g Works like a charm. I don't have dos2unix. Chris Bennett Another way in vi ... Set "fileformat" to "unix": :set ff=unix :w -- McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/
Re: What a strange error...
nice. On a related note...some of our developers use the EPIC plugin in eclipse to create/modify remote .pl and .pm files. Same issue (CR/LF) - we usually run a clean.pl script recursively on directories on the dev server during development/prior to generating a build. Needless to say, this gets old quickly when trying to do rapid development/testing. Does anybody know how to get eclipse to do the right thing using the Remote Systems perspective so we don't have to manually run our cleanup script during development? Thanks, Steve On Tue, Jun 29, 2010 at 1:21 PM, Tosh Cooey wrote: > vi? I just send mine to India and pay some guy $1 to remove them with his > teeth. > > Tosh > > > > Devin Teske wrote: > >> On Tue, 2010-06-29 at 09:33 -0500, Chris Bennett wrote: >> >>> Tosh Cooey wrote: >>> Maybe I should have followed up instead of sending this so quickly, oh well. Yes the Windows CR/LF was the problem. So the situation is resolved, but I have no clue why the same file with different names was inconsistent in execution. Oh well, don't look a gift horse in the mouth I guess, thanks Cosimo! Tosh Tosh Cooey wrote: > Ha ha... Yes I wondered about that too, except then why would it run as > mailfile2.pl after only: cp mailfile.pl mailfile2.pl ? > > However the programmer working on that file uses Windows and so who > knows, maybe this is the solution, but not the answer... > > Thanks! > > Tosh > > > Cosimo Streppone wrote: > >> On Tue, 29 Jun 2010 14:37:38 +0200, Tosh Cooey >> wrote: >> >> I have an application with a program called [mailfile.pl] which runs >>> under MP::Registry and is accessed via some mod_rewrites. >>> >>> Today I pushed a new version from my DEV server to the WWW server >>> using rsync. Obviously it was working perfectly on DEV. >>> >>> However the new [mailfile.pl] died with an error on WWW: >>> >>> [error] (2)No such file or directory: exec of '/srv/www/htdocs/b2b/ >>> mailfile.pl' failed >>> [error] Premature end of script headers: mailfile.pl, referer: >>> http://www... >>> >> That reminds me: >> >> 1) chmod +x mailfile.pl >> 2) dos2unix mailfile.pl >> >> Perhaps cp removes the wrong line endings? >>> >>> Anyway, you can also fix files with vi >>> :%s/ctrl-v ctrl-m//g >>> >>> Works like a charm. I don't have dos2unix. >>> >>> Chris Bennett >>> >>> >> Another way in vi ... >> >> Set "fileformat" to "unix": >> >> :set ff=unix >> :w >> >> >> >> > -- > McIntosh Cooey - Twelve Hundred Group LLC - http://www.1200group.com/ >
Re: [PATCH] END blocks may segfault
On Mon, Jun 28, 2010 at 11:15 AM, Alex Hunsaker wrote: > Hi! > > perl: 5.10.1, 5.12.1 (i686-linux, x86_64-linux) > mod_perl: 2.0.4 > > Basically if you have end blocks that modify/add END blocks things > might go crazy. This sounds like it is similar to something Tim B. brought up a month or so ago dealing with the new NYTProf release, but I wasn't able to find the thread. Is this issue related? > A simple test case for this is: > package test: > END { eval "END { }" for 1..10 } > > gives: > Not a CODE reference. > END failed--call queue aborted. > > if I add another END {}: > package test: > END { eval "END { }" for 1..10 } > END { } > > I get: > Undefined subroutine &main:: called. > END failed--call queue aborted. > > This was found as I was getting strange segfaults when trying to use > NYTProf. Nicholas Clark was able to pinpoint the problem. > > See: > http://groups.google.com/group/develnytprof-dev/msg/4ff26e6b3d95861f > thread: > http://groups.google.com/group/develnytprof-dev/browse_thread/thread/20d2ea800e8936f > > Ive included some relevant bits here (again from Nicholas): > >> Of course, I looked at the core perl source to see how END blocks were run, >> and the behaviour was safe with perl. perl unshifts each CV from the list >> before it calls it. I should have remembered that inevitably mod_perl is >> "special". >> >> On reflection, I think that this *is* a bug in mod_perl, as they're going >> to get tripped up in similar fashion if any code run as part of an END block >> contains a string eval containing an END block. That doesn't seem like a widespread use case, but I can see how it could occur unexpectedly and generate a fair amount of pain. But from the times that I have used string eval's, it was always accompanied by some pain. > Now the simple fix would be to just make modperl shift things off as > well (see attached patch to make it use Perl_call_list). Course if > they use ModPerl::Global::special_list_(call|clear) like > t/modperl/endav.t things break. As when we go to run END blocks or > call special_list_call() they will have been shifted off. This might > be acceptable behavior for END blocks, but I can see not wanting to > break other things that use modperl_perl_call_use. Maybe, maybe not. > Thoughts? ModPerl::RegistryCooker appears to use the special_list calls. http://perl.apache.org/docs/2.0/api/ModPerl/Global.html So the fix could introduce some breakage into deployments which use MP::RC > Another option would be to copy/local() the array in > modpler_perl_call_list. Of course that still wont get it "right" > because we wont run any newly defined subs... But at least we wont > segfault/crap out. > > Thoughts? I think getting rid of the segfault is a good thing. But if the main problem is issues with NYTProf, then it seems like this change won't solve the core problem of autogenerated null end blocks faulting. I'm don't fully understand the scope of these issues yet, so my answers (and questions) may not be completely helpful.