Page Index Toggle Pages: 1 2 [3] 4 5  Send TopicPrint
Very Hot Topic (More than 25 Replies) BUGS!!! (Read 40708 times)
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #34 - May 11th, 2016 at 7:19pm
Print Post  
Dandello wrote on May 11th, 2016 at 6:41pm:

Edited:
YaBB's Admin Center used to get CGI-timeouts and other errors due to a problem with the Checkspace code section. You might want to check Settings.pm and make sure that's turned off and access to it is also turned off. ($checkspace and anything related to Checkspace.pm. )




$checkspace is set to 0
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #33 - May 11th, 2016 at 6:41pm
Print Post  
Monni wrote on May 11th, 2016 at 6:27pm:
Just checking for that file does exist is not enough when file can be zero length


Yeah, but the file not being there is guaranteed to throw a 'readline() on closed file handle' error. I figure the file being empty is a slightly different issue.

It's just going to take some time to wade through all these.

Edited:
YaBB's Admin Center used to get CGI-timeouts and other errors due to a problem with the Checkspace code section. You might want to check Settings.pm and make sure that's turned off and access to it is also turned off. ($checkspace and anything related to Checkspace.pm. )


  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #32 - May 11th, 2016 at 6:27pm
Print Post  
Dandello wrote on May 11th, 2016 at 2:47pm:
I am in the process of going through 2.6.12. in ActivePerl 2.22.1 with the -w set in YaBB.pl

I've found some missing  Language items, more than 1 bad logical operator, a lot of items than actually need to be initialized to 0, at least 2 places where there's no check or fall back if a file doesn't exist. (And forcing the 'ignore uninitialized variables' is a given.)


Just checking for that file does exist is not enough when file can be zero length... I noticed that when fixing the Help Centre... A lot of the croaks I got when Perl wanted to enable warnings also caused truncation of various files, which wasn't so easy to recover from or fix as the Admin Centre still doesn't work even if I have made sure warnings are disabled everywhere. Whatever I try to do in Admin Centre, I get CGI timeout.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #31 - May 11th, 2016 at 2:47pm
Print Post  
I am in the process of going through 2.6.12. in ActivePerl 2.22.1 with the -w set in YaBB.pl

I've found some missing  Language items, more than 1 bad logical operator, a lot of items than actually need to be initialized to 0, at least 2 places where there's no check or fall back if a file doesn't exist. (And forcing the 'ignore uninitialized variables' is a given.)
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #30 - May 9th, 2016 at 6:37pm
Print Post  
Found another glitch... Attachment download count is empty string instead of "0"

needs: $attach_count{$_} ||= 0;

in Display.pm and Printpage.pm
  
Back to top
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #29 - May 9th, 2016 at 5:45pm
Print Post  
Dandello wrote on May 9th, 2016 at 5:42pm:
Most people don't test adequately and then there's the added complication that YaBB just plain won't work under strict without disabling a good chunk of the requirements.


I shouldn't complain... I charge 200 EUR/h for fixing people's forums Wink
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #28 - May 9th, 2016 at 5:42pm
Print Post  
Most people don't test adequately and then there's the added complication that YaBB just plain won't work under strict without disabling a good chunk of the requirements.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #27 - May 9th, 2016 at 4:52pm
Print Post  
Dandello wrote on May 9th, 2016 at 4:06pm:

The readline fix should be backwards compatible, although I still haven't found any good documentation on when chomp stopped behaving when readline outputs to list.


I really don't bother reading any ChangeLogs as long as things just work... Most online FAQs about Perl have conflicting information that pretty much assumes people never use "perl -w" to see if their code actually works as expected... The main problem with anything regarding Perl is implicit cast and how people use it to avoid error checking... readline returns undef on error, so it should be enclosed in defined() always... also chomp should be the first statement after while-push loop so it can scan the whole array and strip linefeeds and empty items. the next thing is that arrays are never in scalar context, so checking array size by implicit cast does not work as expected. Always have to use "scalar @array" or "$#array + 1" to check array size. "$." returns number of records/items read from file before chomp but after while-push loop, but not after chomp. If you try to chomp too late, you will end up passing single linefeed character to chomp and it will return empty string, which is in most cases not what you wanted.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #26 - May 9th, 2016 at 4:06pm
Print Post  
Like I said, this YaBB install is running on cPanel's Perl 5.08 and runs fine on the Perl 5.14 install as well (I don't run this one in with the 5.14 because I can't update the Perl Modules like I can with the 5.08 install.) 

The readline fix should be backwards compatible, although I still haven't found any good documentation on when chomp stopped behaving when readline outputs to list.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #25 - May 9th, 2016 at 3:44pm
Print Post  
Dandello wrote on May 9th, 2016 at 3:17pm:
I still think there's something very odd happening with your *nix host setup. (Like an update to mod_security or something like that.) YaBB should NOt be identifying your Perl version as 5.10 if you're seeing 5.22 issues.


Well... The server admin already admitted they f*cked up the Perl upgrade... Obviously they did upgrade the primary Perl version from 5.8 to 5.10, but they also installed Perl 5.22 as separate installation aside the existing separate installation of 5.14. YaBB didn't work for me with Perl 5.8 so I was using the Cpanel-installed 5.14 until it stopped working... Then I downgraded to 5.10, because it did start loading the forum, but got lots of croaks... With 5.22 I haven't had even a single croak yet after I fixed the @INC issue. I had to reset some user files in cgi-bin/yabb2/Members because all the croaking did truncate them. As far as I can tell, I've posted all the changes that made the forum behave with Perl 5.22 as it used to behave with 5.14 before all hell did freeze over due to the upgrade failing.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #24 - May 9th, 2016 at 3:17pm
Print Post  
Since this is appears to be a real issue but it doesn't appear to negatively affect the vast majority of YaBB installs, I think we should make the capitalization changes in 2.7 (Pushing back the release to August or so. I was hoping for June 1.) and not worry about it for older versions of YaBB.

I still think there's something very odd happening with your *nix host setup. (Like an update to mod_security or something like that.) YaBB should NOt be identifying your Perl version as 5.10 if you're seeing 5.22 issues. 

Edited:
And for 2.7 that 100 or so lines of code now looks like
Code
Select All
        if ($fix_img_size{$x[1]}[0] && $perl_do_it == 1 ) {
            if ($fix_img_size{$x[1]}[1] && $x[2] !~ /\s width=./xsm ) {
                $x[2] =~ s/( style=.)/$1width:$fix_img_size{$x[1]}[1]px;/xsm;
            }
            if ($fix_img_size{$x[0]}[2] && $x[2] !~ /\s height=./xsm ) {
                $x[2] =~ s/( style=.)/$1height:$fix_img_size{$x[1]}[2]px;/xsm;
            }
            $x[2] =~ s/display:none/display:inline/xsm;
        } 



All the variables related to image resize are in a hash - will also make it easier to add other resizable images in the future.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #23 - May 9th, 2016 at 2:13pm
Print Post  
Dandello wrote on May 9th, 2016 at 2:03pm:
The capitalization issues are VERY old in YaBB (like first version). And using $a and $b in inappropriate places is also very old in YaBB - so if you see an $aa or a $bb - that was my quick fix for that section.

Perl isn't all that case insensitive (at least in English) otherwise it couldn't tell the difference between $MyVar and $myvar and it can. However, $MyVar is very bad form and PerlCritic has hissy fits over it.


In the example I updated on the previous post, the second variable is always undefined, because when you assign a value, it can't decide which variable the user means. As usually the warning is supressed without running "perl -w" and is silently ignored as the second variable is implicitly equal to empty string. At least on the version I used, Perl is case insensitive, but case preserving... So the first variable name gets used even if you explicitly try to declare second variable with similar name but differing in capitalization.
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #22 - May 9th, 2016 at 2:03pm
Print Post  
The capitalization issues are VERY old in YaBB (like first version). And using $a and $b in inappropriate places is also very old in YaBB - so if you see an $aa or a $bb - that was my quick fix for that section.

Perl isn't all that case insensitive (at least in English) otherwise it couldn't tell the difference between $MyVar and $myvar and it can. However, $MyVar is very bad form and PerlCritic has hissy fits over it.
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Monni
Senior Member
****
Offline


Min izāmō

Posts: 413
Location: Kaarina, Finland
Joined: Jul 16th, 2014
Gender: Male
Re: BUGS!!!
Reply #21 - May 9th, 2016 at 1:43pm
Print Post  
Dandello wrote on May 9th, 2016 at 1:22pm:
To fit the pattern of the others in the set
Code
Select All
$x[2] =~ s/( style=.)/$1height:$max_avatarml_height$px;/sm; 



That whole section SO needs to be reworked.  Undecided


Using $px instead of "px" is just overkill... Not to mention variable names with anything else than 0-9,a-z,A-Z are discouraged, also variables $a and $b are reserved for internal use... I also noticed in one of the files, there is two variables that differ only in letter capitalization even though Perl is inherently case insensitive when it comes to variable names.

There is both $nextMessid and $nextMessId in InstantMessage.pm...
  
Back to top
IP Logged
 
Dandello
Forum Administrator
*****
Offline


I love YaBB 2.7!

Posts: 1759
Location: The Land of YaBB
Joined: Feb 12th, 2014
Gender: Female
Re: BUGS!!!
Reply #20 - May 9th, 2016 at 1:22pm
Print Post  
To fit the pattern of the others in the set
Code
Select All
$x[2] =~ s/( style=.)/$1height:$max_avatarml_height$px;/sm; 



That whole section SO needs to be reworked.  Undecided
  

Perfection is not possible. Excellence, however, is excellent.
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1 2 [3] 4 5 
Send TopicPrint