Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
post-factum

Homepage

/ukraine/kyiv,
09.12.2008, 21:14
 

HX + FPC 2.2.2 == trouble (DOSX)

There's a trouble with running binaries under FreeDOS, which are compiled by FreePascal Compiler 2.2.2. When the binary is started to load (via TSR loader or not), it crashes. The most interesting is that fpc 2.2.0 produced binaries that run without any problem ("hello world" or some big projects - doesn`t matter).

I tried several versions of HX Runtime, old and the newest, but the result is the same. Here is a screenshot:

===screenshot===

If I build a binary with -WR (relocateable), it hangs without any error reporting.

Is that a problem of FPC or HX and how can I fix it?

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

Laaca

Homepage

Czech republic,
09.12.2008, 22:05

@ post-factum

HX + FPC 2.2.2 == trouble

I use FPC 2.2.2 and FPC 2.2.2 compiled programs often but I haven't noticed any incompatibility with HX. You should make a test onreal hardware, not in emulator under Vista.

---
DOS-u-akbar!

rr

Homepage E-mail

Berlin, Germany,
09.12.2008, 22:23

@ Laaca

HX + FPC 2.2.2 == trouble

> I use FPC 2.2.2 and FPC 2.2.2 compiled programs often but I haven't noticed
> any incompatibility with HX. You should make a test onreal hardware, not in
> emulator under Vista.

AFAIK "DOS in a box" comes from DOSEMU. So he's running Linux, not Vista.

---
Forum admin

post-factum

Homepage

/ukraine/kyiv,
09.12.2008, 22:30

@ rr

HX + FPC 2.2.2 == trouble

> AFAIK "DOS in a box" comes from DOSEMU. So he's running Linux, not Vista.

Correct, I use only Linux.

BTW, the same problem appears not only in DOSEMU, but also in qemu, bochs and VirtualBox.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

Japheth

Homepage

Germany (South),
10.12.2008, 08:52

@ post-factum

HX + FPC 2.2.2 == trouble

> I tried several versions of HX Runtime, old and the newest, but the result
> is the same. Here is a screenshot:
>
> ===screenshot===
>
> If I build a binary with -WR (relocateable), it hangs without any error
> reporting.
>
> Is that a problem of FPC or HX and how can I fix it?

exception C0000005 is an access violation. You can probably catch this exception from inside your Pascal program ( in C, it's "signal( SIGSEGV )" ).

---
MS-DOS forever!

post-factum

Homepage

/ukraine/kyiv,
10.12.2008, 10:18

@ Japheth

HX + FPC 2.2.2 == trouble

> exception C0000005 is an access violation. You can probably catch this
> exception from inside your Pascal program ( in C, it's "signal( SIGSEGV )"
> ).

The problem is that the program cannot be loaded without crash. Even if I write an empty program, compile it (binary that do nothing), it won't be loaded.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

Laaca

Homepage

Czech republic,
10.12.2008, 10:54

@ post-factum

HX + FPC 2.2.2 == trouble

Hm, are you sure you use the same parameters for compilation like with FPC 2.2.0?

---
DOS-u-akbar!

Japheth

Homepage

Germany (South),
10.12.2008, 11:33

@ post-factum

HX + FPC 2.2.2 == trouble

> The problem is that the program cannot be loaded without crash. Even if I
> write an empty program, compile it (binary that do nothing), it won't be
> loaded.

Then please send such a binary, mail address see at www.japheth.de!

---
MS-DOS forever!

post-factum

Homepage

/ukraine/kyiv,
10.12.2008, 16:12

@ Laaca

HX + FPC 2.2.2 == trouble

> Hm, are you sure you use the same parameters for compilation like with FPC
> 2.2.0?

Yeah, the same. Also tried with no parameters.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

post-factum

Homepage

/ukraine/kyiv,
10.12.2008, 16:17

@ Japheth

HX + FPC 2.2.2 == trouble

> Then please send such a binary, mail address see at www.japheth.de!

I've sent it.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

Japheth

Homepage

Germany (South),
11.12.2008, 00:43

@ post-factum

HX + FPC 2.2.2 == trouble

> I've sent it.

Thanks!

Running the binary with a debug version of the Win32 kernel dll showed that Win32 function GetModuleHandle() failed. The function is fed with the full path of a binary. The call failed and the calling code apparently doesn't expect this function to fail.

A small fix in DPMILD32.EXE will be necessary.

---
MS-DOS forever!

post-factum

Homepage

/ukraine/kyiv,
11.12.2008, 14:28

@ Japheth

HX + FPC 2.2.2 == trouble

> A small fix in DPMILD32.EXE will be necessary.

When will you do it?

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

Japheth

Homepage

Germany (South),
11.12.2008, 15:01

@ post-factum

HX + FPC 2.2.2 == trouble

> > A small fix in DPMILD32.EXE will be necessary.
>
> When will you do it?

I added a test version of dpmild32 into the hxrt WIP package (hxrtd.zip).

---
MS-DOS forever!

marcov

11.12.2008, 15:15

@ Japheth

HX + FPC 2.2.2 == trouble

> > I've sent it.
>
> Thanks!
>
> Running the binary with a debug version of the Win32 kernel dll showed
> that Win32 function GetModuleHandle() failed. The function is fed with the
> full path of a binary. The call failed and the calling code apparently
> doesn't expect this function to fail.

Well, that can indicate a problem (bad errorchecking) in FPC too. Which call exactly?

> A small fix in DPMILD32.EXE will be necessary.

post-factum

Homepage

/ukraine/kyiv,
11.12.2008, 18:13
(edited by post-factum, 11.12.2008, 18:23)

@ Japheth

HX + FPC 2.2.2 == trouble

> I added a test version of dpmild32 into the hxrt WIP package (hxrtd.zip).

Thanks, it fixes a problem, but my large program with several threads still crashes (after loading). Could it be HX problem, or FPC problem? It have never happened before.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

Laaca

Homepage

Czech republic,
11.12.2008, 22:46

@ post-factum

HX + FPC 2.2.2 == trouble

Well, you haven't written that you don't use the GO32V2 version but WIN32 version. I don't use the win version I have no experience about it.

---
DOS-u-akbar!

post-factum

Homepage

/ukraine/kyiv,
11.12.2008, 22:51

@ Laaca

HX + FPC 2.2.2 == trouble

> Well, you haven't written that you don't use the GO32V2 version but WIN32
> version. I don't use the win version I have no experience about it.

Of course, I use win32 version, otherwise I don't need hx :).

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

post-factum

Homepage

/ukraine/kyiv,
11.12.2008, 23:42

@ post-factum

HX + FPC 2.2.2 == trouble

> Thanks, it fixes a problem, but my large program with several threads
> still crashes (after loading). Could it be HX problem, or FPC problem? It
> have never happened before.

Sorry, everything works great now. It was an «improvement» of new FPC, where such a trick like sleep(-1) doesn't work in a proper way anymore.

Thanks for fixing a bug in hx.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

marcov

14.12.2008, 16:54

@ post-factum

HX + FPC 2.2.2 == trouble

> > Thanks, it fixes a problem, but my large program with several threads
> > still crashes (after loading). Could it be HX problem, or FPC problem?
> It
> > have never happened before.
>
> Sorry, everything works great now. It was an «improvement» of new FPC,
> where such a trick like sleep(-1) doesn't work in a proper way anymore.

That is new for me, since afaik on windows, sleep is directly passed to windows.

What is sleep(-1) supposed to do according to you?

post-factum

Homepage

/ukraine/kyiv,
19.12.2008, 19:32

@ marcov

HX + FPC 2.2.2 == trouble

> That is new for me, since afaik on windows, sleep is directly passed to
> windows.
>
> What is sleep(-1) supposed to do according to you?

It paused thread execution. Just waiting infinite time.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

marcov

21.12.2008, 14:28

@ post-factum

HX + FPC 2.2.2 == trouble

> > That is new for me, since afaik on windows, sleep is directly passed to
> > windows.
> >
> > What is sleep(-1) supposed to do according to you?
>
> It paused thread execution. Just waiting infinite time.

Procedure Sleep(Milliseconds : Cardinal);

begin
Windows.Sleep(MilliSeconds)
end;

The above snip comes from current sources, nothing has changed apparantly. I think you need to search for your problem somewhere else.

Japheth

Homepage

Germany (South),
21.12.2008, 14:59

@ post-factum

HX + FPC 2.2.2 == trouble

> > That is new for me, since afaik on windows, sleep is directly passed to
> > windows.
> >
> > What is sleep(-1) supposed to do according to you?
>
> It paused thread execution. Just waiting infinite time.

But sleep(-1) is no "trick", it's documented. -1 is the value of INFINITE, defined in the Win32 SDK.

---
MS-DOS forever!

post-factum

Homepage

/ukraine/kyiv,
23.12.2008, 12:56

@ Japheth

HX + FPC 2.2.2 == trouble

> But sleep(-1) is no "trick", it's documented. -1 is the value of INFINITE,
> defined in the Win32 SDK.

But it doesn't work :(.

---
% uname -a
Linux eternity 3.0.1-pf #1 SMP PREEMPT Fri Aug 5 21:45:05 EEST 2011 i686 Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz GenuineIntel GNU/Linux

marcov

23.12.2008, 22:24

@ post-factum

HX + FPC 2.2.2 == trouble

> > But sleep(-1) is no "trick", it's documented. -1 is the value of
> INFINITE,
> > defined in the Win32 SDK.
>
> But it doesn't work :(.

File a bugreport with Microsoft. We pass it to windows.

Back to the board
Thread view  Mix view  Order
22049 Postings in 2034 Threads, 396 registered users, 262 users online (1 registered, 261 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum