Forum archive 2000-2006

Terry McConnell - PGauxiliaryFunctions in perl 5.8.2

Terry McConnell - PGauxiliaryFunctions in perl 5.8.2

by Arnold Pizer -
Number of replies: 0
inactiveTopicPGauxiliaryFunctions in perl 5.8.2 topic started 11/23/2003; 10:31:24 AM
last post 11/24/2003; 1:10:03 PM
userTerry McConnell - PGauxiliaryFunctions in perl 5.8.2  blueArrow
11/23/2003; 10:31:24 AM (reads: 979, responses: 5)
After installed webwork 1.9_02, processing of problems, even set0, seemed to be broken. More specifically, there was a compilation error loading macro PGauxiliaryFunctions. The offending call is the intitialization routine called from dangerousMacros.pl, line 291.

Could it be this perl version doesn't like an empty subroutine? When I added the line "1;" to the otherwise empty sub _PGauxiliaryFunctions_init, everything seemed to work fine.

Anybody else observed this problem?

<| Post or View Comments |>


userArnold K. Pizer - Re: PGauxiliaryFunctions in perl 5.8.2  blueArrow
11/24/2003; 7:36:24 AM (reads: 1144, responses: 0)

Hi Terry,

Could it be that you did not run Makelinks.pl in your courseScripts directory?

Look at the discussion http://webhost.math.rochester.edu/webworkdocs/discuss/msgReader$1690

or the installation directions:

Now we need to run one more script which will create needed links. As a normal user:

> cd /usr/local/webwork/system/courseScripts/
> perl MAKELINKS.pl

Arnie

 

<| Post or View Comments |>


userTerry McConnell - Re: PGauxiliaryFunctions in perl 5.8.2  blueArrow
11/24/2003; 8:03:19 AM (reads: 1151, responses: 0)
I did run Makelinks.pl. As I noted, everything ran normally unless I tried to load that one particular script -- auxiliary functions. I checked and that one is in the pg directory with a link to it from courseScripts. Adding the single line "1;" to the init routine in auxiliary functions seems to fix everything. Weird.

In the meantime I tested some simple files with empty subroutines in them under this perl version and they worked, so maybe the problem is in Safe.pm?

<| Post or View Comments |>


userArnold K. Pizer - Re: PGauxiliaryFunctions in perl 5.8.2  blueArrow
11/24/2003; 9:20:13 AM (reads: 1114, responses: 0)

Hi Terry,

You probably are the first user to try Perl 5.8.2 which may be why this hasn't been reported before.  I assume your perl is compiled with ithreads, i.e. the command


perl -V:useithreads
returns:
useithreads='define';

What is the error message that you get with the empty subroutine _PGauxiliaryFunctions_init? 

Arnie

<| Post or View Comments |>


userTerry McConnell - Re: PGauxiliaryFunctions in perl 5.8.2  blueArrow
11/24/2003; 10:44:42 AM (reads: 1147, responses: 0)
My perl is not compiled with ithreads.

I commented out the '1;' I added to _PGauxiliaryFunctions_init.

When I attempt to load Problem 1 from set0 it hangs. When I load problem 2 I get the pink page below. (Same pink page for any other problems that use PGauxiliaryFunctions.) It looks as if some calling routine is not properly parsing the empty init subroutine. (Note that the first call of the subroutine that follows it is the sine function.) (Please ignore the fact that I have foolishly installed the webwork system inside the document tree.)

Problem2 ERROR caught by PGtranslator while processing problem file:set0/prob1a.pg * Modification of a read-only value attempted at /home/tmc/public_html/webwork/system/courseScripts/dangerousMacros.pl line 291.

*

------Input Read

... listing of problem ....

Compiler warnings: * Use of uninitialized value in sin at /home/tmc/public_html/webwork/system/courseScripts/dangerousMacros.pl line 291. ##More details: -------- main::_PGauxiliaryFunctions_init called at /home/tmc/public_html/webwork/system/courseScripts/dangerousMacros.pl line 291 ---- main::loadMacros called at (eval 53) line 9 ---- main::__ANON__ called at /usr/local/lib/perl5/5.8.2/i686-linux/Safe.pm line 235 ---- Safe::reval called at /home/tmc/public_html/webwork/system/lib//PGtranslator.pm line 733 ---- PGtranslator::translate called at /home/tmc/public_html/webwork/system/cgi/cgi-scripts/processProblem8.pl line 445

<| Post or View Comments |>


userMichael Gage - Re: PGauxiliaryFunctions in perl 5.8.2  blueArrow
11/24/2003; 1:10:03 PM (reads: 1145, responses: 0)
Hi Terry,

See if you can print out the value of $init_subroutine (perhaps using a warn statement). The value of ref($init_subroutine) would also be interesting. It's possible that perl 5.8.2 is trying to optimize empty subroutines by replacing them by a constant? That would be information worth transmitting back to the perl forums. It could also be another interaction with Safe.pm. We've seen one involving the sort function and ithreads already.

--Mike

<| Post or View Comments |>