View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000515 | Perl for OS/2 | Bug | public | 2012-01-15 12:44 | 2012-06-10 14:56 |
Reporter | shmuel | Assigned To | |||
Priority | high | Severity | crash | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | AMD dual core | OS | eComStation | OS Version | 2.0 GA |
Summary | 0000515: Perl 5.14.2 is truncating path names in @ISA | ||||
Description | Perl scripts terminate with the error message Can't locate Config.pm in @INC (@INC contains: F:\Perl5\lib F:/Perl5/lib/si rl/5.14.2/o F:/Perl5/lib/site_perl/5.14 F:/Perl5/lib/5.14.2/o F:/Perl5/lib/ F:/Perl5/lib/site_pe .). | ||||
Steps To Reproduce | Note: I have 4.14.2 installed in F:\Perl5 PATH F:\perl5\bin;Q:\MPTN\BIN;Q:\ECS\BIN;Q:\TCPIP\BIN;Q:\IBMCOM;Q:\PROGRAMS\NETSCAPE\PROGRAM;Q:\EMX\BIN;Q:\IBMGSK50\BIN;Q:\IBMGSK40\BIN;Q:\IBMGSK\BIN;Q:\OS2;Q:\OS2\SYSTEM;Q:\OS2\MDOS\WINOS2;Q:\OS2\INSTALL;Q:\;Q:\OS2\MDOS;Q:\OS2\APPS;Q:\ECS\KLIBC\BIN;Q:\PROGRAMS\JAVA142\BIN;Q:\PROGRAMS\RSJCD;Q:\MMOS2\FREEDB;Q:\MMOS2;Q:\MMOS2\MMPLAYER;Q:\PROGRAMS\4OS2;Q:\PROGRAMS\OPENSSH;Q:\PGSQL\EMX;Q:\PGSQL\bin;Q:\WATCOM\BINP;Q:\WATCOM\BINW;Q:\OS2TK45\som\common;Q:\OS2TK45\som\bin;Q:\OS2TK45\bin;Q:\PROGRAMS\VyperHelp;Q:\PROGRAMS\ibmworks;H:\INCHARGE;H:\GTU40;H:\TSPF12;H:\UTILITY;U:\READIBM2;Q:\TOOLS\dfsee\bin;Q:\PROGRAMS\PERL\bin; SET BEGINLIBPATH=F:\perl5\bin SET MAKESHELL=F:\Perl5\bin\sh.exe SET PERLDIR=F:\Perl5 SET MANPATH=F:\Perl5\man SET PERLLIB=F:\Perl5\lib SET PERLLIB_PREFIX=/PERL5/LIB;F:/Perl5/lib SET PERL_SH_DIR=F:/Perl5/bin [h:\]perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for os2 Copyright 1987-2011, Larry Wall OS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel Version 5 port Copyright (c) 1994-2002, Andreas Kaiser, Ilya Zakharevich Version 5.8.8+ ports Copyright (c) 2007-2012, Paul Smedley, Knut St. Osmundsen Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. [h:\]perl -V Can't locate Config.pm in @INC (@INC contains: F:\Perl5\lib F:/Perl5/lib/site_perl/5.14.2/o F:/Perl5/lib/site_perl/5.14 F:/Perl5/lib/5.14.2/o F:/Perl5/lib/5.14 F:/Perl5/lib/site_pe .). BEGIN failed--compilation aborted. | ||||
Additional Information | Per readme.os2, I installed LIBC065 (via the WPI) [h:\]dir q:\libc0* /s Volume in drive Q is ECS 2_0 GA Serial number is AB1D:1C14 Directory of Q:\Apps\Lib\libc0* 6-11-07 22:53 48,142 0 libc06.dll 6-11-07 22:53 48,142 0 libc061.dll 6-11-07 22:53 157,124 0 libc062.dll 4-15-07 12:37 1,340,869 0 libc062x.dll 6-11-07 22:53 1,349,060 0 libc063.dll 2,943,337 bytes in 5 files and 0 dirs 2,944,512 bytes allocated Total for: Q:\Apps\libc0* 2,943,337 bytes in 5 files and 0 dirs 2,944,512 bytes allocated Directory of Q:\ecs\dll\libc0* 4-14-04 16:37 356,330 0 libc05.dll 10-03-11 6:07 48,142 0 libc06.dll 10-03-11 6:07 48,142 0 libc061.dll 10-03-11 6:07 157,124 0 libc062.dll 10-03-11 6:07 157,124 0 libc063.dll 10-03-11 6:07 1,345,016 0 libc064.dll 5-22-08 23:29 1,349,061 0 libc064x.dll 3,460,939 bytes in 7 files and 0 dirs 3,462,144 bytes allocated Total for: Q:\ecs\libc0* 3,460,939 bytes in 7 files and 0 dirs 3,462,144 bytes allocated Directory of Q:\usr\lib\libc0* 1-17-05 9:54 2,212,930 0 libc06b4.dbg 1-17-05 9:54 562,710 0 libc06b4.dll 1-17-05 9:54 2,011,796 0 libc06b4.elh 1-17-05 9:54 2,332,934 0 libc06b4.elh.map 1-17-05 9:54 2,395,150 0 libc06b4.logchk 1-17-05 9:54 2,563,688 0 libc06b4.logchk.map 1-17-05 9:54 2,441,623 0 libc06b4.map 1-17-05 9:54 2,240,576 0 libc06b4.prf 1-17-05 9:54 2,552,702 0 libc06b4.prf.map 19,314,109 bytes in 9 files and 0 dirs 19,317,248 bytes allocated Total for: Q:\usr\lib\libc0* 19,314,109 bytes in 9 files and 0 dirs 19,317,248 bytes allocated Total for: Q:\usr\libc0* 19,314,109 bytes in 9 files and 0 dirs 19,317,248 bytes allocated Total for: Q:\libc0* 25,718,385 bytes in 21 files and 0 dirs 25,723,904 bytes allocated 391,932,416 bytes free | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
|
I came looking to see if this had yet been reported as I am seeing the same thing. If I don't set perllib_prefix then it finds the .pm files fine when run on the same drive as it searches for /perl5/lib on the root of the drive but when on another drive having to set the perllib_prefix to be able to find them fails as above. |
|
If I issue these commands PATH F:\perl5\bin;%PATH% SET BEGINLIBPATH=F:\perl5\bin SET MANPATH=F:\Perl5\man SET PERLLIB=F:\Perl5\lib SET PERLLIB_PREFIX= SET PERL_SH_DIR=F:/Perl5/bin then the perl -V works, but a test script gives me an error message: [h:\]testpl Can't locate warnings.pm in @INC (@INC contains: F:\Perl5\lib /perl5/lib/5.10.0/os2 /perl5/lib/5.10.0 /perl5/lib/site_perl/5.10.0/os2 /perl5/lib/site_perl/5.10.0 .) at H:\UTILITY/testpl.cmd line 3. BEGIN failed--compilation aborted at H:\UTILITY/testpl.cmd line 3. A dir shows that the mopdule exists: [h:\]dir /s f:\perl5\warnings.pm Volume in drive F is ECS BOOT0 Serial number is 29EE:1415 Directory of F:\perl5\lib\5.14.2\warnings.pm 1-03-12 3:37 18,672 124 warnings.pm 18,672 bytes in 1 file and 0 dirs 18,944 bytes allocated Directory of F:\perl5\lib\5.14.2\encoding\warnings.pm 1-03-12 3:37 6,236 124 warnings.pm 6,236 bytes in 1 file and 0 dirs 6,656 bytes allocated kLIBC Pathrewriters maps /perl5 to F:\perl5 |
|
You need to check your testpl again I think... it is using the wrong Perl: /perl5/lib/5.10.0 |
|
You're right; EXTPROC had an absolute path. When I changed it to just perl -options and left PERLLIB_PREFIX unset it worked. The bypass will cause harmless warnings installing CPAN modules, but I can live with that. |
|
I wonder if the code that handles PERLLIB_PREFIX can't handle the fact that the installation path is /perl5 and it's trying to change a drive letter? I wonder what the best solution is - change the default installation to u:/perl5 and maybe PERLLIB_PREFIX will work correctly, or leave it as /perl5 and suggest the use of the klibc rewriter and that people NOT use PERLLIB_PREFIX? |
|
Without PERLLIB_PREFIX I have problems building CPAN modules: [h:\vendors\cpan\digest-sha1-2.11]perl Makefile.PL Writing Makefile for Digest::SHA1 Writing MYMETA.yml [h:\vendors\cpan\digest-sha1-2.11]U:\extras\bin\make Skip blib/lib/Digest/SHA1.pm (unchanged) gcc -c -DDOSISH -DOS2=2 -DEMBED -I. -I/usr/local/include -O2 -fomit-frame-pointer -falign-loops=2 -falign-jumps=2 -falign-functions=2 -s -DVERSION=\"2.11\" -DXS_VERSION=\"2.11\" -Zdll "-I/perl5/lib/5.14.2/os2/CORE" SHA1.c In file included from SHA1.xs:8: /perl5/lib/5.14.2/os2/CORE/perl.h:2577:27: os2ish.h: No such file or directory In file included from /perl5/lib/5.14.2/os2/CORE/perl.h:5040, from SHA1.xs:8: /perl5/lib/5.14.2/os2/CORE/proto.h:266: error: parse error before '*' token In file included from /perl5/lib/5.14.2/os2/CORE/perl.h:5070, from SHA1.xs:8: /perl5/lib/5.14.2/os2/CORE/intrpvar.h:88: error: parse error before "PL_statbuf" /perl5/lib/5.14.2/os2/CORE/intrpvar.h:88: warning: data definition has no type or storage class /perl5/lib/5.14.2/os2/CORE/intrpvar.h:89: error: parse error before "PL_statcache" /perl5/lib/5.14.2/os2/CORE/intrpvar.h:89: warning: data definition has no type or storage class SHA1.xs: In function `XS_Digest__SHA1_clone': SHA1.xs:488: warning: initialization discards qualifiers from pointer target type make.exe: *** [SHA1.o] Error 1 |
|
KLIBCpathrewriter does appear to work... don't know why I didn't think to try it before other than I haven't explicitly used it very often. Adding the drive as u: may fix it but it is odd how it is showing up. First it adds a /o to the path then it drops the .2 from the path then it adds the /o again to the next path. I hate to say drop the PERLLIB_PREFIX as it has been around for a long time and is in almost any write up of how to setup Perl on OS/2 and dropping it would then cause all the documentation to cause people to go astray... on the other hand, klibcpathrewriter seems to work so hate to see unnecessary work done trying to figure it out, especially if it is more than just adding the drive letter. |
|
I wouldn't mind saying to drop PERLLIB_PREFIX if that worked, but it breaks the CPAN build process. We need a fix or bypass that doesn't break anything else. |
|
I get a little farther if I use an exlicit drive on the left side of SET PERLLIB_PREFIX=u:/perl5/lib;F:/perl5/lib, but I still get an error message from gcc: gcc -c -DDOSISH -DOS2=2 -DEMBED -I. -I/usr/local/include -O2 -fomit-frame-pointer -falign-loops=2 -falign-jumps=2 -falign-functions=2 -s -DVERSION=\"2.131\" -DXS_VERSION=\"2.131\" -Zdll "-I/perl5/lib/5.14.2/os2/CORE" -DUSE_PPPORT_H Dumper.c gcc: gcc: error executing U:/usr/i386-pc-os2-emx/bin/as.exe: No such file or directory I verified that the file exists: [g:\os2]dir U:\usr\i386-pc-os2-emx\bin\as.exe Volume in drive U is SMEDLEY Serial number is 3EBD:8001 Directory of U:\usr\i386-pc-os2-emx\bin\as.exe 6-11-07 9:19 212,992 0 as.exe |
|
A little late to the party :-) What PERLLIB_PREFIX does to mess things up depends on the difference in lengths of the two strings. if the replacement is two characters longer then it will drop the last two characters. I have tried using PERL5LIB which gets around the truncation problem but even with the drive letters CPAN still fails with not finding some fairly basic thing like "strict". *And* it fails if invoked from a different drive. :-( |
|
I can get a bit further by setting PERLLIB_PREFIX=/perl5;/perl5 having installed into the root of a drive. So the broken substitution does not come into play. I then used klibcrewriter to change /perl5 into t:/perl5. Next problem in trying to install *anything* from CPAN is all tests fail always. And if there is a compile involved I get the "no such file os2ish.h" message. This is because it does not exist. The file ...../CORE/os2ish.h is a soft link to os2/os2ish.h but it does not exist. The link implies that there is a ...../CORE/os2 directory containing os2ish.h but that does not exist either. In 5.8.2 it is a real file in CORE. |
|
I heard about the @INC issue from someone trying to use my mapsymw.pl on 5.14.2. This PERLLIB_PREFIX mapping issue seems to be specific to 5.14.2 Given a 5.14.2 setup of PERL_BADLANG=0 PERL_SH_DIR=D:\BIN PERLLIB_PREFIX=/perl5/lib;D:\usr\perl514\LIB BeginLIBPATH=D:\USR\PERL514\BIN; the @INC truncation is obvious >perl -e "map { print \"$_\n\" } @INC" D:/usr/perl514/LIB/site_perl/5. D:/usr/perl514/LIB/site_per D:/usr/perl514/LIB/5. D:/usr/perl514/LI D:/usr/perl514/LIB/s . The same code on 5.10.0 claims @INC is OK. >perl -e "map { print \"$_\n\" } @INC" D:/usr/perl510/LIB/5.10.0/os2 D:/usr/perl510/LIB/5.10.0 D:/usr/perl510/LIB/site_perl/5.10.0/os2 D:/usr/perl510/LIB/site_perl/5.10.0 . The type of slash does not seems to matter. |
|
There are no obvious differences in os2.c between perl 5.10.0 and 5.14.2 that would explain this. Seems the easiest fix would be to change 5.14.2 to default to u:/perl5 as I'd wager that will take care of the PERLLIB_PREFIX issue |
|
I suspect the issue is the significant rewrite to S_incpush in perl.c. Near line 4432 we have libdir = newSVpvn(PERLLIB_MANGLE(dir, len), len); If I am reading the code right, this will do the substitution and create a new string chopping it off at the old length. What I don't understand is why 5.10.0 and older versions seem to work correctly since the code is similar. What I suspect will correct the behavior is something like const char *dir2 = PERLLIB_MANGLE(dir, len); libdir = newSVpvn(dir2, strlen(dir2)); |
|
Steven - I took the liberty of copying the above to the perl NG where I am having other problems with this port and CPAN. Ben Morrow, who knows *far* more about perl than I do, says: =============================== In 5.10.0 the code says if ( usesep && (s = strchr(p, PERLLIB_SEP)) != NULL ) { sv_setpvn(libdir, PERLLIB_MANGLE(p, (STRLEN)(s - p)), (STRLEN)(s - p)); p = s + 1; } else { sv_setpv(libdir, PERLLIB_MANGLE(p, 0)); p = NULL; /* break out */ } whereas in 5.14.2 it omits the 'usesep' condition, and only has if (len) { /* I am not convinced that this is valid when PERLLIB_MANGLE is defined to so something (in os2/os2.c), but the code has been this way, ignoring any possible changed of length, since 760ac839baf413929cd31cc32ffd6dba6b781a81 (5.003_02) so I'll leave it be. */ libdir = newSVpvn(PERLLIB_MANGLE(dir, len), len); } else { libdir = newSVpv(PERLLIB_MANGLE(dir, 0), 0); } I don't know under what circumstances 'usesep' is supposed to be set, but maybe taking the second branch prevents the truncation? The implementation of PERLLIB_MANGLE is, um, scary; it appears to keep a record of the old length in a global, for some reason I can't quite follow. ================================ |
|
Hi DB1, Taking the path that invokes libdir = newSVpv(PERLLIB_MANGLE(dir, 0), 0); would avoid the truncation and that what might occur in 10.0 and older. You can think of newSVpv as a smart strcpy and newSVpvn as a smart strncpy. The SV objects are smart reference counted string objects. usesep means that the input is a list of paths that need to be split and the 10.0 code loops to do this. In 14.2 there's a new outer function that does the split and the loop no longer exists. It needs to be tested, but I think my suggested fix is safe. I don't see the global you are referring to. Got a file and line#? |
|
Sorry Steven - I posted all Ben said between the ======== lines. |
|
Does Ben have commit access to the Perl repo? If so, perhaps it makes sense for us to discuss my recommendation on comp.os.os2.misc or elsewhere. |
|
OK Steven's patch works with 5.16.0: Examples of output below: [U:\DEV]set PERLLIB_PREFIX=u:/perl5/lib;D:\usr\perl514\LIB 5.16.0 without Steven's patch: [U:\DEV]perl -e "map { print \"$_\n\" } @INC" D:/usr/perl514/LIB/site_perl/5.16 D:/usr/perl514/LIB/site_perl/ D:/usr/perl514/LIB/5.16 D:/usr/perl514/LIB/ D:/usr/perl514/LIB/sit . 5.16.0 with Steven's patch: [U:\DEV]perl -e "map { print \"$_\n\" } @INC" D:/usr/perl514/LIB/site_perl/5.16.0/os2 D:/usr/perl514/LIB/site_perl/5.16.0 D:/usr/perl514/LIB/5.16.0/os2 D:/usr/perl514/LIB/5.16.0 D:/usr/perl514/LIB/site_perl . |
|
Test build is at http://smedley.id.au/perl-5.16.0-os2-20120604.zip |
|
Are, but it does not actually work :-( Built under os2 Compiled at Jun 4 2012 18:56:00 %ENV: PERLDOC="-otext" PERLLOC="u:\perl5" PERLLOC2="u:/perl5" PERL_SH_DIR="u:\BIN" @INC: u:/perl5/lib/site_perl/5.16.0/os2 u:/perl5/lib/site_perl/5.16.0 u:/perl5/lib/5.16.0/os2 u:/perl5/lib/5.16.0 u:/perl5/lib/site_perl . [U:\]perl -MCPAN -e shell Can't locate Cwd.pm in @INC (@INC contains: U:u:/perl5/lib/site_perl/5.16.0/os2 U:u:/perl5/lib/site_perl/5.16.0 U:u:/perl5/lib/5.16.0/os2 U:u:/perl5/lib/5.16.0 U:u:/perl5/lib/site_perl .) at u:/perl5/lib/5.16.0/os2/File/Spec/OS2.pm line 215 . BEGIN failed--compilation aborted at u:/perl5/lib/5.16.0/CPAN.pm line 17. Compilation failed in require. BEGIN failed--compilation aborted. Edit: It is putting the current drive letter on the front of each path. I just tried from t:/tmp [T:\tmp]perl -MCPAN -e shell Can't locate Cwd.pm in @INC (@INC contains: T:u:/perl5/lib/site_perl/5.16.0/os2 |
|
This is most likely a side-effect to the new relocatable @INC feature. Our port may be using *ix semantics to determine if the path is absolute. I'll see it I can track this down later. I will need a copy of the 5.16.0 .diffs for this. |
|
That's not it. Take a look at CPAN.pm line 17 $inc = File::Spec->rel2abs($inc) unless ref $inc; Someone broke our rel2abs when they refactored the code for 5.16.0. >perl -e "use File::Spec ; print File::Spec->rel2abs('d:/foo')" J:d:/foo It looks like they tried to add code to supply a drive letter. |
|
It should be sufficient to integrate the Win32 file_name_is_absolute(). This will add support for UNC pathnames which is a good thing. FWIW, this fix along with any other .pm fixes should be passed upstream to the Perl maintainers. |
|
Absolutely, otherwise an innocently applied update to a perl module breaks the fix. |
|
I will take a look at the patches tonight - it's possible I broke things whilst trying to fix rel2abs for Shmuel. On the subject of submitting patches - if the Perl guys will accept them, I'm happy to submit, but many projects make it so friggin hard to submit patches that it's not worth the effort |
|
http://smedley.id.au/perl-5.16.0.diff has the latest diff |
|
The attached OS2.pm can replace dist\File\Spec\OS2.pm and fixes rel2abs based on my testing. Functionally all I did was merge the Win32 version of file_name_is_absolute along with the associated variable definitions into the previously patched OS2.pm perl -MCPAN -e shell works, although the CPAN readline has issues that will be reported in another ticket. Those that need it now can replace lib\5.16.0\os2\File\Spec\OS2.pm with this file. |
|
What with readline? I am back to the "no test will run" scenario :-( |
|
The readline issue is on hold. With, I suspect, the rel2abs fixes, CPAN now claims that $term does not support history. Before this a Ctrl-R generated perl error messages. Which ticket are you referring to with your "no test will run" comment? I've seen some of the newsgroup postings, but they contain too much cruft for me to attempt to replicate the failure here. |
|
I don't think I raised one here. Basically try and install anything as soon as it gets to running the test it just skips them all. There is a problem *somewhere* in makemaker and/or Test::* things. One of the things I was trying to sort with Ben's help. U:/PERL5/BIN/PERL.EXE "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/basic.t ............... No subtests run t/like-exception.t ...... No subtests run t/release-pod-syntax.t .. No subtests run |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-01-15 12:44 | shmuel | New Issue | |
2012-01-21 06:20 | Buck | Note Added: 0002182 | |
2012-01-22 01:16 | shmuel | Note Added: 0002183 | |
2012-01-22 01:46 | Buck | Note Added: 0002184 | |
2012-01-22 03:43 | shmuel | Note Added: 0002185 | |
2012-01-22 08:20 | psmedley | Note Added: 0002186 | |
2012-01-22 12:20 | shmuel | Note Added: 0002188 | |
2012-01-22 22:36 | Buck | Note Added: 0002190 | |
2012-01-23 00:01 | shmuel | Note Added: 0002191 | |
2012-01-27 02:28 | shmuel | Note Added: 0002201 | |
2012-04-02 11:43 | DB1 | Note Added: 0002232 | |
2012-04-05 14:38 | DB1 | Note Added: 0002233 | |
2012-05-20 19:41 | Steven Levine | Note Added: 0002272 | |
2012-05-21 09:05 | psmedley | Note Added: 0002273 | |
2012-05-21 19:19 | Steven Levine | Note Added: 0002274 | |
2012-05-22 18:12 | DB1 | Note Added: 0002275 | |
2012-05-22 18:43 | Steven Levine | Note Added: 0002276 | |
2012-05-22 20:02 | DB1 | Note Added: 0002277 | |
2012-05-22 22:45 | Steven Levine | Note Added: 0002278 | |
2012-06-04 09:30 | psmedley | Note Added: 0002288 | |
2012-06-04 09:31 | psmedley | Note Added: 0002289 | |
2012-06-08 13:22 | DB1 | Note Added: 0002293 | |
2012-06-08 13:25 | DB1 | Note Edited: 0002293 | |
2012-06-08 15:19 | Steven Levine | Note Added: 0002294 | |
2012-06-08 15:53 | Steven Levine | Note Added: 0002295 | |
2012-06-08 16:17 | Steven Levine | Note Added: 0002296 | |
2012-06-08 18:09 | DB1 | Note Added: 0002297 | |
2012-06-08 22:52 | psmedley | Note Added: 0002298 | |
2012-06-09 00:01 | psmedley | Note Added: 0002299 | |
2012-06-09 01:14 | Steven Levine | File Added: OS2.pm | |
2012-06-09 01:29 | Steven Levine | Note Added: 0002300 | |
2012-06-09 01:30 | Steven Levine | Note Edited: 0002300 | |
2012-06-09 10:45 | DB1 | Note Added: 0002302 | |
2012-06-09 18:37 | Steven Levine | Note Added: 0002305 | |
2012-06-10 14:56 | DB1 | Note Added: 0002307 |