OP-TEE / optee_os

Trusted side of the TEE
Other
1.56k stars 1.05k forks source link

malloc() error in optee os #1792

Closed FormerBuckeye closed 6 years ago

FormerBuckeye commented 7 years ago

Hi all,

I am trying to allocate an array of type of char in optee os like:

str = (unsigned char )malloc(strlen((const char )str1)+100);

But it shows one error called:

ERROR: TEE-CORE: Assertion 'ct != -1 && threads[ct].state == THREAD_STATE_ACTIVE' failed at core/arch/arm/kernel/thread.c:1068

Could you help me with that? Thanks!

igoropaniuk commented 7 years ago

Hi @FormerBuckeye,

I guess this assertion failure occurs not exactly while calling malloc. (as malloc implementation in the TEE core is using spilocks for syncronization, but assertion fails inside void thread_add_mutex(struct mutex *m)),

I suppose that problem is in some another line, where your are trying to lock a mutex. If it's true (that you are using mutexes), then seems that you are trying to lock it inside interrupt/abort handler.

ghost commented 6 years ago

We are closing this issue/question, why?

If you however feel that you have additional questions or still thinks this is an issue, then please feel free to re-open the issue again. When closing issues we will only show this entire message once.

// OP-TEE admins