Jump to content
Sign in to follow this  
vbhunt

Exit Code Was -529697949

Recommended Posts

Bug description:

The following program fails with "Exit code -529697949" in BoostC 6.60.

 

The following is the smallest complete program I could make that doesn't compile.

It is reduced from a larger module to compute CRC-8 values for byte strings.

 

Steps to reproduce:

 

#include <system.h>
typedef unsigned char Byte;
#define PByte  Byte *  // this is temporary to address the typedef bug.

Byte r1 =
{
0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83,
0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41,
};

Byte r2 =
{
0x00, 0x9d, 0x23, 0xbe, 0x46, 0xdb, 0x65, 0xf8,
0x8c, 0x11, 0xaf, 0x32, 0xca, 0x57, 0xe9, 0x74,
};

Byte  cnt;                   
PByte pBuf;                 
Byte  rn;
Byte  ln;
Byte  crc;           	 

Byte computeCRC( PByte pBuf, Byte len )
{
   ln = 0;
   crc = 0;
   for ( cnt = 0; cnt < len; cnt++ )
   {
  	 rn = *pBuf;
  	 pBuf++;
       rn = rn ^ crc;
       asm
       {
      	 swapf _rn,W
      	 movwf _ln
       }
       ln = ln & 0x0F;
       rn = rn & 0x0F;
       crc = r1[ln] ^ r2[rn];
   }
   return crc;
}

The result is:

Building...

BoostC Optimizing C Compiler Version 6.60 (for PIC18 architecture)

http://www.sourceboost.com

Copyright© 2004-2006 Pavel Baranov

Copyright© 2004-2006 David Hobday

 

Licensed to V Bruce Hunt under Single user Pro License for 1 node(s)

Limitations: PIC18 max code size: Unlimited, max RAM banks:Unlimited

 

 

TestCRC8.c

"C:\Program Files\SourceBoost\boost.pic18.exe" TestCRC8.c -t PIC18F2520

Exit code was -529697949

Removing target: TestCRC8.obj

Failed to locate output file "C:\TTcode\TTcontrolTests\TestCRC8.hex'

Done

 

Failed

Expected behaviour:

I was hoping for either an error message for one or more lines; or a successful

compilation. I've shaved this down to the smallest workable failure. This program

should compile. At one point it did compile under 6.60

This program fails 100% of the time on my Athalon 64 running Windows XP SP2 running under SourceBoost IDE Version 6.60.

 

IDE version: SourceBoost IDE version 6.60

Compiler: BoostC Version 6.60 (for PIC18 architecture)

Target device: PIC18F2520

OS: Windows XP Pro Version 2002 Service Pack 2.

Computer is AMD Athlon 64 Processor (2.4GHZ, 4GB RAM)

 

Comments:

During the paring process, I observed that the result changed if standard C comments were added. That is, the failure remains; but the beginning of a comment

would be flagged as:

TestCRC8.c

 

failure

C:\TTcode\TTcontrolTests\TestCRC8.c(24):error: failure

"C:\Program Files\SourceBoost\boost.pic18.exe" TestCRC8.c -t PIC18F2520

Exit code was 1.

 

To reproduce this behavior, place a multi-line C comment with the comment opening, "/*" on a single line between the line

"Byte crc;" and the function computeCRC signature. On a seperate line in the comment place " * // * " to see the behavior change.

 

It appears that the comment state machine is not capable of handling additional comment characters.

 

It would be great to have a work-around and/or an explanation of how to go-about debugging upon such failures.

Share this post


Link to post
Share on other sites

The shortest code I could come up with is:

 

#include <system.h>
typedef unsigned char Byte;
Byte r1 = { 0x00, 0x5e};

 

Do you see your error now?

 

Regards,

Pavel

 

PS: I agree that the compiler should provide better error reports. We work on this but this is a very tricky area.

Share this post


Link to post
Share on other sites
The shortest code I could come up with is:

 

#include <system.h>
typedef unsigned char Byte;
Byte r1 = { 0x00, 0x5e};

 

Do you see your error now?

 

Regards,

Pavel

 

PS: I agree that the compiler should provide better error reports. We work on this but this is a very tricky area.

 

Yes, indeed! Thanks for pointing out my :unsure: bonehead mistake. It really had me going there for a good afternoon. Almost any indicator of where the error occured would be helpful. For a long time I thought it was related to the strange comment behavior. Anyway, thanks for the help. :D /Bruce

Share this post


Link to post
Share on other sites

The lack of error messages was investigated and fixed. It was caused by a "polite" copiler crash when compiler did not have a chance to display any error messages. Fix will be included into the coming release.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...