Re: Cygwin + Python: unable to remap

2010-09-18 Thread Reini Urban

Al schrieb:

Or, read from stdin as follows:

$ something that generates extra DLL list | rebaseall -T - ...


As example, something that gernates extra DLL list looks in my case like this.

PREFIX=/home/prefix/gentoo
find $PREFIX/bin/ -name *.dll -o -name *.so
find $PREFIX/lib/ -name *.dll -o -name *.so
find $PREFIX/usr/bin -name *.dll -o -name *.so
find $PREFIX/usr/lib -name *.dll -o -name *.so

It turned out that not all files have write access. So a similar
script is required to add write access first.


You should really check out /bin/perlrebase which is a simple
application of a perl-based rebaseall with -T and more.

For python you might need to write a similar script.
--
Reini Urban
http://phpwiki.org/  http://murbreak.at/

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-17 Thread Reini Urban
2010/9/17 Mark Geisert:
 Al writes:
 2010/9/16 Mark Geisert:
       cygncurses5.dll = /home/prefix/gentoo/usr/bin/cygncurses5.dll
   (0x1000)
 
  This one is below the sixty million value that Reini described as
 suspicious.

 Now what do I make of that. Do I tell it to be loaded elsewhere? Any
 helpful link?

 You want 'rebase' from the 'rebase' package.  Use setup.exe to install it
 if you don't have it already.  After installation, it's documented in a
 text file /usr/share/doc/Cygwin/rebase*README.

 You get to choose the base address to rebase the dll to.  'rebaseall',
 from the same package, defaults to seventy million (= 0x7000) so that
 could be good.

 If you've built other dlls in the same directory you might as well run
 rebase or rebaseall on all of them to avoid future issues of this type.

It's not that simple :)

rebaseall only rebases the exact dll's which were installed from your
packager (setup.exe),
but not any other dll's used at run-time - shadowing system dll's as
in your case, or added dependencies as with perl or python.

python or perl are favorites adding additional dll's to your run-time
because you
can and should simply add external library bindings by yourself.

In your case the simpliest fix would be to remove your /home/prefix/gentoo...
prefix from your path.
Or, if you have to, rebase your added dll to the same address as the original.

imagebase:
objdump -p $1 |grep ImageBase |cut -c12-
-- 
Reini Urban
http://phpwiki.org/           http://murbreak.at/

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-17 Thread Al

 It's not that simple :)

 rebaseall only rebases the exact dll's which were installed from your
 packager (setup.exe),
 but not any other dll's used at run-time - shadowing system dll's as
 in your case, or added dependencies as with perl or python.

Hmmm, that leads to the conclusion, that I have to write a customized
rebaseall or a wrapper for it.


 python or perl are favorites adding additional dll's to your run-time
 because you
 can and should simply add external library bindings by yourself.

 In your case the simpliest fix would be to remove your /home/prefix/gentoo...
 prefix from your path.

My target is to get full controll of the sources, versions and patches.

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-17 Thread Jason Tishler
Al,

On Fri, Sep 17, 2010 at 11:24:10AM +0200, Al wrote:
  It's not that simple :)
 
  rebaseall only rebases the exact dll's which were installed from your
  packager (setup.exe),
  but not any other dll's used at run-time - shadowing system dll's as
  in your case, or added dependencies as with perl or python.
 
 Hmmm, that leads to the conclusion, that I have to write a customized
 rebaseall or a wrapper for it.

The rebase README indicates the following:

The following is the rebaseall command line syntax:

rebaseall [-b BaseAddress] [-o Offset] [-T FileList | -] [-v]

where:

-b = base address used by rebase (default: 0x7000)
-o = offset between each DLL rebased (default: 0x1)
-s = specify DLL suffix, use multiple if necessary (default: dll, so)
-T = specify filelist (or stdin) to list additional files
-v = verbose (default: off)

You just need to use the -T option and specify the addition DLLs to
rebase.

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-17 Thread Al

 The following is the rebaseall command line syntax:

    rebaseall [-b BaseAddress] [-o Offset] [-T FileList | -] [-v]

 where:

    -b = base address used by rebase (default: 0x7000)
    -o = offset between each DLL rebased (default: 0x1)
    -s = specify DLL suffix, use multiple if necessary (default: dll, so)
    -T = specify filelist (or stdin) to list additional files
    -v = verbose (default: off)

 You just need to use the -T option and specify the addition DLLs to
 rebase.


Thank you. I didn't read the readme, but I did read the sources.

As far as I understand it, it simply can use the -T option to add a
list of additional files from a wrapper.

Reini suggest to add the dll to the same address of the shadowed
packages. If I read the sources right, that is not even necessary, as
it bases all files in an incremental way.  I am currently working on
it.

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-17 Thread Al
 The rebase README indicates the following:

 The following is the rebaseall command line syntax:

    rebaseall [-b BaseAddress] [-o Offset] [-T FileList | -] [-v]

 where:

    -b = base address used by rebase (default: 0x7000)
    -o = offset between each DLL rebased (default: 0x1)
    -s = specify DLL suffix, use multiple if necessary (default: dll, so)
    -T = specify filelist (or stdin) to list additional files
    -v = verbose (default: off)

 You just need to use the -T option and specify the addition DLLs to
 rebase.

 Jason


Thank you very much. It seems to work. I currently recompile python
controlled by a python script. It that works in follow it is somewhat
selfcontained.

To give the future reader of this thread some additional value. I
first gave the DLL file itself to the -T parameter resulting in tons
of

: skipped because nonexistent
: skipped because nonexistent

That's because it did understand the dll as an input file with a list
of dlls. You have to write the dll path into a list file first and
give that file as parameter.

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-17 Thread Jason Tishler
On Fri, Sep 17, 2010 at 02:53:53PM +0200, Al wrote:
  You just need to use the -T option and specify the addition DLLs to
  rebase.
 
 Thank you very much.

You are quite welcome.

 [snip]
 
 To give the future reader of this thread some additional value. I
 first gave the DLL file itself to the -T parameter resulting in tons
 of
 
 : skipped because nonexistent
 : skipped because nonexistent
 
 That's because it did understand the dll as an input file with a list
 of dlls. You have to write the dll path into a list file first and
 give that file as parameter.

Or, read from stdin as follows:

$ something that generates extra DLL list | rebaseall -T - ...

Jason

-- 
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-17 Thread Al

 Or, read from stdin as follows:

    $ something that generates extra DLL list | rebaseall -T - ...


As example, something that gernates extra DLL list looks in my case like this.

PREFIX=/home/prefix/gentoo
find $PREFIX/bin/ -name *.dll -o -name *.so
find $PREFIX/lib/ -name *.dll -o -name *.so
find $PREFIX/usr/bin -name *.dll -o -name *.so
find $PREFIX/usr/lib -name *.dll -o -name *.so

It turned out that not all files have write access. So a similar
script is required to add write access first.

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Cygwin + Python: unable to remap

2010-09-16 Thread Al
Hello,

I knew in advance this would be one of the difficult points. I
compiled python and ncurses on a prefix. Now I get the following
error:

  2 [main] python2.6 1180
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x27 != 0x35

I tried to do rebaseall twice, but it doesn't solve it.

I can find postings on the web, where some related issues origin from
pythons caching mechanisms.

Does this rather look like a python or a cygwin issue? Any ideas how
to solve it?

Thanks

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-16 Thread Al
To give some additional information: If I run the program several
times (without rebasing in between) the addresses always change. I
don't see a pattern in it:

 2 [main] python2.6 384
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x3B != 0x99

  3 [main] python2.6 1012
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x35 != 0x99

  3 [main] python2.6 3576
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x35 != 0x99

  2 [main] python2.6 1672
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x35 != 0x36

  2 [main] python2.6 172
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x27 != 0x34

  2 [main] python2.6 3592
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x38 != 0x99

If the addresses change anyway rebasing doesn't seem to be the solution. Right?

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-16 Thread Reini Urban

Al schrieb:

To give some additional information: If I run the program several
times (without rebasing in between) the addresses always change. I
don't see a pattern in it:



   2 [main] python2.6 3592
P:\cygwin\home\prefix\gentoo\usr\bin\python2.6.exe: *** fatal error -
unable to remap P:\cygwin\home\prefix\gentoo\usr\bin\cygncurses5.dll
to same address as parent: 0x38 != 0x99

If the addresses change anyway rebasing doesn't seem to be the solution. Right?


Did rebaseall really succeed successfully?
Looks like one dll is at a wrong baseaddress. I often had /bin/cygz.dll 
wrong.


Everything below 0x6000 should be suspicious:
  ldd /bin/python.exe

  ldd /bin/bash
--
Reini Urban
http://phpwiki.org/  http://murbreak.at/

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-16 Thread Al

 Did rebaseall really succeed successfully?

I turned off Avira. Rebaseall was successfull (no warnings or else).
Did also reboot.

 Looks like one dll is at a wrong baseaddress. I often had /bin/cygz.dll
 wrong.

 Everything below 0x6000 should be suspicious:
  ldd /bin/python.exe

pre...@alder ~ $ ldd ~/gentoo/usr/bin/python2.6.exe
ntdll.dll = /cygdrive/c/Windows/system32/ntdll.dll (0x7796)
kernel32.dll = /cygdrive/c/Windows/system32/kernel32.dll (0x7788)
cygwin1.dll = /usr/bin/cygwin1.dll (0x6100)
ADVAPI32.DLL = /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x7603)
RPCRT4.dll = /cygdrive/c/Windows/system32/RPCRT4.dll (0x7729)
libpython2.6.dll =
/home/prefix/gentoo/usr/bin/libpython2.6.dll (0x67cc)
Secur32.dll = /cygdrive/c/Windows/system32/Secur32.dll (0x75ea)

  ldd /bin/bash

pre...@alder ~ $ ldd ~/gentoo/bin/bash.exe
ntdll.dll = /cygdrive/c/Windows/system32/ntdll.dll (0x7796)
kernel32.dll = /cygdrive/c/Windows/system32/kernel32.dll (0x7788)
cygncurses5.dll = /home/prefix/gentoo/usr/bin/cygncurses5.dll
(0x1000)
cygwin1.dll = /usr/bin/cygwin1.dll (0x6100)
ADVAPI32.DLL = /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x7603)
RPCRT4.dll = /cygdrive/c/Windows/system32/RPCRT4.dll (0x7729)
USER32.dll = /cygdrive/c/Windows/system32/USER32.dll (0x775a)
GDI32.dll = /cygdrive/c/Windows/system32/GDI32.dll (0x7610)
Secur32.dll = /cygdrive/c/Windows/system32/Secur32.dll (0x75ea)
IMM32.DLL = /cygdrive/c/Windows/system32/IMM32.DLL (0x7601)
MSCTF.dll = /cygdrive/c/Windows/system32/MSCTF.dll (0x7703)
msvcrt.dll = /cygdrive/c/Windows/system32/msvcrt.dll (0x77ab)
LPK.DLL = /cygdrive/c/Windows/system32/LPK.DLL (0x76c6)
USP10.dll = /cygdrive/c/Windows/system32/USP10.dll (0x7721)

Cygwin Python binary is working. Something must be wrong with my own
cygwin build I guess.

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-16 Thread Al

 Cygwin Python binary is working. Something must be wrong with my own
 cygwin build I guess.

correct: ... with my own Python build ...

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-16 Thread Al
To compare both:

 Everything below 0x6000 should be suspicious:
  ldd /bin/python.exe

 pre...@alder ~ $ ldd ~/gentoo/usr/bin/python2.6.exe
        ntdll.dll = /cygdrive/c/Windows/system32/ntdll.dll (0x7796)
        kernel32.dll = /cygdrive/c/Windows/system32/kernel32.dll (0x7788)
        cygwin1.dll = /usr/bin/cygwin1.dll (0x6100)
        ADVAPI32.DLL = /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x7603)
        RPCRT4.dll = /cygdrive/c/Windows/system32/RPCRT4.dll (0x7729)
        libpython2.6.dll =
 /home/prefix/gentoo/usr/bin/libpython2.6.dll (0x67cc)
        Secur32.dll = /cygdrive/c/Windows/system32/Secur32.dll (0x75ea)

pre...@alder ~ $ ldd /usr/bin/python.exe
ntdll.dll = /cygdrive/c/Windows/system32/ntdll.dll (0x7796)
kernel32.dll = /cygdrive/c/Windows/system32/kernel32.dll (0x7788)
cygwin1.dll = /usr/bin/cygwin1.dll (0x6100)
ADVAPI32.DLL = /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x7603)
RPCRT4.dll = /cygdrive/c/Windows/system32/RPCRT4.dll (0x7729)
cyggcc_s-1.dll = /usr/bin/cyggcc_s-1.dll (0x6fc1)
libpython2.6.dll = /usr/bin/libpython2.6.dll (0x6ddb)
Secur32.dll = /cygdrive/c/Windows/system32/Secur32.dll (0x75ea)


  ldd /bin/bash

 pre...@alder ~ $ ldd ~/gentoo/bin/bash.exe
        ntdll.dll = /cygdrive/c/Windows/system32/ntdll.dll (0x7796)
        kernel32.dll = /cygdrive/c/Windows/system32/kernel32.dll (0x7788)
        cygncurses5.dll = /home/prefix/gentoo/usr/bin/cygncurses5.dll
 (0x1000)
        cygwin1.dll = /usr/bin/cygwin1.dll (0x6100)
        ADVAPI32.DLL = /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x7603)
        RPCRT4.dll = /cygdrive/c/Windows/system32/RPCRT4.dll (0x7729)
        USER32.dll = /cygdrive/c/Windows/system32/USER32.dll (0x775a)
        GDI32.dll = /cygdrive/c/Windows/system32/GDI32.dll (0x7610)
        Secur32.dll = /cygdrive/c/Windows/system32/Secur32.dll (0x75ea)
        IMM32.DLL = /cygdrive/c/Windows/system32/IMM32.DLL (0x7601)
        MSCTF.dll = /cygdrive/c/Windows/system32/MSCTF.dll (0x7703)
        msvcrt.dll = /cygdrive/c/Windows/system32/msvcrt.dll (0x77ab)
        LPK.DLL = /cygdrive/c/Windows/system32/LPK.DLL (0x76c6)
        USP10.dll = /cygdrive/c/Windows/system32/USP10.dll (0x7721)


pre...@alder ~ $ ldd /bin/bash.exe
ntdll.dll = /cygdrive/c/Windows/system32/ntdll.dll (0x7796)
kernel32.dll = /cygdrive/c/Windows/system32/kernel32.dll (0x7788)
cyggcc_s-1.dll = /usr/bin/cyggcc_s-1.dll (0x6fc1)
cygwin1.dll = /usr/bin/cygwin1.dll (0x6100)
ADVAPI32.DLL = /cygdrive/c/Windows/system32/ADVAPI32.DLL (0x7603)
RPCRT4.dll = /cygdrive/c/Windows/system32/RPCRT4.dll (0x7729)
cygintl-8.dll = /usr/bin/cygintl-8.dll (0x6f97)
cygiconv-2.dll = /usr/bin/cygiconv-2.dll (0x6fa0)
cygreadline7.dll = /usr/bin/cygreadline7.dll (0x6caa)
cygncurses-9.dll = /usr/bin/cygncurses-9.dll (0x6f69)
USER32.dll = /cygdrive/c/Windows/system32/USER32.dll (0x775a)
GDI32.dll = /cygdrive/c/Windows/system32/GDI32.dll (0x7610)
Secur32.dll = /cygdrive/c/Windows/system32/Secur32.dll (0x75ea)
IMM32.DLL = /cygdrive/c/Windows/system32/IMM32.DLL (0x7601)
MSCTF.dll = /cygdrive/c/Windows/system32/MSCTF.dll (0x7703)
msvcrt.dll = /cygdrive/c/Windows/system32/msvcrt.dll (0x77ab)
LPK.DLL = /cygdrive/c/Windows/system32/LPK.DLL (0x76c6)
USP10.dll = /cygdrive/c/Windows/system32/USP10.dll (0x7721)

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-16 Thread Al
2010/9/16 Mark Geisert m...@maxrnd.com:
   ldd /bin/bash
 
  prefix at Alder ~ $ ldd ~/gentoo/bin/bash.exe
         ntdll.dll = /cygdrive/c/Windows/system32/ntdll.dll (0x7796)
         kernel32.dll = /cygdrive/c/Windows/system32/kernel32.dll 
  (0x7788)
         cygncurses5.dll = /home/prefix/gentoo/usr/bin/cygncurses5.dll
  (0x1000)

 This one is below the sixty million value that Reini described as suspicious.


Thank you. Indeed. I shouldn't have overseen that, as it is the
ncurses.dll itself.

Now what do I make of that. Do I tell it to be loaded elsewhere? Any
helpful link?

Sure I will search my own, now I have a direction.

Al

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Cygwin + Python: unable to remap

2010-09-16 Thread Mark Geisert
Al writes:
 2010/9/16 Mark Geisert  at XX.XXX:

Please don't feed the spammers.

   cygncurses5.dll = /home/prefix/gentoo/usr/bin/cygncurses5.dll
   (0x1000)
 
  This one is below the sixty million value that Reini described as
suspicious.
 
 Now what do I make of that. Do I tell it to be loaded elsewhere? Any
 helpful link?

You want 'rebase' from the 'rebase' package.  Use setup.exe to install it
if you don't have it already.  After installation, it's documented in a
text file /usr/share/doc/Cygwin/rebase*README.

You get to choose the base address to rebase the dll to.  'rebaseall',
from the same package, defaults to seventy million (= 0x7000) so that
could be good.

If you've built other dlls in the same directory you might as well run
rebase or rebaseall on all of them to avoid future issues of this type.

..mark


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple