This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SYSBIOS error upon loading code, also possible heap issue

Other Parts Discussed in Thread: SYSBIOS

So i am using 

SYSBIOS 6.34.1.14

XDC 3.24.3.33

Code Gen 7.3.8

NDK 2.21.1.38

I am getting the following error message in the ROV tool->BIOS section IMMEDIATELY AFTER I LOAD CODE:

,ti.sysbios.BIOS,Module,N/A,N/A,Caught exception in view init code: "C:/CCSv5/xdctools_3_24_03_33/packages/xdc/rov/StructureDecoder.xs", line 544: java.lang.Exception: Target memory read failed at address: 0x0, length: 4This read is at an INVALID address according to the application's section map. The application is likely either uninitialized or corrupt.

i have a huge heap located in "null" and i have heap tracker on. is that the problem? i had to rebuild the sysbios for long file name in FATFS, could that be it (no errors in the build after a fix in another post)? my .out file is 12MB is that it?

shortly after running this thing i get a lot of heap issues and i have a feeling it might be related.

any ideas what i should do to debug this error that shows up after just LOADING the code to my emulator?

something i've been noticing about the heap. when i load the program for a short time and then look at heapmem in the ROV it shows an error. that error is the "next" pointer for free space points to 0xffffffff and it declares that an error, which means it will not show me the remaining free space in the heap.  this happens on a code load. i feel like i am doing something wrong here with declaring my heap.  shall i attach the .cfg file?  is there something wrong with my xdc or sysbios installation?

  • You may need to close the ROV window until the application has reached main().

    Prior to reaching main(), many of the system objects remain "partially cooked" and may indeed have bogus values within them.

    If the error message occurs if you launch ROV AFTER arriving at main() then something may have gone wrong during system initialization.

    Alan

  • when i open the ROV window for the first time during a SWI i get the same first error

    ,ti.sysbios.BIOS,Module,N/A,N/A,Caught exception in view init code: "C:/CCSv5/xdctools_3_24_03_33/packages/xdc/rov/StructureDecoder.xs", line 544: java.lang.Exception: Target memory read failed at address: 0x0, length: 4This read is at an INVALID address according to the application's section map. The application is likely either uninitialized or corrupt.

  • so i assume nobody can figure this out?

  • Sorry, this fell off my radar. Can you share the .map file associated with your application?

    It can be found in your project's package/ directory.

    Alan

  • package directory? i know it is in the debug directory....i don't see a package directory

    GZUTIProject_SYSBIOS.zip
  • Previously you indicated that you placed a heap at 'null', which I assume to mean address 0x0.

    But the memory map shown in the .map file:

    MEMORY CONFIGURATION

             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      IROM                  11700000   00100000  00000000  00100000  R  X
      IRAM                  11800000   00040000  00028f28  000170d8  RW X
      Cache_L1P             11e00000   00008000  00000000  00008000  RW X
      L1DSRAM               11f00000   00004000  00003e80  00000180  RW  
      Cache_L1D             11f04000   00004000  00000000  00004000  RW X
      L3_CBA_RAM            80000000   00020000  00008790  00017870  RW X
      DDR                   c0000000   07000000  0600a06e  00ff5f92  RW X
      DDR_UNCACHED          c7000000   01000000  0012c020  00ed3fe0  RW X

    doesn't show any memory at 0x0.

    I believe this is the source of the error.

    ROV constrains its memory fetches to addresses defined in the memory map.

    Alan

  • i placed the heap in the "null" section, which should be default system location for the heap. this is how it was done in the sysbios online classes. the null section creates the heap at the start of DDR i believe

  • Oops. My bad.

    This appears to be a bug in the BIOS module's ROV view.

    I'm working on a patch to correct it and I'll update this thread ASAP.

    In the meantime, I believe the other ROV views should behave correctly. Yes?

    Alan

  • yes, they do

    i do still have this issue

    when i load the program for a short time and then look at heapmem in the ROV it shows an error. that error is the "next" pointer for free space points to 0xffffffff and it declares that an error

    it looks like the very last heap free slot gets currupted or it points to 0xffffffff to indicate that it is the end of the heap. i don't know what to this of this; is that the same error?

  • Can you show a screen capture of the error you're getting?

    You offered to provide the .cfg file before. That would probably be helpful.

    If you're will to export the whole project, that would be even better.

    Alan

  • I'm back peddling on the BIOS module ROV issue. What I thought was a bug actually isn't.

    The Heap error combined with the BIOS module view error are making me think the application is corrupting data structures somehow.

    Can you take a look at the Task module's "Detailed" view and confirm that there are no stack errors indicated?

    Same for the Task module's "Module" view?

    Alan

  • they are different issues. when i first run my project and break on the FIRST interrupt that ever runs, before the tasks or anything i get this error:

    Caught exception in view init code: "C:/CCSv5/xdctools_3_24_03_33/packages/xdc/rov/StructureDecoder.xs", line 544: java.lang.Exception: Target memory read failed at address: 0x0, length: 4This read is at an INVALID address according to the application's section map. The application is likely either uninitialized or corrupt.

    i am not saying that the other error i get, about the last entry in the heap mem being currupt couldn't be a memory overrun issue but i was wondering if the two might be related.  i would like the first problem to be fixed and if the second issue is really my own then i can work on whatever that is

    there are no other issues in the task stacks, system stack, etc when i get any of these errors

  • cobsonchael,

    Were you able to make any progress with this issue? Could you provide the .cfg and/or complete project for Alan to evaluate? I can help facilitate sending your project to Alan privately (off the forums) if you are more comfortable going that route.

    Thanks,

    Clinton

  • sorry i kind of last track of this. late last week. here is my cfg file

    app.cfg
  • Yes, I do think that the ROV HeapMem corruption error and the error you get when opening ROV for the first time are probably related.

    Any objects created dynamically from an apparently corrupted heap will themselves likely be internally corrupt, which could lead to bogus null pointers (ie the "Target memory read failed at address: 0x0, length: 4" error).

    I don't see anything OBVIOUSLY incorrect in your config file.

    But I am very suspicious about the size of the heap you specify:

      BIOS.heapSize = 41943040;

    That's almost 42 MegaBytes. Is that on purpose?

    From your map file, I see that the buffer for this heap is being placed at address 0xc0000000 and goes until address 0xc27fffff.

    Are you accidently sharing any of this address space with another processor?

    What device is this?

    Alan

  • that size is on purpose. we have a third party library that does our GUI and it does a lot of malloc/reallocs for a large display.  it takes a lot of heap.  in addition we are using the NDK which requires a heap

    we are running on a 6748

    there are no other processors running on this project, just the 6748

  • So, now I'm suspicious of the integrity of the third party library using the heap.

    All it takes is one use of a stale object handle and the heap will be corrupted from then on.

    Is it possible for you to do some breakpoint setting to narrow down when the heap ROV view begins showing an error?

    Alan

  • well the first error gets shown immediately after code load. if you tell me that since sysbios isn't loaded yet and the ROV window is not valid, it is also apparent immediately when i hot a breakpoint on my first HWI before anything else is running.

  • There are two errors you report:

    1) can't access memory at address 0

    2) HeapMem ROV view shows corruption.

    I'm wanting you to track down when error #2 shows up.

    Are you saying that it is present immediately?

    And when you say "immediately after code load", do you mean when the PC is halted at main() after the code is loaded?

    Alan

  • ,ti.sysbios.BIOS,Module,N/A,N/A,Caught exception in view init code: "C:/CCSv5/xdctools_3_24_03_33/packages/xdc/rov/StructureDecoder.xs", line 544: java.lang.Exception: Target memory read failed at address: 0x0, length: 4This read is at an INVALID address according to the application's section map. The application is likely either uninitialized or corrupt.

    occurs at code load

    and i turned off the "run to main" option for all of our projects so when i mean code load i mean at c_int00 before anything runs.

  • Then I'm not surprised about the error on code load. Is it still there when you arrive at main?

    And when does the HeapMem ROV error occur?

    Alan

  • that error is present at all times. it never "goes away and comes back" as far as i can tell

    the other error occurs sometime later and it is not always reliable when it occurs

  • Ok.

    Regarding the BIOS ROV view error. Can you confirm that the you have selected your SYS/BIOS 6.34.01.14 install for your CCS' RTSC preferences?

    This selection is made in the below Preferences pane launched from the "Window" menu:

    In the above, I've selected my 6.34.0.12 SYS/BIOS product.

    You should select 6.34.1.14 if that's what you built your application with.

    Alan

  • i am using

    XDC 3.24.3.33

    IPC 1.25.0.04

    SYSBIOS 6.34.2.18

    NDK 2.22.0.06

  • Have you made any progress in tracking down the source for error #2?

    Alan

  • no but it seems to be gone after working on the project during this time. either the issue got pushed to a bit of memory that won't show the issue or the various changes to the code fixed whatever memory leak we had

    any luck finding the first problem?

  • Not yet. I take it that issue #1 is still a problem...

  • Can you post your .out file and the associated application.rov.xs file that can be found in the same directory as the application.map file you posted earlier?

    That way I can load it here locally and track down the source of the error.

  • Alan,

    Thanks for all your help with this issue.

     

    cobsonchael,

    Are you still running into this problem? If so, can you provide Alan the files he requested?

     

    Thanks,

    Clinton

  • oops! sorry! i have been busy and i forgot the post.

    here is my out file

    Model2400i.zip
  • I'll need the aforementioned Model2400i_pe674.rov.xs file as well.

    Alan

  • Thanks!

    I am able to reproduce the problem.

    I hope to have this resolved soon.

    Alan

  • I found the problem.

    As a temporary workaround, you can make a one line change in one of the files within your SYS/BIOS installation.

    in the packages/ti/sysbios/BIOS.xs file, find this line:

            var threadType = Program.fetchArray({type:'xdc.rov.support.ScalarStructs.S_UInt', isScalar:true},
                            obj.smpThreadType,
                            numCores);

    and change it to this:

            var threadType = Program.fetchArray({type:'xdc.rov.support.ScalarStructs.S_UInt', isScalar:true},
                            obj.smpThreadType,
                            numCores, false);

    I'll file a bug to formally address this issue and report back soon.

    Alan

  • cobsonchael,

    Are you still having this issue? Were you able to implement Alan's workaround?

     

    Alan,

    Thanks again for all the help on this issue. Has the bug fix been addressed?

     

    Thanks,

    Clinton

  • i just tried it now. it did not make the error message go away.

    do i have to rebuild sysbios after i make this change?

  • Alan,

    Do you feel that re-building SYS/BIOS is required to push the fix through?  Thanks for your help on this.

    Regards,
    Walter

  • also, there are 2 iterations of this - do i do it to both?

  • cobsonchael,

    Could you please elaborate on what you mean by two iterations?

    Thanks,
    Walter

     

  • sorry i thought it showed up twice but when i looked closer i saw one is an int and the other is a char

    either way when i alter the right one it still didn't fix my problem and i am still having this issue. i haven't tried rebuilding sysbios because i would rather not have to do that unless i have to. if i have to let me know

  • cobsonchael,

     

    Based on the fact that the fix exists within the SYS/BIOS package, and that you are still experiencing the problem, I would recommend rebuilding SYS/BIOS.

     

    Walter

  • The change to the BIOS.xs file I provided does not require you to rebuild SYS/BIOS.

    It does require you to relaunch ROV for the code change to take effect.

    If you're still having the error then I suspect your CCS RTSC preferences are not set to point to the SYS/BIOS installation you've made the code change in.

    Alan

  • Clinton,

    The bug has been addressed in the SYS/BIOS 6.35.00 release which is due out within a month.

    Alan

  • well since your "fix" doesn't fix it for me i will be waiting for the next bios before i allow this to be declared "fixed"

  • Clinton,

    I want to be certain we're still talking about the initial BIOS module view error that occurs after you simply load the program and you're parked at main().

    If this is correct, then the above fix I proposed should resolve it.

    Since there are two similar looking statements in the BIOS.xs file, I'm wondering if you may have applied the change to the other one.

    Here is a larger peephole of the code section:

        if ((Program.build.target.name == "M3") ||
            (Program.build.target.name == "M4") ||
            (Program.build.target.name == "M4F")) {
            var threadType = Program.fetchArray({type:'xdc.rov.support.ScalarStructs.S_UChar', isScalar:true},
                            obj.smpThreadType,
                            numCores);
        }
        else {
            var threadType = Program.fetchArray({type:'xdc.rov.support.ScalarStructs.S_UInt', isScalar:true},
                            obj.smpThreadType,
                            numCores);
        }

    The change needs to go into the 'else' clause:

        if ((Program.build.target.name == "M3") ||
            (Program.build.target.name == "M4") ||
            (Program.build.target.name == "M4F")) {
            var threadType = Program.fetchArray({type:'xdc.rov.support.ScalarStructs.S_UChar', isScalar:true},
                            obj.smpThreadType,
                            numCores);
        }
        else {
            var threadType = Program.fetchArray({type:'xdc.rov.support.ScalarStructs.S_UInt', isScalar:true},
                            obj.smpThreadType,
                            numCores, false);
        }

    The 'if' clause doesn't apply to C6748 DSP.

    Can you confirm that after making the above change the BIOS ROV view problem still exists?

    Alan



  • yes, i made the change to the right one and i still have the issue . i am still getting an error when in main right after code load. here is the error message again: taken today

    Caught exception in view init code: "C:/CCSv5/xdctools_3_24_05_48/packages/xdc/rov/StructureDecoder.xs", line 544: java.lang.Exception: Target memory read failed at address: 0x0, length: 4

    tell me what you need from me to verify i did it right or that i have a different problem

  • Please post your updated BIOS.xs file.

    Alan

  • Nice work!

    Then I suspect the SYS/BIOS installation you made the change to BIOS.xs in is NOT the installation that ROV is using.

    Can you confirm in the Window->Preferences->RTSC pane that the corresponding SYS/BIOS installation has been checked:

    Alan

  • nothing is checked in any of them