Skip Menu |

This queue is for tickets about the PadWalker CPAN distribution.

Report information
The Basics
Id: 33211
Status: rejected
Priority: 0/
Queue: PadWalker

People
Owner: Nobody in particular
Requestors: Oliver.Koch [...] Linde-LE.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Problem with Eclipse EPIC and 'Show Local Variables'
Date: Wed, 13 Feb 2008 14:57:53 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
Hi, I'm using Eclipse with the EPIC plug-in and quite happy with it. I additionally installed the Padwalker module, and it's really useful having the local variables available when debugging a perl script. Unfortunately, I found some situations, where the Padwalker module (or the 'Show Local Variables' option of the EPIC debugger) corrupts the debugger. The most recent problem appears, when debugging code using an OLE interface (via WIn32::OLE). When the 'Show Local Variables' option is enabled the result in LastError() from a Win32::OLE->function() call is different using the debugger (wrong result) or just run the script (correct result). When I disable the option the debugger gives correct results, too. I assume, the problem is already known, although I couldn't find anything in the forum or bug database. If you already know this problem, could you please give a brief explanation and maybe a hint, whether it's intended to fix it. If this were new for you, I could send you my script to demonstrate it. Regards, Oliver
Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Wed, 13 Feb 2008 15:19:16 +0000
To: bug-PadWalker [...] rt.cpan.org
From: Robin Houston <robin [...] cpan.org>
Hi Oliver, Thanks for the report. I don't think I know about that particular problem, and PadWalker does fundamentally work even when the debugger is running. Is it possible that something in the EPIC debugger is (directly or indirectly) making an OLE call, thereby overwriting the error code? That strikes me as the first thing to suspect. If you find evidence that PadWalker is causing the problem, then please let me know -- though I'd need some way to reproduce the problem without anything Win32-specific, since I don't have access to a Windows machine. Robin On 13 Feb, 2008, at 13:58, Oliver.Koch@Linde-LE.com via RT wrote: Show quoted text
> Wed Feb 13 08:58:43 2008: Request 33211 was acted upon. > Transaction: Ticket created by Oliver.Koch@Linde-LE.com > Queue: PadWalker > Subject: Problem with Eclipse EPIC and 'Show Local Variables' > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: Oliver.Koch@Linde-LE.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=33211 > > > > Hi, > > I'm using Eclipse with the EPIC plug-in and quite happy with it. I > additionally installed the Padwalker module, and it's really useful > having > the local variables available when debugging a perl script. > Unfortunately, I found some situations, where the Padwalker module > (or the > 'Show Local Variables' option of the EPIC debugger) corrupts the > debugger. > > The most recent problem appears, when debugging code using an OLE > interface > (via WIn32::OLE). When the 'Show Local Variables' option is enabled > the > result in LastError() from a Win32::OLE->function() call is > different using > the debugger (wrong result) or just run the script (correct > result). When I > disable the option the debugger gives correct results, too. > > I assume, the problem is already known, although I couldn't find > anything > in the forum or bug database. If you already know this problem, > could you > please give a brief explanation and maybe a hint, whether it's > intended to > fix it. If this were new for you, I could send you my script to > demonstrate > it. > > Regards, > > Oliver
Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Wed, 13 Feb 2008 15:34:09 +0000
To: bug-PadWalker [...] rt.cpan.org
From: Robin Houston <robin [...] cpan.org>
Oliver, I've just had a look at the EPIC code, to try to see if there's anything there that could cause the sort of problem you describe. I can see at least one potential problem: in the module dumpvar_epic.pm, which is part of the debug jar, there are a few places where eval is used when invoking PadWalker. This will have the effect of overwriting the error value $@, and looking at the Win32::OLE code it seems plausible that this could cause the problem you describe (since ERRSV, which is Perl internals-speak for $@, is used there). The way to fix this problem is to add local $@ to the debugger routines that use eval. By my estimation, these are: dump_array_expr, dump_hash_expr, dump_lexical_vars and _dump_package_var. You could try adding local $@; to the beginning of these four routines and rebuilding/reinstalling the jar, to see if that helps. If it does, I guess you should report this to the EPIC folks. Robin
Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Wed, 13 Feb 2008 17:04:44 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
Dear Robin, Many thanks for your prompt response and your support. I've too stop my work for today and will be vacant for the rest of this week. I'm not familiar with this java-stuff, but as soon as I'm back next week, I'll try your suggestion and let you know the result. Regards, Oliver "Robin Houston via RT" <bug-PadWalker@rt To .cpan.org> Oliver.Koch@Linde-LE.com cc 13.02.2008 16:35 Subject Re: [rt.cpan.org #33211] Problem Please respond to with Eclipse EPIC and 'Show Local bug-PadWalker@rt. Variables' cpan.org <URL: http://rt.cpan.org/Ticket/Display.html?id=33211 > Oliver, I've just had a look at the EPIC code, to try to see if there's anything there that could cause the sort of problem you describe. I can see at least one potential problem: in the module dumpvar_epic.pm, which is part of the debug jar, there are a few places where eval is used when invoking PadWalker. This will have the effect of overwriting the error value $@, and looking at the Win32::OLE code it seems plausible that this could cause the problem you describe (since ERRSV, which is Perl internals-speak for $@, is used there). The way to fix this problem is to add local $@ to the debugger routines that use eval. By my estimation, these are: dump_array_expr, dump_hash_expr, dump_lexical_vars and _dump_package_var. You could try adding local $@; to the beginning of these four routines and rebuilding/reinstalling the jar, to see if that helps. If it does, I guess you should report this to the EPIC folks. Robin
Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Mon, 18 Feb 2008 12:36:01 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
Dear Robin, I tried your suggestion now, but it seems to have no effect. I used Eclipse to modify org.epic.debug_0.6.15.jar, to change the suggested routines and to rebuild the jar file. After installing it ((See attached file: org.epic.debug_0.6.15.jar)) into the plugins directory I used my little demo program, but it's still the same. This is my demo program: (See attached file: OLE_EPIC_Debug_Error.pl) If you can't see any error on my side implementing your proposal, we can extend the bug report to EPIC development. Regards, Oliver
Download org.epic.debug_0.6.15.jar
application/octet-stream 285.8k

Message body not shown because it is not plain text.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Mon, 18 Feb 2008 13:34:02 +0000
To: bug-PadWalker [...] rt.cpan.org
From: Robin Houston <robin [...] kitsite.com>
On 18 Feb, 2008, at 11:37, Oliver.Koch@Linde-LE.com via RT wrote: Show quoted text
> If you can't see any error on my side implementing your proposal, > we can > extend the bug report to EPIC development.
Oliver, You implemented my suggestion perfectly. It looks as though my guess was wrong. I'd love to dig into this some more, but I can't think of much that I can do without a Win32 machine to try it on. I'd suggest reporting this to the EPIC developers. If they identify it as a PadWalker bug, then please shunt it back to me. My current guess is that something like the following might be happening: In Perl, printing out a value can change its internal representation: by generating a string-value for a number, for example. This should not ordinarily change the behaviour of code, but there are some circumstances where it can -- especially when XS code is involved. It is possible that this could perturb the Win32::OLE module in some way. I have no idea whether that is the true explanation. If you wanted to investigate the possibility, you might try commenting out line 92 of dumpvar_epic.pm, which prints the lexicals. If that solves the problem, that would suggest that the problem is not caused by PadWalker per se. On the other hand, if commenting out line 92 does not fix it, but commenting out lines 91 AND 92 does fix it, that would suggest to me that PadWalker is directly responsible for the problem, and I'd be interested to hear about that! Thanks again, and I'm sorry we don't have a resolution yet. Robin
Download smime.p7s
application/pkcs7-signature 2.3k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Mon, 18 Feb 2008 15:31:07 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
Dear Robin, Commenting out line 92 fixed the bug in debugging mode even if the local variables are enabled (but the variables view in Eclipse is blank for sure). (Commenting out line 91 & 92 does the same.) I admit, that I don't understand the routines to _dump_keys() totally, but I could show, that ref(Win32::OLE->LastError()) results in an empty string. And the LastError() routine is a tricky one. Do you think, there is some side effect possible? If you don't have a further clue for now, I can report the problem to the EPIC and the Win32::OLE team. Many thanks so far. Regards, Oliver (See attached file: OLE_EPIC_Debug_Error.pl) "Robin Houston via RT" <bug-PadWalker@rt To .cpan.org> Oliver.Koch@Linde-LE.com cc 18.02.2008 14:35 Subject Re: [rt.cpan.org #33211] Problem Please respond to with Eclipse EPIC and 'Show Local bug-PadWalker@rt. Variables' cpan.org <URL: http://rt.cpan.org/Ticket/Display.html?id=33211 > On 18 Feb, 2008, at 11:37, Oliver.Koch@Linde-LE.com via RT wrote: Show quoted text
> If you can't see any error on my side implementing your proposal, > we can > extend the bug report to EPIC development.
Oliver, You implemented my suggestion perfectly. It looks as though my guess was wrong. I'd love to dig into this some more, but I can't think of much that I can do without a Win32 machine to try it on. I'd suggest reporting this to the EPIC developers. If they identify it as a PadWalker bug, then please shunt it back to me. My current guess is that something like the following might be happening: In Perl, printing out a value can change its internal representation: by generating a string-value for a number, for example. This should not ordinarily change the behaviour of code, but there are some circumstances where it can -- especially when XS code is involved. It is possible that this could perturb the Win32::OLE module in some way. I have no idea whether that is the true explanation. If you wanted to investigate the possibility, you might try commenting out line 92 of dumpvar_epic.pm, which prints the lexicals. If that solves the problem, that would suggest that the problem is not caused by PadWalker per se. On the other hand, if commenting out line 92 does not fix it, but commenting out lines 91 AND 92 does fix it, that would suggest to me that PadWalker is directly responsible for the problem, and I'd be interested to hear about that! Thanks again, and I'm sorry we don't have a resolution yet. Robin [attachment "smime.p7s" deleted by Oliver Koch/MUC/VA/Linde-VA]

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Mon, 18 Feb 2008 16:46:19 +0000
To: bug-PadWalker [...] rt.cpan.org
From: Robin Houston <robin [...] cpan.org>
On 18 Feb, 2008, at 14:31, Oliver.Koch@Linde-LE.com via RT wrote: Show quoted text
> Commenting out line 92 fixed the bug in debugging mode even if the > local > variables are enabled
Aha! That's really interesting, and suggests I might have been right this time. In that case it's possible that the attached patch will fix the problem. Robin

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Mon, 18 Feb 2008 18:22:49 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
Robin, I'm sorry, this didn't show any effect: (See attached file: org.epic.debug_0.6.15.jar) To be honest I expected more a patch of the else branch else # CODE, GLOB, or possibly a blessed reference since LastError() is a subroutine (defined in Win32/OLE/Lite.pm). Regards, Oliver "Robin Houston via RT" <bug-PadWalker@rt To .cpan.org> Oliver.Koch@Linde-LE.com cc 18.02.2008 17:47 Subject Re: [rt.cpan.org #33211] Problem Please respond to with Eclipse EPIC and 'Show Local bug-PadWalker@rt. Variables' cpan.org <URL: http://rt.cpan.org/Ticket/Display.html?id=33211 > On 18 Feb, 2008, at 14:31, Oliver.Koch@Linde-LE.com via RT wrote: Show quoted text
> Commenting out line 92 fixed the bug in debugging mode even if the > local > variables are enabled
Aha! That's really interesting, and suggests I might have been right this time. In that case it's possible that the attached patch will fix the problem. Robin [attachment "dumpvar_epic.patch" deleted by Oliver Koch/MUC/VA/Linde-VA]
Download org.epic.debug_0.6.15.jar
application/octet-stream 285.9k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Tue, 19 Feb 2008 09:00:59 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
Dear Robin, I played around with my little demo script and found, that the error message appears only, if I run over it with debug steps. If the breakpoints are set e. g. on line 22 and line 37 and I use the debugger with "Run To Next Breakpoint" the results are correct. A second point is, that the variables view in Eclipse sometimes shows reasonable contents of the Win32::OLE variables ($VssDB, $Item, $Items). This is the case, if the "Warn => 0" option of Win32::OLE is enabled (as given in the demo script). If the option is commented out, Eclipse shows an empty line in the variable view and an error message in the detail view of the variables view: An error occurred while dumping array content; contents of the Variables view may become invalid This is a part of the documentation to this option in Win32::OLE: Warn This variable determines the behavior of the Win32::OLE module when an error happens. Valid values are: 0 Ignore error, return undef 1 Carp::carp if $^W is set (-w option) 2 always Carp::carp 3 Carp::croak I'm getting more and more the feeling, that Win32::OLE and EPIC are closer involved in this problem, then expected earlier. What do you think? Regards, Oliver
Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Thu, 21 Feb 2008 18:03:22 +0000
To: bug-PadWalker [...] rt.cpan.org
From: Robin Houston <robin [...] kitsite.com>
Hi Oliver, I am quite interested in getting to the bottom of this, but there is not much hands-on debugging I can do, without a machine that can run Win32::OLE. It may well be that you do not have time to pursue this further, which I understand. Unfortunately I don't have any specific idea of what the problem might be. I did wonder whether it could be related to the Win32::OLE module's use of tied variables. (Simply printing the value of a tied variable can invoke arbitrary behaviour, of course.) However, I can't see any specific way that this would be a problem. Win32::OLE used tied hashes, and the EPIC code does not seem to try and print the actual keys and values of a hash. (However I don't completely understand how the EPIC system works, and I must confess that I haven't used it myself, so perhaps I could be mistaken on this point? I suspect not, from what I do understand of the code.) It is not clear to me, from what you've said, whether the error code is being inappropriately set, or whether in fact the OLE call is failing, and the error response is correctly reflecting that. It seems unlikely to me that the LastError() method plays any part in what you're seeing, but I could be wrong. You could eliminate the possibility by printing the error variable $Win32::OLE::LastError directly, rather than using the method. I think the changes you've made have eliminated the obvious ways that the debugging could interfere with your program. What is happening must therefore be something I haven't considered yet. If I were debugging this myself, the next thing I would try would be to recompile Win32::OLE with the _DEBUG symbol defined, which will make it print lots of detailed information about what it's doing. Comparing the output with and without the debugger might yield some new clues. Robin
Download smime.p7s
application/pkcs7-signature 2.3k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Fri, 22 Feb 2008 09:30:41 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
Dear Robin, "Robin Houston via RT" <bug-PadWalker@rt.cpan.org> wrote on 21.02.2008 19:04:18: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=33211 > > > Hi Oliver, > > I am quite interested in getting to the bottom of this, but there is > not much > hands-on debugging I can do, without a machine that can run > Win32::OLE. It may > well be that you do not have time to pursue this further, which I > understand.
I know, that you are fully committed to solve the issue and I'm very thankful for it. And I'm willing too to do my very best to help in finding the source of the problem. Show quoted text
> Unfortunately I don't have any specific idea of what the problem > might be. > I did wonder whether it could be related to the Win32::OLE module's > use of > tied variables. (Simply printing the value of a tied variable can invoke > arbitrary behaviour, of course.) However, I can't see any specific > way that > this would be a problem. Win32::OLE used tied hashes, and the EPIC code > does not seem to try and print the actual keys and values of a hash. > (However I don't completely understand how the EPIC system works, and > I must confess that I haven't used it myself, so perhaps I could be > mistaken on this point? I suspect not, from what I do understand of the > code.)
Neither do I, that's reason why I sent the issue to the EPIC (#1898659) and the Win32::OLE (#33485) team, too. I created a more general example making use of Excel's COM object instead of Visual Source Safe. I think someone from the Win32::OLE team should try to debug the example to get an idea, whether it's an internal problem, something special with the EPIC debugger or maybe with the padwalker module. Unfortunately, I neither have the knowledge nor the debug experience to do this own my own. Show quoted text
> It is not clear to me, from what you've said, whether the error code > is being > inappropriately set, or whether in fact the OLE call is failing, and > the error > response is correctly reflecting that.
I think, this is clear, because the OLE calls are executed correctly, but the return values from LastError() aren't accordingly. Show quoted text
> It seems unlikely to me that the LastError() method plays any part in > what > you're seeing, but I could be wrong. You could eliminate the possibility > by printing the error variable $Win32::OLE::LastError directly, > rather than > using the method.
I just tried this, but it didn't change anything. But I agree, that LastError() maybe just discovers, that there was something wrong (different) during the last OLE call. Show quoted text
> I think the changes you've made have eliminated the obvious ways that > the debugging could interfere with your program. What is happening must > therefore be something I haven't considered yet. If I were debugging > this > myself, the next thing I would try would be to recompile Win32::OLE with > the _DEBUG symbol defined, which will make it print lots of detailed > information about what it's doing. Comparing the output with and without > the debugger might yield some new clues.
I agree, that this should be the next step, but I don't feel instrumented/prepared to do this. So I think, it's more promising, that the Win32::OLE team have a look on his. Regards, Oliver
Subject: Re: [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables'
Date: Tue, 10 Mar 2009 08:05:37 +0100
To: bug-PadWalker [...] rt.cpan.org
From: Oliver.Koch [...] Linde-LE.com
*** e-mail to Jan Dubois, cc to Jan Ploski and Robin Houston *** Dear Jan, Thanks for the analysis. In general the explanation sounds reasonable. But to be honest I'm a little bit confused, because there is now a contradictory situation. From Padwalker module's point of view there couldn't be found a problem, from EPIC's point of view the problem is located in Win32::OLE, and from your's point of view the problem is within the debugger. Since I have not a deep enough insight into any of the three products, I feel, that I'm not capable to resolve this conflict. At first I'd like to ask, whether all parties have tested the same aspect of this incident? Secondly, I think, that the fastest and the most reliable way to fix this is, that you developers resolve this contradiction in direct communication: Jan Dubios <bug-Win32-OLE at rt.cpan.org> [rt.cpan.org #33485] Problem with EPIC debugger and Win32::OLE https://rt.cpan.org/Ticket/Display.html?id=33485 Jan Ploski <jpl at plosquare.com> [ 1898659 ] Problem with EPIC debugger and Win32::OLE http://sourceforge.net/tracker/index.php?func=detail&aid=1898659&group_id=75859&atid=545274 Robin Houston <bug-PadWalker at rt.cpan.org> [rt.cpan.org #33484] Problem with EPIC debugger and Win32::OLE http://rt.cpan.org/Ticket/Display.html?id=33484 [rt.cpan.org #33211] Problem with Eclipse EPIC and 'Show Local Variables' http://rt.cpan.org/Ticket/Display.html?id=33211 I hope, that this bring foward this incident to resolve without remaining questions. Kind regards, Oliver P.S.: I post this e-mail to all four treads.