Home
TeamSite
Perl Process hangs
cheeku
Hi!
whenever I want to parse a DCR having large size in bytes, perl process hangs. Is this normal if yes then please tell me the solution
to overcome this. Can you also tell me other scnerios with possible solution in which Perl processes hangs
Find more posts tagged with
Comments
Adam Stoller
It might help to see an example of the DCR and the code you're using to parse it.
Though it may also be somewhat dependant upon the amount of memory you have on the machine...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
Also, does this seem code that you are going to show us work consistently on small DCRs. What are your definitions for "large" and "small", by the way?
Migrateduser
I'm wondering if perhaps your web server is getting in the way and causing Perl to timeout -- I recall that some versions of IIS have a 90-second timeout limit on Perl. Of course, Tomcat should preside but I wonder about that level.
Dave
Migrateduser
That's another good question, Dave. Although, IIS wouldn't be the problem (unless he's running 4.x on windows), iw-webd (apache) would.
Cheeku - Do you have the same problem with the code when you run it from the command line (I'm assuming that this is an external task). If it's a cgi and not an external task, you could still redact the relevant portion of the code into a separate file and run that from the command line for testing purposes.
Migrateduser
True, although I wonder if more recent versions of IIS have the same feature / limitation.
I'm also wondering about CPU usage while the script is running. You haven't stated whether you're in a Unix or Windows environment, but either way, does the CPU spike when the script is called? Please provide more info.
Dave
cheeku
I am working on windows2000 server & this is also happening when I run the command through commond prompt.
Big DCR means (size of DCR in bytes having many items & containers).
Migrateduser
Is big like 10K, 100K, or what? We'll really need to see some code samples and data samples to help much.
Have you tried running it through the debugger to see what part of the code is hanging?
Migrateduser
I agree with Rob -- we like figuring out these problems but unfortunately, we need much more information.
What version of TS are you working with? If it's before 6.0 and you're having issues with a DCT, how many VFE's do you have within the DCT? Please describe the script in more detail.
Dave
cheeku
DCR is of suze 125K and it is reading data from 8-10 txt files.DCR reads data successfully but on perview Perl process just hangs & nothing happens
on browser just blank screen which seems to do something but nothing happens & in task manager this process never stops or completes though it
is taking very less CPU memory
Dwayne
Can you zip up a sample DCT, DCR and presentation template that's showing the problem? Without more information, it's going to be difficult to help you track down the problem.
--
Current project: TS 5.5.2/6.1 W2K
cheeku
I am using teamsite 5.5.2 version.
cheeku
Dwayne, it is not possible for me to send you the DCR & tpl as due to copyrights its not my property
By the way you can replicate the environment easily at teamsite 5.5.2 version as I have told you that
when size exceeds something like 120K it starts happening otherwise it works fine
cheeku
Thanks for helping me.
Can you just tell me some scnerio's if you come accross in which perl process hangs?
Adam Stoller
You can't provide the DCR - but can you provide the script you're using to process the DCR? The script that appears to hang when the DCR gets "too big"?
Without seeing the script we're only guessing in the dark - and my in-the-dark guess is that the problem is in the script....
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
cheeku
Following is the command which is hanging:
C:\iw-home\iw-perl\bin\iwperl.exe C:\iw-home\bin\iwpt_compile.ipl -umask 0113 -pt Y:\default\main\dotcom\com\performance\WORKAREA\dot\templatedata\content\sitemap\presentation\sitemap.tpl -smartwrite -iw_pt-preview -ofile Y:\default\main\dotcom\com\performance\WORKAREA\dot\preview.asp -iw_include-location Y:\default\main\dotcom\com\performance\WORKAREA\dot -osenc CP1252 -manifest Y:\default\main\dotcom\com\performance\WORKAREA\dot\zz_tst_munish_bansal_0_manifest -oprefix zz_tst_munish_bansal_0_ -iw_pt-dcr Y:\default\main\dotcom\com\performance\WORKAREA\dot\templatedata\content\sitemap\data\sitemapfinal
Migrateduser
That's helpful. At least now I know what you are doing. When you said "script" I assumed you meant an external task or something rather than a presentation template. In the future, just to make communication simpler, it would be helpful if you specified that the problem was with a PT.
Now, that said, have you tried compiling to ocode rather than ofile and running the resulting script through the debugger yet? The resulting code is a bear to read, but I have often found some very subtle problems as a result. If nothing else you might be able to isolate the problematic part of the code and paste just that part for us to look at.
cheeku
I never said that its a script, I always said DCR & tpl. By the way honestly speaking I don't know
anything about debugger as I am quite new to this langauge. Is it a freeware or we have to buy it?
Migrateduser
It's built in. Just run your iwpt_compile.ipl by doing
iwperl -d iwpt_compile.ipl <all your arguments and options>
The commands are basically the same as in gdb or dbx if you have used either of those. You can also do
iwperl -d
tkdb iwpt_compile.ipl <all your arguments and options>
if you want a graphical debugger. The graphical debugger seems to be partially broken in 6.x though. My breakpoints seem to unset themselves now.
Migrateduser
Also, you are right that you never called it a script. I had to go back and reread to see what you said. You originally said the process was hanging, and I made an assumption. Sorry about that.
cheeku
I ran the command at Dos prompt & got following output. unable to make out anything concrete out of it
C:\>iwperl -d C:\iw-home\iw-perl\bin\iwperl.exe C:\iw-home\bin\iwpt_compile.ipl
-umask 0113 -pt Y:\default\main\adidascom\com\performance\WORKAREA\adidas\templa
tedata\content\sitemap\presentation\sitemap.tpl -smartwrite -iw_pt-preview -ofil
e Y:\default\main\adidascom\com\performance\WORKAREA\adidas\preview.asp -iw_incl
ude-location Y:\default\main\adidascom\com\performance\WORKAREA\adidas -osenc CP
1252 -manifest Y:\default\main\adidascom\com\performance\WORKAREA\adidas\zz_tst_
munish_bansal_0_manifest -oprefix zz_tst_munish_bansal_0_ -iw_pt-dcr Y:\default\
main\adidascom\com\performance\WORKAREA\adidas\templatedata\content\sitemap\data
\sitemapfinal
Loading DB routines from perl5db.pl version 1.0402
Emacs support available.
Enter h or `h h' for help.
Unrecognized character \220 at C:\iw-home\iw-perl\bin\iwperl.exe line 1.
Cannot print stack trace, load with -MCarp option to see stack at c:\iw-home\iw-
perl\lib/perl5db.pl line 1952.
Debugged program terminated. Use q to quit or R to restart,
use O inhibit_exit to avoid stopping after program termination,
h q, h R or h O to get additional info.
SetConsoleMode failed, LastError=|6| at c:\iw-home\iw-perl\site\lib/Term/ReadKey
.pm line 248.
Term::ReadKey::ReadMode(4, 'GLOB(0x88d1d0)') called at c:\iw-home\iw-per
l\site\lib/Term/ReadLine/readline.pm line 1423
readline:
etTTY() called at c:\iw-home\iw-perl\site\lib/Term/ReadLine/r
eadline.pm line 1361
eval {...} called at c:\iw-home\iw-perl\site\lib/Term/ReadLine/readline.
pm line 1361
readline::readline(' DB<1> ') called at c:\iw-home\iw-perl\site\lib/Ter
m/ReadLine/Perl.pm line 11
Term::ReadLine:
erl::readline('Term::ReadLine:
erl=ARRAY(0xaea50c)', '
DB<1> ') called at c:\iw-home\iw-perl\lib/perl5db.pl line 1521
DB::readline(' DB<1> ') called at c:\iw-home\iw-perl\lib/perl5db.pl lin
e 476
DB:
B called at c:\iw-home\iw-perl\lib/perl5db.pl line 2178
DB::fake::at_exit() called at c:\iw-home\iw-perl\lib/perl5db.pl line 217
2
DB::END() called at c:\iw-home\iw-perl\lib/perl5db.pl line 1952
eval {...} called at c:\iw-home\iw-perl\lib/perl5db.pl line 1952
readline::readline(' DB<1> ') called at c:\iw-home\iw-perl\site\lib/Ter
m/ReadLine/Perl.pm line 11
Term::ReadLine:
erl::readline('Term::ReadLine:
erl=ARRAY(0xaea50c)', '
DB<1> ') called at c:\iw-home\iw-perl\lib/perl5db.pl line 1521
DB::readline(' DB<1> ') called at c:\iw-home\iw-perl\lib/perl5db.pl lin
e 476
DB:
B called at c:\iw-home\iw-perl\lib/perl5db.pl line 2178
DB::fake::at_exit() called at c:\iw-home\iw-perl\lib/perl5db.pl line 217
2
DB::END() called at c:\iw-home\iw-perl\lib/perl5db.pl line 1952
eval {...} called at c:\iw-home\iw-perl\lib/perl5db.pl line 1952
DB<1>
I
Migrateduser
Wow... I guess first things first:
the "\220" is a control character (I don't know if it'll show up here but I'll try: ¨{) and was likely caused by whatever text editor you're using. Perl cannot interpret these characters and it looks as though it's the first error you're encountering. A fix to this would be to quickly open and save the file in NOTEPAD. This should remove all of the other control characters, since Notepad should just save in Plain Text.
I realize there are many more errors there -- I'll read through and try to figure out the others.
Dave
Migrateduser
You attempted to debug your perl executable. Here's what you want to do step by step:
1. Compile your tpl to ocode:
c:\> C:\iw-home\bin\iwpt_compile.ipl
-umask 0113 -pt Y:\default\main\adidascom\com\performance\WORKAREA\adidas\templa
tedata\content\sitemap\presentation\sitemap.tpl -smartwrite -iw_pt-preview -ocode Y:\default\main\adidascom\com\performance\WORKAREA\adidas\preview.ipl -iw_incl
ude-location Y:\default\main\adidascom\com\performance\WORKAREA\adidas -osenc CP
1252 -manifest Y:\default\main\adidascom\com\performance\WORKAREA\adidas\zz_tst_
munish_bansal_0_manifest -oprefix zz_tst_munish_bansal_0_ -iw_pt-dcr Y:\default\
main\adidascom\com\performance\WORKAREA\adidas\templatedata\content\sitemap\data
\sitemapfinal
2. Execute the ocode through the debugger
c:\>iwperl -d Y:\default\main\adidascom\com\performance\WORKAREA\adidas\preview.ipl
Migrateduser
It also seems to be complaining a **** of a lot about "DB<1>" I'm not positive why but if a script is trying to parse either XML or HTML and seeing "DB<1>", it'll barf.
Is it possible for you to replace "DB<1>" with "DB<1>" and see if there are fewer errors?
Dave
Migrateduser
Listen to Rob on this; I think he's more of a TS-head and I'm more of a Perl-head.
:-)
Dave