problem compiling release code

Archives Forums/BlitzMax Bug Reports/problem compiling release code

T-Light(Posted 2008) [#1]
Hello.

I have a program that compiles and runs fine in debug mode, however the bmk stalls when trying to compile in release mode.

In task manager, it shows the bcc running at full steam and the memory increasing and decreasing (mainly increasing).

I've removed a module called from my source to see if that was the problem but no luck, it's still stalling. within blide, it just states...

Building executable...
Compiling:myprog.bmx

and that's it.

I've ran the bmk from the command line with this line (verbose on to see if it will give me any more info)
bmk makeapp -a -v -r myprog.bmx

and it gets as far as this...
Parsing...
Resolving types...
Resolving decls...
Resolving blocks...
Evaluating fun blocks...
Generating assembly...

Are there any guidelines around here for what to look out for when comiling in release mode? orders of includes/modules etc?, this has me stumped.

Cheers,

Brent.


T-Light(Posted 2008) [#2]
ps

Can't post any code on this one I'm afraid. The main routine is several thousand lines long alone and there are many custom includes weighing in at least a couple of thousand lines each.

I'm not asking anyone to help me fix this per se, just point me in the direction of some classic compiler problems I might have overlooked.

Thankyou. :)

Windows Vista
UAC off
Intel core 2 duo 7200
2GB RAM
160GB HD (plenty of free space)


GfK(Posted 2008) [#3]
Have you tried running the standard IDE and compiling in release mode from there? Reason I ask is that it might just be a problem with Blide. I switched from Blide to Project Studio because Blide always started playing silly buggers when trying to compile after running for several hours.


T-Light(Posted 2008) [#4]
Same thing under the standard IDE
Building myprog
Compiling:myprog.bmx

Hangs...

Should have mentioned above, I'm running a fresh install of Vista the latest version of Max with the latest GUI. MinGW is installed and I can compile/build modules without any problems.

Thanks Gfk, Blide isn't the problem here I'm afraid :)


kenshin(Posted 2008) [#5]
Try running BMax with the Win95 compatibility mode in Vista. Sounds stupid, I know...

You could also try using the latest VirtualPC to compile under XP. At least that way you know whether the problem is with Vista or BMax.


GfK(Posted 2008) [#6]
I don't think that messing about with XP and VirtualPC is the answer. I run Blitzmax on two Vista systems and never had any compile problems.

Couple of things. Are you trying to compile under a non-administrator account? Don't know if that'd cause a problem anyway....

Other thing - are you trying to compile code which exists on a network drive?


Floyd(Posted 2008) [#7]
There are new demos of BlitzMax available. These are version 1.30 and include MaxGUI. You could try the Windows demo, available from the Products page.

This should ensure you have the latest, compatible versions of BlitzMax and MaxGUI, with everything properly configured.


kenshin(Posted 2008) [#8]
I've not had any major problems under Vista either, but I just noticed this:
Should have mentioned above, I'm running a fresh install of Vista the latest version of Max with the latest GUI.
Seems to suggest that this problem started occurring after the re-install.

Another thing is that T-Light is using TV3D and there have been some recent minor problems with compiling stuff for that under Vista.


ziggy(Posted 2008) [#9]
I switched from Blide to Project Studio because Blide always started playing silly buggers when trying to compile after running for several hours.
that has no sense. Compilation is made outside from BLIde in a fresh and unique execution of the compiler on each compilation. Obviously, if the user also is not able to compile the source from the command line, it is obvious that it is not a BLIde issue... I would appreciate a lot if you read the thread carefully before stating that there may be a bug here or there. Additionaly, If any BLIde user reports a bug on BLIde, it is 99% of the time fixed in a maximum or a week or so... In the last few months the downloads of BLIde have grown a lot, and the bug reports are near 1 or 0 per release, and usually they are very minor things, so I'm sure BLIde is way stable. anyway, I supose you were refering to a personal liking or something like that, wich is ok for me.


T-Light(Posted 2008) [#10]
Sorry guys, turned my back for acouple of minutes and there's a flurry of posts, thanks :)

kenshin...
Another thing is that T-Light is using TV3D and there have been some recent minor problems with compiling stuff for that under Vista.

Noooooooo, don't say it's TV, mind you, if it's only under Vista then worst comes to worst, I'll compile on the xp box.

Although I can't say for certain, I don't think this is a problem with the fresh install, the first time I saw the problem was when trying to compile a release version with the 'Tablet Module' several months ago ( I stuck with debug mode after that as I wasn't anywhere near completion and it wasn't a pressing issue). I didn't think much of it at the time as compiling anything at all on the old Vista install was a dodgy thing at best. The problems weren't confined to bmx but covered every language and compiler I had installed. Even microsofts own VC++ would crash out or compile fine depending on the OS's mood.

Should say I've had no such problems with the latest install (other than UAC issues which is why I've killed it).

I'm currently going through the main program function by function to see if I can isolate what's causing the assembly issue. Currently 2800 lines in and all is well. Here's hoping.

Thanks for your help on this guys.


T-Light(Posted 2008) [#11]
Hello Ziggy.

Blide (and recently Blide+) makes my life 1000% easier, wouldn't be without it :)


ziggy(Posted 2008) [#12]
@T-Linght: Thanks for the feedback! I had some problems compiling code on Vista also untill I set the correct permissions on the BLIde and BlitzMax folders, disabled UAC and run everything from an administrator account. but obviously that would also aply to the debug-mode compilation so it sounds to me like a bcc bug. If you're mixing C or C++ code, be sure to have the right version of MinGW. Other than that, I don't know what can be causing this to your code.

EDIT: also disable quick build just in case any .o file is corrupted and causing this.


Gabriel(Posted 2008) [#13]
Another thing is that T-Light is using TV3D and there have been some recent minor problems with compiling stuff for that under Vista.

That's news to me. I certainly don't have any problems compiling anything using TV3D on Vista, and no one has told me of any such problems, which I would have expected.


kenshin(Posted 2008) [#14]
You're right. I have not had any actual hung compiles, but I have seen a problem with exe's on xp compared to those on vista. I get crashes when there is no license installed, when I should get a watermark. If I use Win95 compatibility mode then no crash.


T-Light(Posted 2008) [#15]
Ziggy -
If you're mixing C or C++ code, be sure to have the right version of MinGW.

Nope, max only in this compile, I was hoping that the tablet module I'm using was causing a problem as it did months ago but unfortunately not, just ran a test and its fine.

Been transferring code bit by bit to a new file and running the bmk from the command line to see which bits are ok. Once it gets into my main functions, each function relies on several others to work. Unfortunately once I'd transferred all the neccessary functions over to the new file to stop the bmk from complaining about missing bits... it hangs.

This is going to be a long weekend. Wish the bmk or Bcc gave more information on what it was doing at the assembly stage, would make this a lot easier.


T-Light(Posted 2008) [#16]
OK, think I might have found the section responsible. It's somewhere within 500 lines of multidimensional loveliness. Once this functions blanked, everything seems to compile.

I'll go through it all and post what I find here.

Thanks again guys.


T-Light(Posted 2008) [#17]
Anyone up for a puzzle?

I've thrown out everything that isn't needed to show the problem and narrowed it down to a few lines (enough to get the program to compile properly in debug mode, but fail in release mode).


SuperStrict

Local temparray:Int[512 * 512]
Local mycolour:Int
Local mya:Int
Local myr:Int
Local myg:Int
Local myb:Int
Local f:Int
Local g:Int

temparray = New Int[512 * 512]
Local newtemparray:Int[512 * 512]

mya = (mycolour & $ff000000) Shr 24
myr = (mycolour & $ff000000) Shr 16
myg = (mycolour & $ff000000) Shr 8
myb = (mycolour & $ff000000)

mya = (mya & $000000ff) Shl 24
myr = (myr & $000000ff) Shl 16
myg = (myg & $000000ff) Shl 8
myb = (myb & $000000ff)

newtemparray[(f * 512) + g] = mya + myr + myg + myb
temparray[(f * 512) + g] = mya + myr + myg + myb




As I say, very little of the above code makes any sense without the rest of it, it's just to show the problem, if I try to compile the above lines in release mode the compiler will hang.

If I comment out either one of these two lines, it will compile in debug and release...

newtemparray[(f * 512) + g] = mya + myr + myg + myb
temparray[(f * 512) + g] = mya + myr + myg + myb


Also, if I rem out these lines...
[QOUTE]
mya = (mycolour & $ff000000) Shr 24
myr = (mycolour & $ff000000) Shr 16
myg = (mycolour & $ff000000) Shr 8
myb = (mycolour & $ff000000)

mya = (mya & $000000ff) Shl 24
myr = (myr & $000000ff) Shl 16
myg = (myg & $000000ff) Shl 8
myb = (myb & $000000ff)
[/QOUTE]
It will also compile in debug and release, which is really strange.

None of this code is neccessary to my main routines anymore so this isn't an important issue, but does anyone have any ideas?


Floyd(Posted 2008) [#18]
...does anyone have any ideas?

Not really, but that's a weird bug.

bcc is apparently caught in some kind of infinite loop.


T-Light(Posted 2008) [#19]
Spooky isn't it.

I have code like this running throughout my prog and thankfully it's all fine, just something weird going on in the example above. Thought it might be down to the line
temparray = New Int[512 * 512]

but I use that kind of code in quite a few places without problems, also thought 'temparray = new' followed by another array called 'newtemparray' could have been triggering something but I renamed them and still had the same problem.

I'll leave this one to Mark I think :)


SebHoll(Posted 2009) [#20]
Bump - compiler still freaks out for me with T-Light's code example on BlitzMax v1.34rc8 (Windows Vista x86).


marksibly(Posted 2009) [#21]
Hi,

Nice find! In fact, worthy of a blog...

Fix will be in next update.