UCC and the cryptic error...

Discussions about Coding and Scripting
Post Reply
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

UCC and the cryptic error...

Post by Shadow »

Hey there !

Been a long time since I was asking for help...

well, compiling my Physics Engine everything compiles fine with UCC (0 errors, 0 warnings), after that I'm compiling the corresponding DLL Package with Visual Studio C++ 6.0 (SP 6), well this also compiles and links fine (0 errors, 0 warnings).

But when running UCC after that, like compiling something in a Native Class, that doesn't change it's native functionality (like when I want to add a pure UScript function) UCC goes nuts...

Error Message (German):

"UCC.exe - Fehler in Anwendung

Die Anweisung in "0x7c9208b3" verweist auf Speicher in "0xfffffff8". Der Vorgang "read" konnte nicht auf dem Speicher ausgeführt werden.

Klicken Sie auf "OK", um das Programm zu beenden.
Klicken Sie auf "Abbrechen", um das Programm zu debuggen."


Error Message (English):

"UCC.exe - Error in Application

The Allocation in "0x7c9208b3" points to Memory in "0xfffffff8". The process "read" couldn't be executed in the Memory.

Click on "OK" to shut down the Program.
Click on "Abort" to debug the Program."


The funny thing is: the native actors can be added in a Map using UED without any "Can't bind to Native Class" errors.
The strange behaviour of this kind of error is even for me a way too much !

After going nuts myself I went that crazy I thought I couldn't do any native package anymore, thus creating a simple One-Class-DLL, just about 64 KB in size... and again the same error.

Code: Select all

sdkTest extends sdkActor
  native
  noexport;
So even with that Package (sdkTest.dll) containing the native class "sdkTest.uc" UCC sprawls around gay stuff...


Unfortunately it doesn't even create an UCC.log, so I'm writing what I get directly in UCC:

Code: Select all

...
...
--------------------- sdkTest -------------------"
General Protection Fault !

History: FMallocAnsi::Malloc <- UObject::StaticAllocateObject <- <LinkerLoad LinkerLoad29> <- UObject::GetPackageLinker <- UObject::LoadPackage <- UMakeCommandlet::Main <- FArray::Realloc <- 0*60

Executing due to error
Next funny thing is: UCC completely accepts sdkCore, sdkEngine and sdkLevelDesign...

my next move now is running through that public Native Coding Tutorial (with that Hazard.dll) if it's not working too I may exclude the possibility I'm not able to create a Native Package anymore... or something else is wrong :ironic2:

I also rebooted, and reinstalled UT - error stays...
I also scanned for any viruses... no virus nothing...

//edit:

Ok... to my surprise the Hazard.dll Native Coding Tutorial runs fine, compiling and recompiling, seems like I'm doing a terrible mistake in my own files...


//edit2:

I've isolated the origin of the error by trying to subclass hzTest.uc by either sdkObject.uc or sdkActor.uc, testing either sdkCore or sdkEngine is malfunctioning when linking in another Package, thus when subclassing from sdkActor.uc (thus sdkEngine.dll) the error appears, but not with sdkCore.dll
Image
User avatar
Feralidragon
Godlike
Posts: 5493
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: UCC and the cryptic error...

Post by Feralidragon »

Since it's about dlls and such, I don't know what might be happenning. But something quite similar happenned to me that also lead to me thinking that ucc got mad on the last week.
In the end I noticed this in my code:

Code: Select all

#exec OBJ LOAD FILE=Textures\ModifChargFX.utx PACKAGE=NWCoreV3.ModChargerFX
While my .u package was named NWModifiersV3 instead, so it should be (and is now):

Code: Select all

#exec OBJ LOAD FILE=Textures\ModifChargFX.utx PACKAGE=NWModifiersV3.ModChargerFX
And it worked then. Yet, it compiled and recompiled with no problems previouslly, no logs, everything at 100%, but then in Ued or even ingame it simply didn't work at all, since it couldn't load due to a missing texture (obviouslly), although no logs were generated.

I now this doesn't fit your problem, but since this is one kind of mistake that can lead us to think ucc got screwed and then we realize it's a fault in the code itself, perhaps this can help you to figure out what's wrong in those dlls.
User avatar
Shadow
Masterful
Posts: 743
Joined: Tue Jan 29, 2008 12:00 am
Personal rank: Mad Carpenter
Location: Germany
Contact:

Re: UCC and the cryptic error...

Post by Shadow »

Yeah well I appreciate every help.

Yesterday I simply had no motivation anymore, that might delay the next Build but well...
I may have a more direct clue now, I CURRENTLY think, that the Class definition of sdkActor.uc (UnSDKActor.h) is messed up and some Variable, Constant or Function is missing from sdkActor.uc inside UnSDKActor.h - "NoExport" has it's advantages but that one is simply the worst disadvantage...

//edit: Yes, the Header-Class definition and the Unreal Script Class Definition of sdkActor.uc are asynchron, now I only have to find out which struct, variable or function is causing that error...

//edit2: I don't know exactly why but reaching a certain length of sdkActor.uc the UCC compiler starts getting mad, I first thought it were angry about some bad struct or enum definitions... nope, I simply tried fun structs and variables like

Code: Select all

struct LollyPop
{
  var() bool bNotCmdRikersVessel;
};
in Struct Header:

Code: Select all

struct LollyPop
{
  UBOOL bNotCmdRikersVessel;
};
adding THAT after the last bit of code that works, after that, no matter if the struct is well or badly defined, UCC throws these memory errors against me.. :ironic2:

I think somewhere something is just messed up due to not using UCC header export... currently it works because I "know" what causes the problem now - never experienced it before...
Image
User avatar
anth
Adept
Posts: 257
Joined: Thu May 13, 2010 2:23 am

Re: UCC and the cryptic error...

Post by anth »

If you want to build a upackage that is bound with a dll, then ALWAYS specify the -nobind parameter in your ucc.exe commandline. "Magic" stuff happens if you do not.
Post Reply