public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Adye, TJ \(Tim\)" <T.J.Adye@rl.ac.uk>
To: <cygwin@cygwin.com>
Subject: Perl Win32::Shortcut screws up fork
Date: Thu, 07 Jul 2005 17:10:00 -0000	[thread overview]
Message-ID: <7231C15EAC2F164CA6DC326D97493C8BA1C3F1@exchange35.fed.cclrc.ac.uk> (raw)

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.J.Adye@rl.ac.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/

             reply	other threads:[~2005-07-07 17:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-07 17:10 Adye, TJ (Tim) [this message]
     [not found] ` <7231C15EAC2F164CA6DC326D97493C8BA1C3F1@exchange35.fed.cclr  c.ac.uk>
2005-07-07 18:09   ` Larry Hall
2005-07-07 18:29     ` question for perl maintainer Christopher Faylor
2005-07-07 20:47       ` Gerrit P. Haase
2005-07-07 21:12         ` Gerrit P. Haase
2005-07-07 21:50           ` Christopher Faylor
2005-07-08  9:53             ` Gerrit P. Haase
2005-07-08 12:27               ` Christopher Faylor
2005-07-08 15:22                 ` Gerrit P. Haase
2005-07-08 17:27                   ` Corinna Vinschen
2005-07-08 17:47                     ` Gerrit P. Haase
2005-07-08 17:53                       ` Corinna Vinschen
     [not found]                     ` <20050708173253.GG18981@trixie.casa.cgf.cx>
     [not found]                       ` <0add01c583e4$6d667320$3e0010ac@wirelessworld.airvananet.com>
     [not found]                         ` <20050708180417.GK18981@trixie.casa.cgf.cx>
     [not found]                           ` <20050711130656.GD3856@tishler.net>
     [not found]                             ` <0bdb01c5861d$429e2080$3e0010ac@wirelessworld.airvananet.com>
     [not found]                               ` <20050711134355.GG3856@tishler.net>
     [not found]                                 ` <42D28927.7010401@familiehaase.de>
     [not found]                                   ` <20050711150703.GA444@tishler.net>
2005-07-11 22:55                                     ` Observation for ALL maintainers who provide dlls (was Re: question for perl maintainer) Gerrit P. Haase
2005-07-11 12:30           ` question for perl maintainer Jason Tishler
2005-07-07 21:49         ` Christopher Faylor
2005-07-07 19:06 Perl Win32::Shortcut screws up fork Adye, TJ (Tim)
     [not found] ` <7231C15EAC2F164CA6DC326D97493C8BA1C3FA@exchange35.fed.cclr  c.ac.uk>
2005-07-08  0:12   ` Larry Hall
2005-07-08  1:11 ` Brian Dessent
2005-07-08  1:19   ` Christopher Faylor
2005-07-08  1:40     ` Brian Dessent
2005-07-08  2:05       ` Eric Blake
2005-07-08  2:27         ` Brian Dessent
2005-07-08  2:38           ` Eric Blake
2005-07-08  2:54             ` Brian Dessent
2005-07-08  2:06       ` Christopher Faylor
2005-07-08  2:21         ` Igor Pechtchanski
2005-07-08  3:45           ` Christopher Faylor
2005-07-08  2:24         ` Eric Blake
2005-07-08  3:50           ` Christopher Faylor
2005-07-08  9:48             ` Gerrit P. Haase
2005-07-11 12:45             ` Jason Tishler
2005-07-12  2:08               ` Christopher Faylor
2005-07-08  1:35   ` Eric Blake
2005-07-08  2:27     ` Brian Dessent
2005-07-07 19:13 Adye, TJ (Tim)
2005-07-08  8:17 ` Reini Urban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7231C15EAC2F164CA6DC326D97493C8BA1C3F1@exchange35.fed.cclrc.ac.uk \
    --to=t.j.adye@rl.ac.uk \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).