PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Elias Montoya on October 03, 2013, 07:13:19 PM

Title: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 03, 2013, 07:13:19 PM

Hello, i got to a point where i am not sure anymore if an issue is in my side.

We have our application fully (100%) working in Win7, however, it crashes in WinXP.

Nothing is displayed, just fire the app and it will crash before anything happens.

I added this line to my app:



'--------------------------------------------------------------------------------
Function MAINFORM_WM_CREATE ( _
                            hWndForm As Dword, _      ' handle of Form
                            ByVal UserData As Long _  ' optional user defined Long value
                            ) As Long
                           
MsgBox "a 1"
Exit Function

[MORE CODE GOES HERE]

END FUNCTION


MSGBOX is not triggered. then i remembered MSGBOXes sometimes do funky stuff i added this:

'--------------------------------------------------------------------------------
Function MAINFORM_WM_CREATE ( _
                            hWndForm As Dword, _      ' handle of Form
                            ByVal UserData As Long _  ' optional user defined Long value
                            ) As Long
               
local ff as long             
local rep as string
ff = freefile
rep = "all ok"
open "report.txt" for binary as #ff
put #ff,,rep
seteof #ff
close #ff
Exit Function

[MORE CODE GOES HERE]

END FUNCTION


But... Nothing is written to file.

I dont know what else to try, im using Firefly 3.62, with WIndows XP (same with Win7 works perfect!)
No problems compiling, no problems editing code, no problems with firefly IDE... only issue is the resulting exe crashing.

Any ideas?
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Paul Squires on October 03, 2013, 07:15:52 PM
Can you run the resulting CODEGEN_*_MAIN.BAS through the PB Debugger and step through the code?
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 03, 2013, 07:19:21 PM
Im on it...

Added:
You know Paul? its funny, i ask, you prompty reply, i try to reply quickly too, and then this Old Pentium 4, 3.4 Ghz starts venting and everything slows down.

What would be a suggested place to add a BREAK to avoid going a lot of times trough CWIndow and all other features?
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 03, 2013, 07:28:29 PM

Bad news... it all works in Debug mode. Ugh.  :-[

Now what?? :( :(
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Paul Squires on October 03, 2013, 07:33:26 PM
Sounds like it could be a pointer error or badly called api that is being forgiven in Win7 but is blowing up WinXP. This could be a very hard error to find.
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 03, 2013, 07:36:55 PM
Quote from: TechSupport on October 03, 2013, 07:33:26 PM
This could be a very hard error to find.

My thoughts exactly. :(

Given it is happening before my code, do you think it could still be on my side? I have some code in the Message pump and in the AppStart...

maybe i added bad code there? Or most likely error is out of my bounds?


Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Paul Squires on October 03, 2013, 08:01:01 PM
Try enabling the #DEBUG directives at the top of FF_APPSTART ?
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 03, 2013, 08:08:59 PM
 I enabled:

#Debug Error On

And now it displays one of the first dialogs... why does it work with #Debug Error On? Im not sure what that does...
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Paul Squires on October 03, 2013, 08:16:42 PM
Quote
#DEBUG ERROR option specifies whether the compiler should generate code that checks for array boundary and null-pointer errors wherever they may occur. The default setting is OFF.

When #DEBUG ERROR mode is ON, any attempt to access an array outside of its boundaries, or attempting to use a null-pointer will generate a run-time Error 9 ("Subscript/Pointer out of range"), and the statement itself is not executed.

When OFF, all statements are executed "as-is" and no errors are generated. However, accessing an array outside its boundaries or using a null-pointer can cause a General Protection Fault (GPF) or Exception error.

It is best to enable #DEBUG ERROR error checking when developing a program. Once all of the more obvious bugs have been eradicated, you will want to return to the default setting (OFF), as this will make your code smaller and faster.

Try also turning on #DEBUG DISPLAY ON
Quote
#DEBUG DISPLAY ON enables error display mode within a compiled PowerBASIC program. In this mode, whenever an untrapped error occurs (without the benefit of ON ERROR GOTO, TRY/CATCH, etc.), program execution is suspended, and a descriptive message is displayed. This message includes the error number, a brief description of the error, and a position descriptor word to help you find the location of the error. The position descriptor word is the first 8 characters of the name of the last (most recent) label, line number, or procedure that was executed. This mode should only be used during program development and debugging. It should never be used in a production program.
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 03, 2013, 08:28:13 PM
 Nice... But it seems like i lifted an old piece of wood in the backyard...

Ill play with it. :)


Ok, i got it working. It was an array being dimensioned Wrong. (DIM XYZ(1 to 0)).  Now i will check to see why does it looks the way it looks.

Here's how it klooks in Win7:
(https://www.planetsquires.com/protect/forum/index.php?action=dlattach;topic=3407.0;attach=1577;image)

And here's how it looks in WinXP:
(https://www.planetsquires.com/protect/forum/index.php?action=dlattach;topic=3407.0;attach=1579;image)
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 03, 2013, 08:44:02 PM

I used PROFILE in my project and i get this interesting entry.

FLY_DOMESSAGEPUMP,                                  8,              380749

It is called 8 times and took more than 6 minutes to complete.
Title: Re: Issue debugging my Firefly app in WInXP.
Post by: Elias Montoya on October 04, 2013, 06:41:20 AM

Well, its almost done.

Unfortunately i have been struggling for hours with Firefly crashing in my XP box. I have come to a point in which just clicking a form tab to display it crashes firefly. I dont know why but Windows XP is an unforgiving DOG with applications. Firefly works almost perfect in Win7, but in XP not so. So is my app, and thats why im trying to fix it.

I thought i should mention it, lots of people still using XP. Actually, i kinda like how speedy it is. I might go back to it for some purposes.