Strange RVDS error

I have an RVDS project for a specific video decoder (its all C code) built for target ARM926EJ-S, done using RVDS 2.2 simulator. I am not using any unload file / <config file> / <map file> to mention various memory segments in code such as stack segment, Heap, data segment, code segment for RVDS simulator environment.

  • When I add or comment out some code (redundant / dead code), then compile the project and execute it, the decoder gracefully steps out of mentioning that an error condition has occurred, which shouldn't have been since the comments / added code is redundant and does not affect functionality at all.
  • Now if I do the opposite of what I did in 1.), that is, the uncomment code that was commented out in step 1.), and compile and execute, the decoder works fine until it's logical.
  • Same C source and header files work just fine in MSVC workspace.

I've tried to debug a lot because of this behavior, but I can't pinpoint the exact cause and fix it.

  • Is this a case of stack corruption as I add / remove code?
  • Is there any segment overwritten, such as a Stack segment overflowing into a data segment, or a code segment overflowing into a data segment?
-1


source to share


2 answers


I had something similar with a project I was working on. As a result, there was a problem with a reference to an uninitialized pointer to the stack. This usually indicates unused program memory and overwrites code that was not used.

When I was deleting unused code, all of a sudden it was pointing to a memory that wasn't mine to modify and it would exit unaided.



Double check your mallocs and have confidence in your function variable pointers!

0


source


You initialize the ZI section to zero. I think the runtime scatter code initialized the ZI section (mine won't be around for a while). We had a problem initializing the ZI section with some data left over from our program loader.



As a result, changing any line in the code will cause it to crash in the same place. Even deleting the code will crash. I would confirm that the ZI section is zero at the beginning of your program.

0


source







All Articles