No announcement yet.

PBC Errors 515,611 and hanging

  • Filter
  • Time
  • Show
Clear All
new posts

  • PBC Errors 515,611 and hanging

    I am having a problem compiling a fairly large
    program consisting of approximately 13000 statements.
    This program is too large to compile in the IDE. I am using
    the latest version of PBC 3.50 (12-19-97). My problem is
    as follows

    ********* Error 515 Fixup overflow ***************************
    Each time I attempt to compile after updating or
    modification I run into this problem. I am not linking
    any objects or PBU's. Sometimes I get past the problem by
    re-positioning some function or adding a dummy label or
    inserting some dummy code. However recently this has not worked

    ********* Sometimes PBC will hang. ****************************
    In most cases when this happens it can be interrupted
    by pressing the <enter> key a few times. In this case PBC often
    fills the screen with what appears to be random memory.
    Other times the hanging can only be interrupted
    by restarting the computer.

    ********* Illegal operation errors.*****************************
    Sometimes while PBC is compiling Windows will interrupt with
    the message "This program has performed an illegal operation"
    Fault location in two instances were 2D94:ED5F and 2D95:ED51 but
    this is inconsistent.

    ********* 611 Internal error. **********************************
    Occasionally PBC will report 611 Internal error.
    I have also seen bogus compile-time errors such as
    (481 Parameter Mismatch), (477 Syntax Error) or (455 End If expected)
    in code which previously compiled without error.

    ********** Source Layout **********************************
    The program uses UDTs extensively. There are no pointers used.
    The program is multi-user networked based using plenty of file I/O
    and file locking. The program layout is as follows

    $Compile EXE
    $CPU 80386
    $DIM ALL
    $String 8
    $Error All On
    $Option CNTLBREAK ON
    $Stack &H2000
    $Com 1024
    Type Definitions
    Sub/Function Declarations
    DIM Shared Variables and UDT
    $Include 43 Program Source Files

    ************* An example of a successful compile **********
    PowerBASIC Compiler Version 3.50
    13524 statements, 15779 lines
    Compile time: 00:01.3 Compilation speed: 727800 lines/minute
    196064 bytes code, 10928 bytes data, 8192 bytes stack
    Segments(4): 54k/50k/55k/34k

    Although my usual working computer is an HP8570C, I
    experience similar problems on other computers and operating
    systems and across networks. I also encounter similar compile
    problems with other large programs.

    ******************** HP8570C details ***********************

    Windows 98 [Version 4.10.2222]

    Modules using memory below 1 MB:

    Name Total Conventional Upper Memory
    -------- ---------------- ---------------- ----------------
    SYSTEM 43,520 (43K) 30,512 (30K) 13,008 (13K)
    HIMEM 1,168 (1K) 1,168 (1K) 0 (0K)
    EMM386 4,320 (4K) 4,320 (4K) 0 (0K)
    OAKCDROM 36,064 (35K) 36,064 (35K) 0 (0K)
    DBLBUFF 2,976 (3K) 2,976 (3K) 0 (0K)
    WIN 3,920 (4K) 3,920 (4K) 0 (0K)
    vmm32 22,512 (22K) 7,120 (7K) 15,392 (15K)
    COMMAND 7,776 (8K) 7,776 (8K) 0 (0K)
    IFSHLP 2,864 (3K) 0 (0K) 2,864 (3K)
    Free 556,960 (544K) 556,960 (544K) 0 (0K)

    Memory Summary:

    Type of Memory Total Used Free
    ---------------- ----------- ----------- -----------
    Conventional 651,264 94,304 556,960
    Upper 31,264 31,264 0
    Reserved 0 0 0
    Extended (XMS) 67,007,968 ? 99,233,792
    ---------------- ----------- ----------- -----------
    Total memory 67,690,496 ? 99,790,752

    Total under 1 MB 682,528 125,568 556,960

    Total Expanded (EMS) 67,108,864 (64M)
    Free Expanded (EMS) 16,777,216 (16M)
    Largest executable program size 556,944 (544K)
    Largest free upper memory block 0 (0K)
    MS-DOS is resident in the high memory area.

    I have exhausted all my ideas to solve this problem.
    Has anyone else experienced similar problems?
    Any suggestions would be appreciated.
    Thanks for reading this

    Bernie Lazette

    mailto:[email protected][email protected]</A>


    [This message has been edited by Bernie Lazette (edited August 31, 2001).]
    [email protected]

  • #2
    Yes, Bernie, these problems will crop up once in a while in large
    programs. I've found that the fastest way to get up and running
    again is by using the $SEGMENT metastatement. Try breaking up your
    program into smaller pieces by adding a $SEGMENT and moving your
    existing ones. It often takes me several tries to get compilation
    working again, but once it does it doesn't break again for a long

    Also, you do have a less memory available than I do. You might try
    compiling in a pure DOS session, with no EMM or CDROM drivers or
    any of the other windows gunk.



    • #3
      Another thing you might try is moving several procedures to a separated file to be compiled as a PBU, and put a
       $CODE SEG “name”
      at the top of the file, so that the resulting object code will end up in a separated code segment.
      If your actually SHARED vars are used by the moved procedures too, you’ ll have to use PUBLIC instead of DIM SHARED for these vars in the main and put the same PUBLICs statements in the unit.



      • #4
        You are using the 12/19/97 build, so the first question is this: is the problem repeatable on multiple computers. You have to test this with exactly the same source code.

        If the problem cannot be reliably duplicated then the first suspect is the memory manager.

        However, if it can be duplicated reliably, then PowerBASIC will be most interested to see the problem.

        If you can please submit the problematic code to Tech Support (where it will be treated in strict confidence of course!), and we'll check into it.

        If we do verify it to be a compiler problem, we'll take the matter up with R&D.


        PowerBASIC Support
        mailto:[email protected][email protected]</A>
        mailto:[email protected]


        • #5
          One more point... the program should still be able to be compiled with the IDE, but without sufficient free memory it may not be able to be executed within the IDE.

          When you next encounter the problem with PBC, please try compiling the exact same code in the IDE.

          Also, do any of the compile options ($LIB, $OPTION, etc) have any effect at all?

          Finally, does disabling EMS and XMS make any difference too? You can use PBINST.EXE to customize/disable the EMS/XMS memory usage of both PBC.EXE and PB.EXE.

          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          mailto:[email protected]


          • #6
            Thank you
            Jerry, Davide and Lance for your suggestions and comments.
            I now have some new ideas to pursue. I am out of the office
            until next Tuesday but will certainly want to try to solve the
            puzzle when I return.

            Thanks again

            [email protected]
            [email protected]


            • #7
              Hello again
              Further to suggestions from Lance and others, I have decided
              to conduct a number of tests on a variety of computers to determine
              the cause of Fixup Overflow errors (515). My first step was to
              eliminate EMS/XMS from the picture. This was done on PB.EXE.
              In order to create fixed environment and reduce as many variables
              as possible DOS 6.22 boot disk was used.The boot disk contained the
              following files


              The CONFIG.SYS file contained the following lines
              DEVICE=RAMDRIVE.SYS 4096 512 128 /e

              The AUTOEXEC.BAT file contained only the line
              PROMPT $p$g

              PB.EXE has EMS/XMS usage disabled

              Computers Used

              1. 486/33 DOS 6.22
              2. P-233 MMX Windows ME
              3. P3-450 Windows 98 SE
              4. P54C-133 Windows 95 Version 4.00.1111
              5. P-166 DOS 6.22
              6. 386-33 DOS 6.22

              ***************** *Test No. 1 ************************************
              Each computer was booted using the boot disk described above.The
              self-extracting source file was extracted to the ramdrive. The
              directory changed to ramdrive and source compiled to EXE (Alt-F9)
              using PB.EXE. Two sources A and B were used.

              Here are the results of test 1.

              Computer Source A Source B
              1. Error 515 Error 515
              2. Success Success
              3. Success Success
              4. Success Error 515
              5. Success Error 515
              6. Error 515 Error 515

              ***************** *Test No. 2 ************************************
              In this test each computer was booted using it's own operating system
              The self-extracting source file was placed in its own directory on each
              computer. Sources were compiled to EXE (Alt-F9) using PB.EXE.
              Again two sources were used.

              Here are the results of test 2.

              Computer Source A Source B
              1. GFP Error 515
              2. Hung * Hung * Note 1
              3. Success Success * Note 2
              4. Error 515 Success
              5. Error 515 Error 515
              6. Error 449 * Error 477 * Note 4
              Note 5.

              ***************** *Test No. 3 ************************************
              Each computer was booted using it's own operating system
              The self-extracting source file was extracted to directory on each
              computer. Sources were compiled using PBC.EXE.
              Again two sources were used.

              Here are the results of test 3.

              Computer Source A Source B
              1. Error 515 Success * Note 2
              2. Error 515 Error 515
              3. Error 515 Hung * Note 3
              4. Error 515 Error 515
              5. Error 515 Error 515
              6. Error 515 Error 515

              Note 1. This computer hung while compiling and could only be
              interrupted using Ctrl-Alt-Del.

              Note 2. Although this source compiled without error, the EXE failed on
              execution (Run time error 5). The length of the EXE was 171,586, which
              is 3 bytes longer than the other successful compiles of the same source.

              Note 3. This computer hung while compiling and was interrupted
              by pressing <enter> a couple of times. However PBC spilled
              to the screen what appeared to be random memory followed by Error 538

              Note 4. This compile failed with 477 Syntax error. Indicating the following
              error location which of coarse makes no sense
              DIM MItem(20) AS LOCAL STRING

              Note 5. This compile failed with 449 SELECT Expected. Indicating
              the following error location which also makes no sense.

              Select Case ASCII(Right$(Choice,1))
              Case %SF11
              Bit Toggle Options1, %NoExtPrint
              Case %ALTL

              Anyone got any ideas?

              Thank you for reading this

              Bernie Lazette

              [email protected]
              [email protected]


              • #8

                by using 6 PCs in 3 different tests and classifying the results that way, you did a very good work, really; it’ s what everybody should do when suspecting a bug of this kind. The fact that the problem arises with some PCs and not with some others IMO says very much.

                However, trying to understand the exact cause of your problem IMO is a losing mission. The elements involved are too many. It would be much better going for the ways that are proven to solve this kind of problems, that is $SEGMENT or units with $CODE SEG. Other possibilities are creating separates EXEs to be CHAINed or RUN one another, or reducing the amount of global vars, or other things that affect memory usage.

                I know that this might be hard to accept (even though it shouldn’ t), however IMO the reality is that if you suppose to magically eliminate every bug from every OS and mem manager, some programs that have always worked very fine that far, would start to crash, and some programs that have been sometimes crashing would stop crashing forever.
                It’ s more or less similar to the problem of the many web pages that work fine with the bugs of the most common browser: they won’ t work if accessed with a browser which hasn’ t those bugs.

                So, IMO, rather than trying to detect “where is the problem”, the most realistic thing to do in these cases is detecting “where isn’ t the problem”, that is staying away from unclear limits of the system. This way your code will be compiled and will run fine virtually ever. So my suggestion is, don’ t worry, make your program use memory differently.



                • #9
                  Bernie, you have gone to great length, sure enough. However, You have not submitted the code to Tech Support as of yet.

                  Until PowerBASIC, Inc. can duplicate the problem and work out what is going wrong, we cannot give you any explicit answers as to the cause.

                  I hope to hear from you soon...


                  PowerBASIC Support
                  mailto:[email protected][email protected]</A>
                  mailto:[email protected]


                  • #10
                    Hello Lance
                    A test suite is on it's way
                    Thanks for your help so far

                    Bernie Lazette

                    [email protected]
                    [email protected]


                    • #11
                      Any further progress on the 515 Fixup error? I'm finishing a PHD in the next two weeks, and can't add another line of code !

                      I tried the tricks with EMM, XMS and $segment. I'm not using any of the pointers or other possible causes mentioned in the documentation. It would be very difficult to break my code apart any further.

                      It happened once before and I "fixed" it by moving a $segment statement, but now that doesn't work.

                      Help! Any further ideas?



                      • #12
                        Originally posted by Daniel Raymer:
                        Help! Any further ideas?

                        Would any of you care to try a program that strips the comments
                        and extra spacing to further reduce source size. It also finds
                        needed functions, subs, types, unions, constants in Include files
                        and writes them to the Source and eliminates the include file. The
                        results is written to another Bas file leaving the Original Source
                        as is.

                        The PBCC source is in the BBS's Source thread, But I can Email you
                        a compiled version if you are interested.

                        I've used it on PBNOTE.BAS and a few others, but not on any large
                        files. I haven't got any reports that it doesn't work. I don't see
                        why it wouldn't work with PBDOS source. Email me if you want to give
                        it a try........ [email protected]



                        • #13
                          Hello Daniel & Jerry
                          Thank you for your interest in my posting. The 515 error has been a real problem for me as well. One thing I have found to sometimes get rid of the 515 error by adding a dummy label just before the line which appears to cause the error. This may get you by the compile process but not neccesarily out of trouble. I have found in some cases an area of the program which previously worked perfectly will crash with windows reporting a GFP or illegal opertion error. In other words when PBC reports 515 something serious is going wrong. As you have probably noted back in Sept 2001, I did extensive testing in an effort to demonstrate this and other problems I encountered with PBC. I sent a test suite to PowerBasic Support but I am still waiting patiently for a reply.
                          An other thing I have done is to combine all incude files into a single source. As above this may get you past the 515 compile error but it does not mean you have a good compile.

                          Anyone else got any ideas

                          Thank you and have a good day

                          [email protected]

                          [This message has been edited by Bernie Lazette (edited March 14, 2002).]
                          [email protected]


                          • #14

                            I had similar experiences compiling larger programmes with PB 3.5 in DOS 6.22,
                            I still work in, years ago.

                            The moment the compiled *.EXEs would get close to 400 Kb all sorts of weird
                            things happen. Like a Label suddenly being complained about by the Compiler
                            as an Error 466 - "Duplicate Name Definition" !

                            A Norton Text Search in all files on the disk can find no other occurance
                            of the label or other variable with the same name anywhere.

                            So I decided to keep my compiled *.EXEs below 300 Kb, not a bad idea as some
                            of them need the limited Dos for Programmes Memory for Arrays, etc.

                            No more problems in DOS or in any flavour of Windows up to 98 SE since.

                            PB for DOS compiled programmes can "EXECUTE" from one to the other and back
                            again and the only memory overhead is a 1 Kb Stub to stop them getting lost,

                            BLOATWARE is the prerogative of WINDOWS ! Lets stick to lean, mean and fast
                            EXECUTABLES PowerBasic for DOS is famous for !!!



                            • #15
                              Hello Otto
                              Thank you for your reply. I have executables as low as 220k in size
                              which I have had problems of one sort or another compiling.
                              Over the years there have been several posts regarding this
                              kind of problem. It may some line of code I'm using which is
                              confusing the compiler. If I only knew how to avoid it.
                              Thanks for your help.


                              [email protected]

                              [This message has been edited by Bernie Lazette (edited March 19, 2002).]
                              [email protected]