Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
myrkraverk(R)

04.11.2010, 23:39
 

Running the Perforce client with HX? (wsock32 fatal error) (DOSX)

Dear DOS users,

Using FreeDOS 1.0 and HX 2.17 I am unable to connect to an actual Perforce server. Running P4.EXE works fine, trying to connect to something that isn't there "works," but once there is an actual server at the designated port, dkrnl32 fails with exception C0000005 in module 'wsock32.dll'+2AE23.

Is there a way to find out what this is and fix it?

Additional notes: FreeDOS is running in VirtualBox. Network connections work; I am able to ssh back to the host from FreeDOS and both P4 and HX were downloaded directly with wget.

FreeDOS is 1.0 final fdfullcd.iso.

P4 is ftp://ftp.perforce.com/perforce/r10.1/bin.ntx86/p4.exe

HX is http://www.japheth.de/Download/HX/HXRT217.zip

Screenshot at http://www.myrkraverk.com/~johann/HX217+P4.png

Japheth(R)

Homepage

Germany (South),
05.11.2010, 12:38

@ myrkraverk

Running the Perforce client with HX? (wsock32 fatal error)

> Is there a way to find out what this is and fix it?

Of course.

The simplest approach is to use a debug version of wsock32.dll. It may give an idea at what socket call the problem arises. However, there's no debug version shipped with the package, I'd have to upload one onto japheth.de.

Another approach is to use a debugger. Even FD DebugX will be able to stop at the exception if certain conditions are met.

---
MS-DOS forever!

myrkraverk(R)

05.11.2010, 17:32

@ Japheth

Running the Perforce client with HX? (wsock32 fatal error)

> > Is there a way to find out what this is and fix it?
>
> The simplest approach is to use a debug version of wsock32.dll. It may give
> an idea at what socket call the problem arises. However, there's no debug
> version shipped with the package, I'd have to upload one onto japheth.de.

I'm game if you are.

> Another approach is to use a debugger. Even FD DebugX will be able to stop
> at the exception if certain conditions are met.

A naive attempt doesn't get me anywhere:

C:\download>hxldr32
HXLdr32 version 1.12
Copyright (C) Japheth 2004-2009
HXLdr32 already installed
C:\download>debug p4.exe -p 192.168.56.1:1669
-g
This program cannot be run in DOS mode.
Program terminated normally.
-q
C:\download>


I'll try to work on a non-naive attempt later.


Johann

Japheth(R)

Homepage

Germany (South),
05.11.2010, 17:45

@ myrkraverk

Running the Perforce client with HX? (wsock32 fatal error)

> > Another approach is to use a debugger. Even FD DebugX will be able to
> stop
> > at the exception if certain conditions are met.
>
> A naive attempt doesn't get me anywhere:
>
> C:\download>hxldr32
> HXLdr32 version 1.12
> Copyright (C) Japheth 2004-2009
> HXLdr32 already installed
> C:\download>debug p4.exe -p 192.168.56.1:1669
> -g
> This program cannot be run in DOS mode.
> Program terminated normally.
> -q
>


I mentioned "certain conditions" :-D . These are:

1. preload the DPMI host
2. set DKRNL32
3. use debugx & DPMILD32


C:\>hdpmi32
C:\>set dkrnl32=34
C:\>debugx dpmild32.exe p4.exe -p 192.168.56.1:1669

---
MS-DOS forever!

myrkraverk(R)

27.11.2010, 23:18

@ Japheth

Running the Perforce client with HX? (wsock32 fatal error)

I finally got around to spend some time on this.

It seems the problem is not when P4 connects, but rather when it has an actual IP address to connect to. It is when DNS lookups fail that I get a regular failure and an exception when it tries an IP address. Even when it's not reachable.

C:\download>p4
WSOCK32: Configuring through DHCP...Perforce client error:
        Connect to server failed; check $P4PORT.
        TCP connect to perforce failed.
        perforce: host unknown.
C:\download>p4
WSOCK32: Configuring through DHCP...
dkrnl32: exception C0000005, flags=0 occurred at BF:323E23
        ax=FFFFFFF8 bx=FFFFFFFC cx=10008 dx=10008
        si=FFFFFFFC di=10000 bp=1 sp=2D5AB8
        exception caused by access to memory address FFFFFFF8
        ip = Module 'wsock32.dll'+2AE23
        [eip] = 8B 00 24 FE 83 E8 04 C3 00 00 00 00
        [esp] = 002E0A27 000000BF 00003246 00000002 002D5698 002DF5CA
dkrnl32: fatal exit!


When I try to debug with debugx I get two different results, and I realize I have no idea what I'm doing with it so I think that's going to be a showstopper for me.

C:\download>hdpmi32
C:\download>set dkrnl32=34
C:\download>debugx hxrt217\bin\DPMILD32.EXE p4.exe -p 192.168.56.1:1666
-g
DPMI entry hooked, new entry=0D8C:02BC

DPMI loader version 3.8.0
Copyright (C) 1993-2009 Japheth

WSOCK32: Configuring through DHCP..Page fault
AX=FFF8 BX=FFFC CX=0008 DX=0008 SP=5AB8 BP=0001 SI=FFFC DI=0000
DS=00E7 ES=00E7 SS=00E7 CS=00DF IP=3E23 NV UP EI NG NZ NA PO NC
00DF:00323E23 8B00          MOV     EAX,[EAX]
#


Then when I try to run this again, I get (most of the time):

-g
DPMI entry hooked, new entry=0D8C:02BC

DPMI loader version 3.8.0
Copyright (C) 1993-2009 Japheth

WSOCK32: Configuring through DHCP..Exception 0E
EAX=FFFFFFF8 EBX=FFFFFFFC ECX=00010008 EDX=00010008 ESI=FFFFFFFC
EDI=00010000 EBP=00000001 ESP=002D5AB8 EFL=00003282 EIP=00323E23
CS=00BF (00000000,FFFFFFFF,C0FA) SS=00C7 (00000000,FFFFFFFF,C0F3)
DS=00C7 (00000000,FFFFFFFF,C0F3) ES=00C7 (00000000,FFFFFFFF,C0F3)
FS=00EF (001D4000,00000FFF,00F3) GS=0000 (********,********,****)
LDTR=0038 (FF80A000,00000FFF,0082) TR=0030 (000D9D08,00000067,008B)
ERRC=0004 (********,********,****) PTE 1. Page LDT=0047C467
GDTR=07FF:FF808800 IDTR=07FF:FF809000 PTE CR2=00000000
CR0=E0000033 CR2=FFFFFFF8 CR3=0046F000 CR4=00000200 TSS:ESP0=00000804
DR0-3=00000000 00000000 00000000 00000000 DR6=FFFF4FF0 DR7=00000400
LPMS Sel/Cnt=0087/0001 RMS=EFF3:0200 open RMCBs=0000/0000 ISR=0000
   [EIP]=8B 00 24 FE 83 E8 04 C3 00 00 00 00
   [ESP]=CAC6 0030 0001 0000 0000 0001 FFFC FFFF
002D5AC8=0FB8 0039 0000 0001 C24D 002F 0000 0001
002D5AD8=0000 0001 0E30 0039 5B4C 002D CCE1 002F
002D5AE8=0000 0001 1002 0000 0E30 0039 1002 0000
002D5AF8=0E30 0039 0E30 0039 CED6 002F FFFF 0000
002D5B08=0003 0000 5160 002F 0000 0001 0B5C 002F
terminate (c)lient or (s)erver now?


In addition, when I try to run it in dosbox, I have no WS2_32.DLL, where can I get one?

C:\>p4
DPMILD32: Module=WS2_32.dll
DPMILD32: File not found error
dpmild32: WS2_32.dll: cannot load PE file



Any help appreciated,

Johann

Japheth(R)

Homepage

Germany (South),
29.11.2010, 08:47
(edited by Japheth, 29.11.2010, 10:48)

@ myrkraverk

Running the Perforce client with HX? (wsock32 fatal error)

> dkrnl32: exception C0000005, flags=0 occurred at BF:323E23
> ax=FFFFFFF8 bx=FFFFFFFC cx=10008 dx=10008
> si=FFFFFFFC di=10000 bp=1 sp=2D5AB8
> exception caused by access to memory address FFFFFFF8
> ip = Module 'wsock32.dll'+2AE23
> [eip] = 8B 00 24 FE 83 E8 04 C3 00 00 00 00
> [esp] = 002E0A27 000000BF 00003246 00000002 002D5698 002DF5CA
> dkrnl32: fatal exit![/code]

According to the Wsock32.map file address 2AE23 is in the OW CRT, the "heap manager". This info most likely won't help much, it's too "low-level".

> When I try to debug with debugx I get two different results, and I realize
> I have no idea what I'm doing with it so I think that's going to be a
> showstopper for me.

The best thing to do at this point is to dump the current stack. This may display a code address which gives a hint in what socket function the GPF occurs.

> GDTR=07FF:FF808800 IDTR=07FF:FF809000 PTE CR2=00000000
> CR0=E0000033 CR2=FFFFFFF8 CR3=0046F000 CR4=00000200 TSS:ESP0=00000804
> DR0-3=00000000 00000000 00000000 00000000 DR6=FFFF4FF0 DR7=00000400
> LPMS Sel/Cnt=0087/0001 RMS=EFF3:0200 open RMCBs=0000/0000 ISR=0000
> [EIP]=8B 00 24 FE 83 E8 04 C3 00 00 00 00
> [ESP]=CAC6 0030 0001 0000 0000 0001 FFFC FFFF
> 002D5AC8=0FB8 0039 0000 0001 C24D 002F 0000 0001
> 002D5AD8=0000 0001 0E30 0039 5B4C 002D CCE1 002F
> 002D5AE8=0000 0001 1002 0000 0E30 0039 1002 0000
> 002D5AF8=0E30 0039 0E30 0039 CED6 002F FFFF 0000
> 002D5B08=0003 0000 5160 002F 0000 0001 0B5C 002F
> terminate (c)lient or (s)erver now?[/code]

This is the HDPMI exception dump. It contains a stack dump.

From the "dkrnl32" info block I can calculate the address where wsock32.dll is loaded: 323e23 - 2ae23 = 2F9000.

From the map file I can see that the code of wsock32.dll has about a size of 256 kB: 2F9000 + 40000 = 339000. So any address within the range 2F9000 - 339000 is probably a wsock32 code address.

In the hdpmi stack dump, I can see these addresses which are interesting candidates: 30CAC6, 2Fc24d, 2fcce1, 2fced6

> Any help appreciated,

Here's the wsock32.map:
-------------------------------------------------
sorry, it was rejected ( too large )
I will upload it onto my site ASAP.
edit: http://www.japheth.de/Download/HX/wsock32map.zip
-------------------------------------------------

---
MS-DOS forever!

Back to the board
Thread view  Mix view  Order
15112 Postings in 1359 Threads, 247 registered users, 18 users online (0 registered, 18 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum