TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Edwards
from: Mario Semo
date: 1996-10-18 08:07:20
subject: C600BUG.TXT

Hello Paul,

On Oct 15 02:15 96, Paul Edwards of 3:711/934.9 wrote:

 PE> A problem was reported to me, about MSC 6.0 not being able 
 PE> to compile a program with 5 nested include header files 
 PE> (it's documented as being able to do 9).  About 20 hours of 
 PE> work later, here is why:

ok. now i see. prior it assumed your code runs out of file handles.

 PE> There is a bug in the MSC 6.0 runtime library, e.g. the 
 PE> file LLIBCEP.LIB.  The bug is that in the open() function 
 PE> (which is called by fopen), they first of all call DosOpen, 
 PE> and then check that the file handle returned by DosOpen is 
 PE> less than their internal limit of the number of FILE handles 

exactly. here's the source:



        call    DOSOPEN         ; try to open

        or      ax,ax           ; did it work?
        jz      CheckHandle     ; yes, go on

;Open error
        cmp     ax,ERROR_OPEN_FAILED
        jne     jmp_dosret      ;return error
        .....


;Open was successful
CheckHandle:

;       Check to see that the handle returned is in the range supported
;       by the compiler.  If not, return no more files error.

        mov     ax,[Fh]
        cmp     ax,__nfile      ; is file handle out of range?
        jb      OpenOk          ; nope, its ok


 PE> Unfortunately MSC 6.0 checks the file handle < _NFILE in 
 PE> three separate locations - open(), read() and write().  


but they are comparing with a variable. (_nfile initialized in crt0dat.asm)

 PE> There may be others, too.  At time of writing, the only 

i will send you a list of all usages of _nfile in MS-C libary source code
as netmail (105 lines)


 PE> On c1.exe (from MSC 6.00A), dated 1995-09-21 (?!) size 
 PE> 146928 bytes, this translates to:

here's my c1.exe:

Directory of D:\c600\BINP
15.08.90  11.30     146928           0  C1.EXE

 WARPED!, Mario

--- Msgedsq/2 2.2e
* Origin: LC/32 Development Team-Vienna-Austria (2:310/14.11)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 310/14 1 24/999 888 396/1 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.