Another task trying to memPartFree my bss memory area - VxWorks

This is a discussion on Another task trying to memPartFree my bss memory area - VxWorks ; Hi, I am running into this memory problem where another task (not created by me) is trying to memPartFree a memory block that's within my bss area. Here is a little background information of what I am trying to do: ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Another task trying to memPartFree my bss memory area

  1. Another task trying to memPartFree my bss memory area

    Hi,

    I am running into this memory problem where another task (not created
    by me) is trying to memPartFree a memory block that's within my bss
    area. Here is a little background information of what I am trying to
    do:

    I have the following application to be loaded onto the PPC at different
    time:

    vxWorks.bin
    image1.bin (contains API functions needed by image3.bin)
    image2.bin (purpose is to load image3.bin during runtime)
    image3.bin (my main application)

    1st -vxWorks.bin loaded and started automatically
    2nd -image1.bin loaded and started by startup scripts
    3rd -image2.bin loaded and started by startup scripts
    4th -image3.bin loaded and started by image2.bin using loadModule and
    taskSpawn

    (I know the procedures are unconventional but it has to be done this
    way)

    problem:

    while a task on image3.bin is running, a task on image1.bin is
    attempting to memPartFree a memory block being used by image3.bin's bss
    area. This lead to a memPartFree error reported by vxWorks and the task
    on image1.bin gets suspended.

    Can someone tell me what they think is going on?
    Are any of my speculations sound right:
    - I am not sure if the task on image3.bin somehow corrupts the memory
    on image1.bin's task
    - task on image1.bin has a bad pointer
    - image3.bin is loaded onto working memory of image1.bin

    thanks for the help,


  2. Re: Another task trying to memPartFree my bss memory area

    On 20 May 2006, tykt77@hotmail.com wrote:

    > while a task on image3.bin is running, a task on image1.bin is
    > attempting to memPartFree a memory block being used by image3.bin's
    > bss area. This lead to a memPartFree error reported by vxWorks and
    > the task on image1.bin gets suspended.


    > Can someone tell me what they think is going on?
    > Are any of my speculations sound right:
    > - I am not sure if the task on image3.bin somehow corrupts the memory
    > on image1.bin's task
    > - task on image1.bin has a bad pointer
    > - image3.bin is loaded onto working memory of image1.bin


    You didn't specify "how" it is loaded. I am guessing "loadModule"? A
    problem if you have made a custom loader is that "data" != "code" on
    the PPC. You need some assembler to flush things from the dcache so
    that the icache can read it in.

    If you are using "loadModule", then I don't see how the last statement
    (image3.bin is loaded onto working memory of image1.bin). I am
    guessing that you are using loadable modules and not fully executable
    images (like a bootloader and an application vxWorks).

    If this is so, can use you the "moduleShow()" to take a look to see
    what vxWorks thinks is loaded?

    Sorry if all my quoted text is not the exact syntax. I dont' have
    access to vxWorks manual, etc at this time. You may have to do some
    work yourself (but from your previous posts, I think you can do that
    ;-).

    If everything is standard and "moduleShow()" is reporting sane values,
    are you sure that image3.bin gets some static data from image1.bin
    through the API and then frees it? I know it is obvious, but if the
    modules are by different programmers, it is probably very likely.

    hth,
    Bill Pringlemeir.

    --
    It is reasoning and faith that bind truth . - Rod Ryker...
    vxWorks FAQ, "http://www.xs4all.nl/~borkhuis/vxworks/vxworks.html"

  3. Re: Another task trying to memPartFree my bss memory area


    On 20 May 2006, spam_account@sympatico.ca wrote:
    > On 20 May 2006, tykt77@hotmail.com wrote:


    > Sorry if all my quoted text is not the exact syntax. I dont' have
    > access to vxWorks manual, etc at this time. You may have to do some
    > work yourself (but from your previous posts, I think you can do that
    > ;-).


    opps! I thought you were Michael Kesti. I am not ~sure~ that you are
    competent on second thought.

    --
    Schrodinger on QED: I don't like it, and I'm sorry I ever had anything
    to do with it.

    vxWorks FAQ, "http://www.xs4all.nl/~borkhuis/vxworks/vxworks.html"

  4. Re: Another task trying to memPartFree my bss memory area

    Hi:

    There's nothing exotic abou the way you are loading or your memory
    setup. It's not clear from your description who is creating these new
    partitions that are getting freed. The BSS and all the other parts of
    your module as mallo'ed to the correct size when the module loader is
    invoked, unless you are non linking relocatable. If you are having
    trouble with BSS, you may have issues with common memory sharing
    between you images - ie someone needs to really allocate space for the
    globals that other parts "extern".

    WindView has some useful tools for monitoring memoory allocation calls
    that may help show what's going on.

    Good luck,
    lc


+ Reply to Thread