How to determine why a task destroys VxWorks?

I have a VxWorks application running on ARM uC.

First let me generalize the application;

The application consists of a third-party stack and a gateway application. We have implemented an abstraction layer of the operating system to support OS dependencies.

The base stack has its own memory and control management module, which contains memory blocks in a doubly linked list.

For example; we do not directly execute thatNos / new, free /delege.Instead we call the OSA level routines, and it receives memory from the operating system and puts it in the list, then returns this application memory (routines: XXAlloc, XXFree, XXReAlloc).

And when freeing memory, we again use XXFree.

In fact, this block is a structure that has

-magical numbers indicating the beginning and end of the memory block — the size of what the user requested the allocation — to measure in reality due to alignment problems the previous and next pointers — show the piece of memory returned back to the application. which shows where in the application xxAlloc is called.

With this structure block, the stack can check if the block is damaged or not.

We also have a pthread library, which is ported from Linux, which we use for -create / terminate threads (currently there are 22 threads) -sync objects (events, mutexes ..)

There is a main task called taskSpawn, and later this task created other threads.

it was a description of the application and its VxWorks interface.

The problem is this:

VxWorks, , . jtag, VxWorks taskDestoy(), , r14.

, xxAlloc, , , .

, .

+3
3

.

. 20 malloc memset 0x55 .

, 20MB, - , 0x55.

! , CPU (- ), .

4

+1

, taskDestroy(). xxAlloc, , exit(), . OSAL .

0

, ; . .

1) , / VxWorks- ( ). , . , , . - , . VxWorks: Taskhooklib

2) / - . () . , , , .

The task will also end when the work is completed .. so it could be a return caused by an infinite loop. Especially if it is always the same task, it will be my hunch.

And some versions of VxWorks support MMUs that need to be considered.

0
source

Source: https://habr.com/ru/post/1713643/


All Articles