Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: Perl Win32::Shortcut screws up fork Date: Thu, 7 Jul 2005 18:10:17 +0100 Message-ID: <7231C15EAC2F164CA6DC326D97493C8BA1C3F1@exchange35.fed.cclrc.ac.uk> From: "Adye, TJ \(Tim\)" To: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id j67HAYQ0004629 Hi, In an attempt to work round the problem with readshortcut I reported earlier, I thought I'd use a Perl script. Unfortunately the Win32::Shortcut package seems to cause problems with process forking (unlike the readshortcut error, this one isn't specific to the latest cygwin DLL). I get an error C:\cygwin\bin\perl.exe (3088): *** unable to remap C:\cygwin\lib\perl5\vendor_perl\5.8\cygwin\auto\Win32\Shortcut\Shortcut. dll to same address as parent(0xBF0000) != 0x1110000 13 [main] perl 3716 fork_parent: child 3088 died waiting for dll loading Here's an example that demonstrates the problem. #!/usr/bin/perl -w use strict; use Win32::Shortcut; if (my $pid= open (my $pipe, '-|')) { print "forked child process $pid\n"; while (<$pipe>) { print "from child: $_"; } close ($pipe) or die; } elsif (defined $pid) { print "this is the child\n"; exit; } else { print "fork failed: $!\n"; } Without the "use Win32::Shortcut", the script runs fine. With the package the fork fails with the error message I gave. Win32::Shortcut works fine if I don't fork or don't do it until after the package is loaded (eg. I can eval "require Win32::Shortcut" after the fork). I see this behaviour with Perl 5.8.6 and 5.8.7 and Cygwin 1.5.17-1 and 1.5.18-1. This error makes it a tricky to convert the Win32::Shortcut output to Cygwin-style paths with cygpath -u (without resorting to a separate program to parse the results). Or is there a Perl module that can do the cygpath conversion? That would be even nicer! Thanks, Tim. ============================== cut here ============================== Tim Adye, BaBar Group, Particle Physics Dept., _ /| Rutherford Appleton Laboratory, UK. \'o.O' Oop! e-mail: T DOT J DOT Adye AT rl DOT ac DOT uk =(___)= Ack! WWW: http://hepwww.rl.ac.uk/Delphi/Adye/homepage.html U Thphft! -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/