This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: get windows error message 0xc0000142 on starting cygwin app


> >>
> >> On Wed, Sep 19, 2001 at 09:26:41AM +0200, Ralf Habacker wrote:
> >> >Hi,
> >> >
> >> >currently I'm compiling kde2 apps with cygwin and xfree and have a problem
> >> >loading dll's.
> >> >The problem is that on loading the app the windows runtime loader
> >> breaks with a
> >> >error message
> >> >"Die Anwendung konnte nicht richtig initialisiert werden (0xc0000142)"
> >> >
> >> >gdb says something about an unknown target exception:
> >> >--------------------------------------------------------
> >> >$ gdb -nw kicker.exe
> >> >GNU gdb 5.0 (20010428-1)
> >> >(gdb) r
> >> >Starting program: /opt/kde2/bin/kicker.exe
> >> >gdb: unknown target exception 0xc0000142 at 0x77fb00ac
> >> >
> >> >Program received signal ?, Unknown signal.
> >> >0x77fb00ac in ?? ()
> >> >(gdb) q
> >> >The program is running.  Exit anyway? (y or n) y
> >> >--------------------------------------------------------
> >> >
> >> >I have searched in the microsoft knowledge base, but what I found
> isn't very
> >> >much. :-(
> >> >
> >> >--------------------------------------------------------
> >> >Error Message:
> >> >(Application Error) The application failed to initialize properly
> >> (0xaddress ).
> >> >Click on OK to terminate the application.
> >> >User Action:
> >> >This is a Windows 2000 Executive STATUS error message. After you
> >> terminate the
> >> >application, try running it again. If this message reappears, contact the
> >> >supplier of the application.
> >> >--------------------------------------------------------
> >> >
> >> >What I have found that this problem occures while the dynamic linker
> >> (ntdll) is
> >> >working shown below.
> >> >The exception is raised by a "leave" instruction, but I
> >>
> >> Sounds like a corrupted stack.
> >>
> >You mean, because of loading so many dll's there is an application stack
> >overflow ?
>
> No, I mean that an instruction that manipulates the stack results in an
> error.  That indicates to me that the stack pointer is screwed up.
>
But that would be code in the ntdll.dll or kernel32.dll ? But as I understand
does this code uses the stack of the current process, that is for example bash
or ssp or gdb, isn't it ?
2. objdump shows that ld by default reserves about 2MB for the dll and exe
stack.
Isn't this enough ?

3. Do you know where I can find informations (online docu) about the pe format ?
I have recognized
some differences in the header like a native win32 app and a ld produced app.
For example
the "Subsystem" field differs. Perhaps this is a relocation problem.
Do you know any way to verify this guess ?

Ralf


-- native win 32app ---------------------------------------------
$ objdump -x /c/programme/ULTRAEDT/uedit32.exe

/c/programme/ULTRAEDT/uedit32.exe:     file format pei-i386
/c/programme/ULTRAEDT/uedit32.exe
architecture: i386, flags 0x0000010a:
EXEC_P, HAS_DEBUG, D_PAGED
start address 0x00473dc8

Characteristics 0x10f
        relocations stripped
        executable
        line numbers stripped
        symbols stripped
        32 bit words

Time/Date               Tue Aug  3 17:08:41 1999

ImageBase               00400000
SectionAlignment        00001000
FileAlignment           00001000
MajorOSystemVersion     4
MinorOSystemVersion     0
MajorImageVersion       0
MinorImageVersion       0
MajorSubsystemVersion   4
MinorSubsystemVersion   0
Win32Version            00000000
SizeOfImage             0011d000
SizeOfHeaders           00001000
CheckSum                00000000
Subsystem               00000002        (Windows GUI)
DllCharacteristics      00000000
SizeOfStackReserve      0001a240
SizeOfStackCommit       00001000
SizeOfHeapReserve       00100000
SizeOfHeapCommit        00001000
LoaderFlags             00000000
NumberOfRvaAndSizes     00000010

The Data Directory
Entry 0 00000000 00000000 Export Directory [.edata (or where ever we found it)]
Entry 1 000cece0 000000dc Import Directory [parts of .idata]
Entry 2 000e9000 00033468 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 00000000 00000000 Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 000b1000 00000868 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 Reserved
Entry f 00000000 00000000 Reserved

--- kde app --------------------------------------------------
$ objdump -x /opt/kde2/bin/khexedit.exe

/opt/kde2/bin/khexedit.exe:     file format pei-i386
/opt/kde2/bin/khexedit.exe
architecture: i386, flags 0x00000102:
EXEC_P, D_PAGED
start address 0x00401000

Characteristics 0x20f
        relocations stripped
        executable
        line numbers stripped
        symbols stripped
        debugging information removed

Time/Date               Wed Sep 19 14:28:39 2001

ImageBase               00400000
SectionAlignment        00001000
FileAlignment           00000200
MajorOSystemVersion     4
MinorOSystemVersion     0
MajorImageVersion       1
MinorImageVersion       0
MajorSubsystemVersion   4
MinorSubsystemVersion   0
Win32Version            00000000
SizeOfImage             00132000
SizeOfHeaders           00000400
CheckSum                00000000
Subsystem               00000003        (Windows CUI)
DllCharacteristics      00000000
SizeOfStackReserve      00200000
SizeOfStackCommit       00001000
SizeOfHeapReserve       00100000
SizeOfHeapCommit        00001000
LoaderFlags             00000000
NumberOfRvaAndSizes     00000010

The Data Directory
Entry 0 00000000 00000000 Export Directory [.edata (or where ever we found it)]
Entry 1 00115000 0001c688 Import Directory [parts of .idata]
Entry 2 00000000 00000000 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 00000000 00000000 Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 00000000 00000000 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 Reserved
Entry f 00000000 00000000 Reserved

There is an import table in .idata at 0x515000

---- kde dll -------------------
$ objdump -x /opt/kde2/bin/cygkdecore-3.dll

/opt/kde2/bin/cygkdecore-3.dll:     file format pei-i386
/opt/kde2/bin/cygkdecore-3.dll
architecture: i386, flags 0x00000103:
HAS_RELOC, EXEC_P, D_PAGED
start address 0x6d84bd2c

Characteristics 0x220e
        executable
        line numbers stripped
        symbols stripped
        debugging information removed
        DLL

Time/Date               Tue Sep 18 20:13:52 2001

ImageBase               6d740000
SectionAlignment        00001000
FileAlignment           00000200
MajorOSystemVersion     4
MinorOSystemVersion     0
MajorImageVersion       1
MinorImageVersion       0
MajorSubsystemVersion   4
MinorSubsystemVersion   0
Win32Version            00000000
SizeOfImage             00198000
SizeOfHeaders           00000400
CheckSum                00000000
Subsystem               00000003        (Windows CUI)
DllCharacteristics      00000000
SizeOfStackReserve      00200000
SizeOfStackCommit       00001000
SizeOfHeapReserve       00100000
SizeOfHeapCommit        00001000
LoaderFlags             00000000
NumberOfRvaAndSizes     00000010

The Data Directory
Entry 0 00137000 0001fc6e Export Directory [.edata (or where ever we found it)]
Entry 1 00157000 000348e8 Import Directory [parts of .idata]
Entry 2 00000000 00000000 Resource Directory [.rsrc]
Entry 3 00000000 00000000 Exception Directory [.pdata]
Entry 4 00000000 00000000 Security Directory
Entry 5 0018c000 0000b22c Base Relocation Directory [.reloc]
Entry 6 00000000 00000000 Debug Directory
Entry 7 00000000 00000000 Description Directory
Entry 8 00000000 00000000 Special Directory
Entry 9 00000000 00000000 Thread Storage Directory [.tls]
Entry a 00000000 00000000 Load Configuration Directory
Entry b 00000000 00000000 Bound Import Directory
Entry c 00000000 00000000 Import Address Table Directory
Entry d 00000000 00000000 Delay Import Directory
Entry e 00000000 00000000 Reserved
Entry f 00000000 00000000 Reserved




> cgf
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]