Announcement

Collapse
No announcement yet.

Cannot access compiler results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #41
    I see virus scanners have been mentioned. Ctl-F for "thread" had zero hits, so:

    Do you create any threads in your program?
    Dale

    Comment


      #42
      Hi Dale - I don't believe so. There aren't any specific "Thread" commands in my code.

      I do rely heavily upon Eric Pearson's excellent ConTools and GFX packages, which might use Threads that I don't know about. One in particular is the shutdown detection OnShutdown CODEPTR(OnWinShutdown) which jumps to my own OnWinShutdown Function which does some housekeeping, data saving, etc.... But reming that out doesn't fix the compile error message.

      Comment


        #43
        See post #39 in this thread.

        It is an old issue ....

        Comment


          #44
          Dan, the combination of Console Tools and Graphics Tools does require us to create an internal thread, but you are experiencing a compile-time error, and I'm not aware of any mechanism by which that could cause a compile-time error.

          Added: Especially if you are using the DLL versions of CT and GT, which are fully pre-compiled and don't even get involved at compile time. They literally don't have to exist until runtime.

          > It does seem to be triggered by something like hitting an upper limit of total number of
          > nested For-Next loops, or nested If-Then blocks.

          I thought that your specific problem had been clearly traced to exactly that. No?

          > But I need them!

          That may be irrelevant.
          "Not my circus, not my monkeys."

          Comment


            #45
            I have also encountered this several times, most recently a few days ago.
            Sometimes adding Dummy code as described by Klaus works (sometimes all it takes is a few lines of comments), other times playing with compiler directives -
            #Debug Error On, #Debug Display On or even #BLOAT can fix it, sometimes enabling or disabling one will do the trick, other times it takes 2 or more.
            (it might be worth trying some of the others if they don't work for you)

            What I also find interesting is that the problem will usually go away in a day or so. IE reverting to the earlier configuration and everything is good.

            My thoughts (**and I have no evidence to back this up**) is that a temp file is written somewhere that gets locked for some reason.
            When compiling again, this file cannot be used as expected and the compile fails.
            My suspicion is that the name of the (presumed) temp file gets changed if you make sufficient changes to your code and things start working.




            Comment


              #46
              Ian: I love #BLOAT - only PBCC needs a routine to make our EXE look bigger! But those didn't fix it. Also, the guess about a temp file seems unlikely since I can fix it and unfix it just by remming out a FOR and its NEXT, leaving the internal block still there.

              Eric: I'm using the DLL version of CT and GT. On the possibility that it has to do with FOR and IF blocks, that seems likely but isn't "clear" yet. Also, I'm still trying to get CT to work within my SLL so that I can pull a lot more code out (as suggested by you, Adam, and others). I sent you an email. Your help is always greatly appreciated!

              Comment


                #47
                Daniel,
                1. Have you recently set up a new PC?
                2. Have you tried using Process Explorer from SysInternals to see what prevents the log file from being written?
                3. Have you looked at the Event Log for application to see if the compiler GPF'd

                I had this issue recently when I set up a new PC. It worked when I ran PBWIN as Admin so I knew I had to look at rights to the files.

                Comment


                  #48
                  Lots of suggestions in this link. Might look at post #53 using a resource file?

                  User to user discussions about the PB/Win (formerly PB/DLL) product line. Discussion topics include PowerBASIC Forms, PowerGEN and PowerTree for Windows.

                  Comment


                    #49
                    Carlo: No, not a new PC. Have not tried Process Explorer, but are we sure that the problem is not being able to write a log file? And, I don't see an Event Log after trying to compile, either in my code folder or my PBCC folder. What is the exact file name I should be looking for?

                    Mike: Yup, tried the Resource File thing a year ago. No diff.

                    All: With Eric's help I was able to move Contools-driven routines into the SLL, which is now allowing me to compile my big code again. Still don't know what the problem is, but I've sent my source code to Adam with two lines to Rem out. With those active, it won't compile. With them dead, it does! He will take a look when time permits.

                    All2 - thanks for your interest and your help! PB forever!

                    Comment


                      #50
                      Ian: I love #BLOAT - only PBCC needs a routine to make our EXE look bigger!
                      Add a large resource to your exe or dll . Maybe a bitmap, maybe a RCDATA type text file. Since resources are stored in the executable, you have "#BLOAT on the cheap"
                      Michael Mattias
                      Tal Systems (retired)
                      Port Washington WI USA
                      [email protected]
                      http://www.talsystems.com

                      Comment


                        #51
                        Daniel, what are those two lines? Anything to do with nesting? If not, are they in a section of deeply nested code?
                        "Not my circus, not my monkeys."

                        Comment


                          #52
                          My thoughts (**and I have no evidence to back this up**) is that a temp file is written somewhere that gets locked for some reason.
                          When compiling again, this file cannot be used as expected and the compile fails.
                          My suspicion is that the name of the (presumed) temp file gets changed if you make sufficient changes to your code and things start working.
                          You can monitor temp file creation the same way you monitor other file systems changes. I think there are multiple examples here, but here is the first one I did and posted:

                          Win32(SDK): Internet Cookie Monitor April 25, 2001
                          Michael Mattias
                          Tal Systems (retired)
                          Port Washington WI USA
                          [email protected]
                          http://www.talsystems.com

                          Comment


                            #53
                            Originally posted by Daniel Raymer View Post
                            Carlo: No, not a new PC. Have not tried Process Explorer, but are we sure that the problem is not being able to write a log file? !
                            Not Process Explorer. Run Process Monitor ( another great SysyInternals utility) and you will see exactly what is happening when you compile.


                            Here's a Procmon trace started just before a compile and filtered for PBWin.exe. Note that it identifies nearly 5000 events that took place during the compile. It should tell you exactly where the problem is occurring ( Scan through the Result column for the problem area)

                            Click image for larger version  Name:	procmon.jpg Views:	0 Size:	146.4 KB ID:	823036

                            =========================
                            https://camcopng.com
                            =========================

                            Comment


                              #54
                              Eric: Those two lines, and the lines between, can be seen here:

                              'ADAM :Rem out next line and matching NEXT IDUM below, and it compiles!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                              FOR IDUM=1 TO 3 STEP 2 'FAIRING TO STATIC USING CUBEPOLY (similar to old method but lots of changes 4-2023
                              FOR iFairToHere=VTMP(IDUM,0) TO 3 STEP -1 'NEXT FINDS WHERE TANGENT POINTS ABOVE STATIC (old code, I reinvented this in 2023 then noticed that I'd already done it!)
                              IF DTMP(IDUM,iFairToHere,I3)>0. THEN
                              IF (DTMP(IDUM,iFairToHere,I3)-DTMP(IDUM,iFairToHere-1,I3))/(VTMP(IDUM,iFairToHere)-VTMP(IDUM,iFairToHere-1)) _
                              <(DTMP(IDUM,iFairToHere-1,I3)-DTMP(IDUM,1,I3))/VTMP(IDUM,iFairToHere-1) _
                              OR DTMP(IDUM,iFairToHere,I3)>.95*DTMP(IDUM,1,I3) THEN EXIT FOR
                              END IF
                              NEXT iFairToHere 'EXITS WITH iFairToHere-1 AS POINT TO FAIR TO
                              IJ = CEIL(1+40/(25.1*xThrustSpeeds)) 'IJ for ~40 kts
                              IF iFairToHere<IJ THEN iFairToHere=IJ
                              IF iFairToHere>=VTMP(IDUM,0)-1 THEN iFairToHere=VTMP(IDUM,0)-1 'don't use last point

                              iFairToHere=iFairToHere+1 'USE NEXT ONE FOR BETTER FAIRING
                              X0=0.
                              Y0=DTMP(IDUM,1,I3) 'STATIC VALUE
                              XM0=0.
                              X1=VTMP(IDUM,iFairToHere-1)
                              Y1=DTMP(IDUM,iFairToHere-1,I3)
                              XM1=(DTMP(IDUM,iFairToHere,I3)-DTMP(IDUM,iFairToHere-1,I3))/(VTMP(IDUM,iFairToHere)-VTMP(IDUM,iFairToHere-1))
                              CALL CUBEPOLY(X0,Y0,XM0,X1,Y1,XM1)
                              FOR II=2 TO iFairToHere-2
                              X=VTMP(IDUM,II)
                              DUM=CUBEA*X*X*X+CUBEB*X*X+CUBEC*X+CUBED 'INTERPOLATED THRUST
                              IF DUM>Y0 THEN DUM=Y0 'kludge to force thrust<static thrust value in case CubePoly tries otherwise when static thrust is very low
                              DTMP(IDUM+1,II,I3)=DTMP(IDUM+1,II,I3)*DTMP(IDUM,II,I3)/DUM 'FIXED SFC
                              DTMP(IDUM,II,I3)=DUM 'set Thrust
                              NEXT II
                              NEXT IDUM 'ADAM - this one too <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

                              Comment


                                #55
                                Stuart - I'll look into Process Monitor. Looks awesome!

                                Comment


                                  #56
                                  FOR/NEXT's are nest-able. How deeply nested is that entire block of code in the sub/function where it's located? All of the various loop-types count, FOR, DO, WHILE, etc.
                                  "Not my circus, not my monkeys."

                                  Comment


                                    #57
                                    Originally posted by Eric Pearson View Post
                                    FOR/NEXT's are nest-able. How deeply nested is that entire block of code in the sub/function where it's located? All of the various loop-types count, FOR, DO, WHILE, etc.
                                    And how much deeper is the code nested in CUBEPOLY() ?
                                    =========================
                                    https://camcopng.com
                                    =========================

                                    Comment


                                      #58
                                      Correctly define the below variables and array bounds, add missing cubepoly and supply test data.
                                      Code:
                                      #DIM ALL
                                      #BREAK ON
                                      #DEBUG ERROR ON   'check for array boundary and null-pointer errors
                                      #DEBUG DISPLAY ON 'display untrapped errors
                                      
                                      FUNCTION PBMAIN () AS LONG
                                       Test
                                      END FUNCTION
                                      
                                      SUB Test
                                       LOCAL iDUM              AS INTEGER
                                       LOCAL i3                AS INTEGER
                                       LOCAL iFairToHere       AS INTEGER
                                       REDIM VTMP(1 TO 3,0)    AS INTEGER
                                       REDIM DTMP (1 TO 3,0,0) AS INTEGER
                                       LOCAL iJ                AS SINGLE
                                       LOCAL xThrustSpeeds     AS SINGLE
                                       LOCAL x0                AS SINGLE
                                       LOCAL XM0               AS SINGLE
                                       LOCAL X1                AS SINGLE
                                       LOCAL Y1                AS SINGLE
                                       LOCAL XM1               AS SINGLE
                                       LOCAL II                AS INTEGER
                                       LOCAL X                 AS SINGLE
                                       LOCAL DUM               AS SINGLE
                                       LOCAL CUBEA             AS SINGLE
                                       LOCAL CUBEB             AS SINGLE
                                       LOCAL CUBEC             AS SINGLE
                                       LOCAL CUBED             AS SINGLE
                                      
                                       STATIC Y0               AS SINGLE
                                      
                                       'ADAM :Rem out next line and matching NEXT IDUM below, and it compiles!! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                      
                                       FOR IDUM=1 TO 3 STEP 2 'FAIRING TO STATIC USING CUBEPOLY (similar to old method but lots of changes 4-2023
                                      
                                        FOR iFairToHere=VTMP(IDUM,0) TO 3 STEP -1 'NEXT FINDS WHERE TANGENT POINTS ABOVE STATIC (old code, I reinvented this in 2023 then noticed that I'd already done it!)
                                         IF DTMP(IDUM,iFairToHere,I3)>0. THEN
                                          IF (DTMP(IDUM,iFairToHere,I3)-DTMP(IDUM,iFairToHere-1,I3))/(VTMP(IDUM,iFairToHere)-VTMP(IDUM,iFairToHere-1)) _
                                           <(DTMP(IDUM,iFairToHere-1,I3)-DTMP(IDUM,1,I3))/VTMP(IDUM,iFairToHere-1) _
                                           OR DTMP(IDUM,iFairToHere,I3)>.95*DTMP(IDUM,1,I3) THEN EXIT FOR
                                         END IF
                                        NEXT iFairToHere 'EXITS WITH iFairToHere-1 AS POINT TO FAIR TO
                                      
                                        IJ = CEIL(1+40/(25.1*xThrustSpeeds)) 'IJ for ~40 kts
                                        IF iFairToHere<IJ THEN iFairToHere=IJ
                                        IF iFairToHere>=VTMP(IDUM,0)-1 THEN iFairToHere=VTMP(IDUM,0)-1 'don't use last point
                                        iFairToHere=iFairToHere+1 'USE NEXT ONE FOR BETTER FAIRING
                                        X0=0.
                                        Y0=DTMP(IDUM,1,I3) 'STATIC VALUE
                                        XM0=0.
                                        X1=VTMP(IDUM,iFairToHere-1)
                                        Y1=DTMP(IDUM,iFairToHere-1,I3)
                                        XM1=(DTMP(IDUM,iFairToHere,I3)-DTMP(IDUM,iFairToHere-1,I3))/(VTMP(IDUM,iFairToHere)-VTMP(IDUM,iFairToHere-1))
                                        CALL CUBEPOLY(X0,Y0,XM0,X1,Y1,XM1)
                                      
                                        FOR II=2 TO iFairToHere-2
                                         X=VTMP(IDUM,II)
                                         DUM=CUBEA*X*X*X+CUBEB*X*X+CUBEC*X+CUBED 'INTERPOLATED THRUST
                                         IF DUM>Y0 THEN DUM=Y0 'kludge to force thrust<static thrust value in case CubePoly tries otherwise when static thrust is very low
                                         DTMP(IDUM+1,II,I3)=DTMP(IDUM+1,II,I3)*DTMP(IDUM,II,I3)/DUM 'FIXED SFC
                                         DTMP(IDUM,II,I3)=DUM 'set Thrust
                                        NEXT II
                                      
                                       NEXT IDUM 'ADAM - this one too <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                      
                                      END SUB
                                      
                                      SUB CUBEPOLY(X0 AS SINGLE,Y0 AS SINGLE,XMO AS SINGLE,X1 AS SINGLE,Y1 AS SINGLE,XM1 AS SINGLE)
                                      END SUB
                                      Last edited by Mike Doty; 21 Apr 2023, 08:48 AM.

                                      Comment


                                        #59
                                        Daniel - The Event log is not a file but you access the logs by right clicking on the start button and selecting "Event Viewer"
                                        You will see multiple logs so look in the Application and System. I'm sure you are probably getting the compiler to GPF and hence no results.
                                        Stuart McLachlan well picked up indeed I meant process monitor, but I suspect he will find the compiler GPF's.

                                        Comment


                                          #60
                                          Well, I've decided to join the club - started getting the Cannot access compiler results as of a few minutes ago.

                                          I just got through changing the better part of a thousand lines of code - simple changes, but included a lot of adding a Macro at the end of many lines where I want to put some monitoring code. I compiled every so often while changing the code over the last several days, but not in the last few hours.

                                          I read the earlier posts here and tried all that seemed remotely like they had a chance of helping. But no luck.

                                          I rebooted several times, still fails.

                                          I resinstalled Win10.04 from scratch, it still fails.

                                          I copied the app files/folders to a new location c:\myapp on the same PC where it failed, and it failed again.

                                          I turned my AV off (Windows Defender) and it still failed.

                                          I blanked out my new Macro and it still fails.

                                          I copied the files/folders to a new PC at c:\myapps and it compiled just fine. That ought to be a clue for me to pursue.

                                          ... Note: This experience with with PBWin.

                                          Comment

                                          Working...
                                          X
                                          😀
                                          🥰
                                          🤢
                                          😎
                                          😡
                                          👍
                                          👎