Hi all, my application crash with the following asserts First Crash ************************************* ASSERT FAIL: <2>thread.inl [ 106] <nofunc>() TRACE: <5>thread.cxx [ 366] <nofunc>() '<nomsg>' TRACE: <5>mlqueue.cxx [ 201] <nofunc>() '<nomsg>' TRACE: <5>mlqueue.cxx [ 267] <nofunc>()'<nomsg>' TRACE: <5>thread.cxx [ 390] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 599] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 599] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 599] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 599] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 599] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 121] <nofunc>()'<nomsg>' TRACE: <5>mboxt.inl [ 599] <nofunc>()'<nomsg>' TRACE: <5>mlqueue.cxx [ 832] <nofunc>()'<nomsg>' TRACE: <5>mlqueue.cxx [ 841] <nofunc>()'<nomsg>' TRACE: <5>thread.cxx [ 366] <nofunc>()'<nomsg>' TRACE: <5>mlqueue.cxx [ 201] <nofunc>()'<nomsg>' TRACE: <5>mlqueue.cxx [ 267] <nofunc>()'<nomsg>' TRACE: <5>thread.cxx [ 390] <nofunc>()'<nomsg>' TRACE: <5>mlqueue.cxx [ 118] <nofunc>()'<nomsg>' TRACE: <5>mlqueue.cxx [ 191] <nofunc>()'<nomsg>' TRACE: <2>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <2>sched.cxx [ 140] <nofunc>()'<nomsg>'
Scheduler: Lock: 1 Current Thread: COM-TX Threads: Idle Thread pri = 31 state = R id = 1 stack base = 80045268 ptr = 80045690 size = 00000600 sleep reason NONE wake reason NONE queue = 00000000 wait info = 00000000 COM-TX pri = 7 state = R id = 2 stack base = 80038e90 ptr = 80039710 size = 00000a00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 800397c0 COM-RX pri = 15 state = R id = 3 stack base = 80039890 ptr = 8003a0c8 size = 00000a00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 CLI pri = 20 state = S id = 4 stack base = 8003da90 ptr = 8003e610 size = 00000e00 sleep reason DELAY wake reason NONE queue = 00000000 wait info = 00000000 MODEM1 pri = 9 state = R id = 5 stack base = 8003c490 ptr = 8003c588 size = 00000a00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 RF1 pri = 9 state = R id = 6 stack base = 8003ae90 ptr = 8003b670 size = 00000b00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 MODEM2 pri = 9 state = S id = 7 stack base = 8003cf90 ptr = 8003d788 size = 00000a00 sleep reason WAIT wake reason NONE queue = 8004e364 wait info = 00000000 RF2 pri = 9 state = R id = 8 stack base = 8003b990 ptr = 8003c170 size = 00000b00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 MIRS pri = 11 state = R id = 9 stack base = 8003a290 ptr = 8003acf0 size = 00000c00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 8003ada0 TCP pri = 7 state = S id = 10 stack base = 8004b5bc ptr = 8004bbf0 size = 00000800 sleep reason TIMEOUT wake reason NONE queue = 8004b4b8 wait info = 00000000 ETH pri = 6 state = S id = 11 stack base = 8004bdbc ptr = 8004c448 size = 00000800 sleep reason WAIT wake reason NONE queue = 800337e8 wait info = 00000000 ******************************************************** It ASSERT from CYG_ASSERT( (cyg_uint32)stack_ptr > (cyg_uint32)stack_base, "Stack_ptr below base" ); But checking the Faulty thread as reported by the TRACE dump shows: stack base = 80038e90 ptr = 80039710 size = 00000a00 Second Crash ************************************* ASSERT FAIL: <6>thread.inl [ 106] <nofunc>() TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 439] <nofunc>()'<nomsg>' TRACE: <7>sched.cxx [ 439] <nofunc>()'<nomsg>' TRACE: <7>mlqueue.cxx [ 118] <nofunc>()'<nomsg>' TRACE: <7>mlqueue.cxx [ 191] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' Scheduler: Lock: 1 Current Thread: RF1 Threads: Idle Thread pri = 31 state = R id = 1 stack base = 80045268 ptr = 80045690 size = 00000600 sleep reason NONE wake reason NONE queue = 00000000 wait info = 00000000 COM-TX pri = 7 state = S id = 2 stack base = 80038e90 ptr = 80039710 size = 00000a00 sleep reason WAIT wake reason NONE queue = 8004e36c wait info = 800397c0 COM-RX pri = 15 state = R id = 3 stack base = 80039890 ptr = 8003a0c8 size = 00000a00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 CLI pri = 20 state = S id = 4 stack base = 8003da90 ptr = 8003e610 size = 00000e00 sleep reason DELAY wake reason NONE queue = 00000000 wait info = 00000000 MODEM1 pri = 9 state = S id = 5 stack base = 8003c490 ptr = 8003cc88 size = 00000a00 sleep reason WAIT wake reason NONE queue = 8004e354 wait info = 00000000 RF1 pri = 9 state = R id = 6 stack base = 8003ae90 ptr = 8003b670 size = 00000b00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 MODEM2 pri = 9 state = R id = 7 stack base = 8003cf90 ptr = 8003d088 size = 00000a00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 RF2 pri = 9 state = R id = 8 stack base = 8003b990 ptr = 8003c170 size = 00000b00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 MIRS pri = 11 state = S id = 9 stack base = 8003a290 ptr = 8003acf0 size = 00000c00 sleep reason WAIT wake reason NONE queue = 8004e344 wait info = 8003ada0 TCP pri = 7 state = S id = 10 stack base = 8004b5bc ptr = 8004bbf0 size = 00000800 sleep reason TIMEOUT wake reason NONE queue = 8004b4b8 wait info = 00000000 ETH pri = 6 state = S id = 11 stack base = 8004bdbc ptr = 8004c448 size = 00000800 sleep reason WAIT wake reason NONE queue = 80033670 wait info = 00000000 ******************************************************** It ASSERT from CYG_ASSERT( (cyg_uint32)stack_ptr > (cyg_uint32)stack_base, "Stack_ptr below base" ); But checking the Faulty thread as reported by the TRACE dump shows: stack base = 8003ae90 ptr = 8003b670 size = 00000b00 Third Crash ************************************* ASSERT FAIL: <6>smp.hxx [ 445] <nofunc>() TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 140] <nofunc>()'<nomsg>' TRACE: <6>sched.cxx [ 298] <nofunc>()'<nomsg>' Scheduler: Lock: 0 Current Thread: RF1 Threads: Idle Thread pri = 31 state = R id = 1 stack base = 80045268 ptr = 80045690 size = 00000600 sleep reason NONE wake reason NONE queue = 00000000 wait info = 00000000 COM-TX pri = 7 state = S id = 2 stack base = 80038e90 ptr = 80039710 size = 00000a00 sleep reason WAIT wake reason NONE queue = 8004e36c wait info = 800397c0 COM-RX pri = 15 state = R id = 3 stack base = 80039890 ptr = 8003a0c8 size = 00000a00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 CLI pri = 20 state = R id = 4 stack base = 8003da90 ptr = 8003e610 size = 00000e00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 MODEM1 pri = 9 state = S id = 5 stack base = 8003c490 ptr = 8003cc88 size = 00000a00 sleep reason WAIT wake reason NONE queue = 8004e354 wait info = 00000000 RF1 pri = 9 state = R id = 6 stack base = 8003ae90 ptr = 80033860 size = 00000b00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 MODEM2 pri = 9 state = S id = 7 stack base = 8003cf90 ptr = 8003d788 size = 00000a00 sleep reason WAIT wake reason NONE queue = 8004e364 wait info = 00000000 RF2 pri = 9 state = R id = 8 stack base = 8003b990 ptr = 8003c170 size = 00000b00 sleep reason NONE wake reason DONE queue = 00000000 wait info = 00000000 MIRS pri = 11 state = S id = 9 stack base = 8003a290 ptr = 8003acf0 size = 00000c00 sleep reason WAIT wake reason NONE queue = 8004e344 wait info = 8003ada0 TCP pri = 7 state = S id = 10 stack base = 8004b5bc ptr = 8004bbf0 size = 00000800 sleep reason TIMEOUT wake reason NONE queue = 8004b4b8 wait info = 00000000 ETH pri = 6 state = S id = 11 stack base = 8004bdbc ptr = 8004c448 size = 00000800 sleep reason WAIT wake reason NONE queue = 800337e8 wait info = 00000000 Must say that I'm mangling the scheduler lock/unlock by: void cyg_scheduler_lock(void) __THROW; void cyg_scheduler_unlock(void) __THROW; >From 2 places: - Flash Driver - locks/unlocks during erase/program. - I have my own MBOX_Send XXX_RETCODE MBOX_send_to(UINT32 client_id, void* buffer) { XXX_RETCODE rc = RETCODE_SUCCESS; cyg_scheduler_lock(); if(cyg_mbox_tryput(BY_REQUEST_mbox_handle[client_id],buffer)) { cyg_semaphore_post(&SEMAPHORE_obj[client_id]); } else { rc = RETCODE_FAIL; } cyg_scheduler_unlock(); return rc; } This function sends msg between my app threads. - uses tryput to avoid blocking - post semaphore. Does anyone has good idea who I get this states? Thanks Elad -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss