Board index » delphi » Unexpected heap overflow in protected mode program compiled by BP7
gkoma
![]() Delphi Developer |
Mon, 28 Feb 2005 19:39:39 GMT
|
gkoma
![]() Delphi Developer |
Mon, 28 Feb 2005 19:39:39 GMT
Unexpected heap overflow in protected mode program compiled by BP7I use Borland Pascal 7.0 and comile protected mode SW. Below simple program crashes with heap overflow error even when there is {$F+,O+} Program HeapTest; {$M 65520,0,655360} Const Max_X=1650; type const ii=100; Begin -- |
Wolf Behrenhof
![]() Delphi Developer |
Mon, 28 Feb 2005 20:41:55 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7Quotegkomar wrote: Quote> for x:=0 to Max_X do New(M^[x]); I guess your program is supposed to allocate about 42MB RAM. This is not Wolf |
gkoma
![]() Delphi Developer |
Mon, 28 Feb 2005 21:39:03 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7Dear Wolf, It isn't about strings, sligthly modifying the source: Const Max_X=1650; type const ii=10000; Begin it still crashes. By the way it is only a small demo to demonstrate the Thanks for the reply though, -- |
Marco van de Voor
![]() Delphi Developer |
Mon, 28 Feb 2005 23:45:13 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7QuoteIn article <1806494.1031837...@dbforums.com>, gkomar wrote: e.g. FPC ? |
Wolf Behrenhof
![]() Delphi Developer |
Tue, 01 Mar 2005 01:59:29 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7Quotegkomar wrote: array)! So I can't reproduce a bug. What exactly is your problem? Can you post a program that compiles? (then copy+paste, please) If your problem is compiling: Pascal is not C, an array is not a pointer! Wolf |
Femme Verbee
![]() Delphi Developer |
Tue, 01 Mar 2005 03:08:55 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7"gkomar" <mem...@dbforums.com> schreef in bericht Quote
I had to modify you program a little for the faulty adressing of M[..] But the secret is in Hheaplimit and Heapblock Now you can use 64 mb of memory. -- {$F+,O+} Program HeapTest; {$M 65520,0,655360} Const Max_X=1650; type const ii=100; Begin |
gkoma
![]() Delphi Developer |
Tue, 01 Mar 2005 02:55:19 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7Wolf, Of course it compiles. Yes M is an array not a pointer, but every array My problem is that it crashes even though I still have DPMI memory Marco, In the program that I encountered this bug needs a lot of memory to be Gyula -- |
Marco van de Voor
![]() Delphi Developer |
Tue, 01 Mar 2005 04:30:07 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7QuoteIn article <1807915.1031856...@dbforums.com>, gkomar wrote: FPC doesn't eat it (can't BP under *nix), Quote> My problem is that it crashes even though I still have DPMI memory by the RTL. Because memory was expensive in '92 (release date BP), the default values are just somewhat conservative. Quote> Marco, problem till 64 MB, by the methods Femme posted, which has been discussed and tested before. But that wasn't the question. The question is why a different compiler |
Femme Verbee
![]() Delphi Developer |
Tue, 01 Mar 2005 08:16:21 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7"Marco van de Voort" <mar...@toad.stack.nl> schreef in bericht Quote> In article <1807915.1031856...@dbforums.com>, gkomar wrote: refused to compile New(M); since M is not a pointer variable. Quote> > My problem is that it crashes even though I still have DPMI memory the solution in my other posting. Quote> Not really, it is a flaw of the 286 DPMI system, but it can be worked available memory. Not a BP bug, but a Windows feature [;-} Quote
Femme |
gkoma
![]() Delphi Developer |
Tue, 01 Mar 2005 15:23:20 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7Quote>This is probably due to the maximal selector limit, and one can stall tested before. I am not able to find these discussions, can you direct me how to locate Quote>But that wasn't the question. The question is why a different I tried to use Free Pascal, but my program does extensive hardware -- |
Marco van de Voor
![]() Delphi Developer |
Tue, 01 Mar 2005 18:50:41 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7QuoteIn article <1810086.1031901...@dbforums.com>, gkomar wrote: this group on groups.google.com Quote>>But that wasn't the question. The question is why a different can remain Dos in first approx. |
gkoma
![]() Delphi Developer |
Tue, 01 Mar 2005 19:35:42 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7Thanks Marco -- |
Femme Verbee
![]() Delphi Developer |
Tue, 01 Mar 2005 21:38:46 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7"gkomar" <mem...@dbforums.com> schreef in bericht Quote
the server. Look for it in Google / newgroups. I believe the discussion was called "More memory" Femme |
gkoma
![]() Delphi Developer |
Tue, 01 Mar 2005 23:31:36 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7Dear Femme, I have already found the article, thank you. And it did solve my Gyula -- |
Georg {*word*259}le
![]() Delphi Developer |
Sun, 06 Mar 2005 05:05:21 GMT
Re:Unexpected heap overflow in protected mode program compiled by BP7I come late, but in: Quote> {$F+,O+} Program HeapTest; {$M 65520,0,655360} 100.000.000 pointers and isn't that too much even for 64 MB ? Georg. |
1. BP7: DLL in DOS protected mode program
2. BP7 protected mode chain to another program
3. program tracing in BP7, protected mode
4. Getting TP to compile a DOS program in Protected Mode
5. BP7: Heap overflow with Memavail>4MB
6. BP7 + Protected mode apps + Windows 95/98 = slowdown
7. BP7 Protected Mode Problems
8. Allocating memory under protected mode (BP7)