• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item5194: Highly suspect code in Users.pm

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   minor 4.2.0

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

There is some highly suspect code in Users.pm (several occurences)
my $othercUID = $cUIDList->[0] if (($cUIDList) && scalar(@$cUIDList));

It appears that despite "use strict", perl creates an entry in the global symbol table for $othercUID if the test fails. It only makes the var "my" if the test passes.

 my $othercUID; $othercUID = $cUIDList->[0]  if (($cUIDList) && scalar(@$cUIDList));

Note that the 4.2.0 tests pass, despite this, for reasons i don't fully understand. Logically it may have an effect when TWiki is used in a mod_perl environment, so setting to urgent.

I only noticed this because the tests started failing in my development env, where I am working on other (extensive) changes that may be highlighting it.

FYI I'm using perl 5.8.8.

-- TWiki:Main/CrawfordCurrie - 03 Jan 2008

Oh, that particular Perl trap is around for quite a couple of years. I found a reference dating back to 2000 in http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-05/msg00644.html

Due to the current implementation, Perl indeed is creating sort of a static variable (not an entry in the global symbol table, though) if the test fails.

Unfortunately the -w switch still fails to create a warning in this case frown

-- TWiki:Main.HaraldJoerg - 04 Jan 2008

When I traced this code in the debugger a few months ago (having noticed the my .. if bizzo) it appeared to make not functional change to the code. I left it figuring that we would clean it post freeze. I the process of fixing Item5185 I've removed it entirely. It could have an effect in mod_perl though, I didn't think of that.

-- SvenDowideit - 07 Jan 2008

ItemTemplate
Summary Highly suspect code in Users.pm
ReportedBy TWiki:Main.CrawfordCurrie
Codebase 4.2.0, ~twiki4
SVN Range TWiki-4.3.0, Sun, 30 Dec 2007, build 16120
AppliesTo Engine
Component

Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:16161 TWikirev:16162
TargetRelease minor
ReleasedIn 4.2.0
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r7 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback