Compiler hangs and never finishes

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

Compiler hangs and never finishes

Post by kanderson » Wed Nov 27, 2013 7:35 pm

I'm having an odd problem where the compiler hangs and never finishes executing. I'm using a script to call Swordfish.exe on the command line, using version 2.2.1.8 on windows 7. When I open my task manager, it shows Swordfish.exe using 0% CPU time.

If I try to compile the project in the Swordfish IDE, an error popup comes that says "Swordfish IDE Access violation at address 00403BA4 in module 'SwordfishIDE.exe'. Read of address 00000002." Then the compiler runs forever.

I don't get any compiler errors or warnings, it just hangs. The funny thing is that if I comment out some of my code, the compiler finishes and reports no errors. The code I commented out is a call to a function in a module I made (the module compiles on its own just fine).

Any ideas?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Wed Nov 27, 2013 7:38 pm

source code?

User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

Re: source code?

Post by kanderson » Wed Nov 27, 2013 8:03 pm

I'll ask permission from my boss to send source code.

Aside: I realized it was actually compiler version 2.2.1.4 that I was using. When I switched back to 2.2.1.8, commenting out my module function call doesn't cause it to complete compiling, it hangs either way...

User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

Re: source code?

Post by kanderson » Wed Nov 27, 2013 8:55 pm

I've sent you an email with my source code

I'm also occasionally getting an ASM error... the generated ASM is here
LFSR -1,WDTA_M481_U24

What might cause the compiler to generate ASM with -1 as the FSR#?

Edit: PS: when I recompile the program, the ASM error goes away...

User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

Working now

Post by kanderson » Wed Nov 27, 2013 9:46 pm

In the code I sent you, in the file Keypad_FT2100.bas

I changed the following

Code: Select all


private dim
    newKeyPressDetected as boolean,
    lastKeyPressed as byte,
    keyHeldDownCount as word,
    differentKeyPressed as boolean

public function newKeyWasPressed() as newKeyPressDetected

	// result = newKeyPressDetected

end function

public function getLastKeyPressed() as lastKeyPressed

	// result = lastKeyPressed

end function

public inline function getKeyHeldDownCount() as keyHeldDownCount

	// result = keyHeldDownCount

end function

public inline function differentKeyWasPressed() as differentKeyPressed

	// result = differentKeyPressed

end function

into the following, and it was fixed...

Code: Select all

private dim
    newKeyPressDetected as boolean,
    lastKeyPressed as byte,
    keyHeldDownCount as word,
    differentKeyPressed as boolean

public inline function newKeyWasPressed() as boolean

	result = newKeyPressDetected

end function

public inline function getLastKeyPressed() as byte

	result = lastKeyPressed

end function

public inline function getKeyHeldDownCount() as word

	result = keyHeldDownCount

end function

public inline function differentKeyWasPressed() as boolean

	result = differentKeyPressed

end function

but why?

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Thu Nov 28, 2013 12:02 pm

Your workaround is correct. I have a new BETA build for you but I need to know if your mailbox will accept two zipped executable about 4MB in size...

User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

executables

Post by kanderson » Thu Nov 28, 2013 4:53 pm

I don't think my mailbox will accept them as is... a workaround is to change the file extension on the archive files... for example, change
zippedExecutable.zip to zippedExecutable.changethistozip

The mail server won't think to try and look in the archive...

User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

Got the executables

Post by kanderson » Thu Nov 28, 2013 5:06 pm

my mail is forwarded to gmail which whouldn't accept the file. But when I checked my work email it was there. I tried to compile using the new executables...

The one that wouldn't compile still wouldn't compile, it just hung there forever. I'm pretty sure I used the right binary because the output from Swordfish.exe said "Swordfish BASIC Compiler 2.2.1.8 (BETA B3) Copyright (c) 2011 Mecanique". This only showed up when I compiled the source that would compile.

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Thu Nov 28, 2013 5:14 pm

Works here with the files you sent me...

User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

Post by kanderson » Thu Nov 28, 2013 5:47 pm

oh yes, actually if I revert and compile the code I sent you it works... however if I try to compile it with the changes I've made since then, it hangs... I'll email you the code where it hangs

User avatar
kanderson
Posts: 17
Joined: Tue Oct 15, 2013 4:28 pm
Location: Canada
Contact:

Post by kanderson » Thu Nov 28, 2013 6:04 pm

actually, cancel that... I can't reproduce the problem any more. Thanks a lot for your help, it looks like your fix works great!

Post Reply