Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 7 years ago

Closed 6 years ago

#492 closed defect (fixed)

btrace kcon command panics on arm32.

Reported by: Jan Vesely Owned by: Jiri Svoboda
Priority: major Milestone: 0.6.0
Component: helenos/kernel/arm32 Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description (last modified by Jakub Jermář)

I tried to see btrace of compositor thread
kconsole> btrace 29
Scheduling thread stack trace.
kconsole> Thread 29 stack trace:
0x0002bd0c: 0x00000000()
0xe28db00c: test/thread/thread1.o:threads_fi?R???d'?()+0x6e5a61c8

######> Kernel panic on cpu0 due to a failed assertion: <######
waitq_sleep_timeout() at generic/src/synch/waitq.c:264:

(!PREEMPTION_DISABLED)
(PARAM_NON_BLOCKING(flags, usec))

THE=0x81956000: pe=1 thr=0x80564600 task=0x80624000 cpu=0x81955000 as=0x818c45a0 magic=0xfacefeed
cpu0: halted

Attachments (1)

am64-btrace-panic.png (27.5 KB) - added by Jan Vesely 7 years ago.
pnic on adm64

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Jan Vesely

Attachment: am64-btrace-panic.png added

pnic on adm64

comment:1 Changed 7 years ago by Jan Vesely

Looks like btrace of live threads is a problem on other arches too.

comment:2 Changed 6 years ago by Jakub Jermář

Description: modified (diff)

The problem (on arm32) is that istate_get() in syscall_handler(), for some reason, returns an address, which is 8 bytes off the actual istate_t structure on the kernel stack.

comment:3 Changed 6 years ago by Jakub Jermář

Looks like the discrepancy is explained by the following:

arm32 before_thread_runs_arch():

        stck = &THREAD->kstack[STACK_SIZE - SP_DELTA];
        supervisor_sp = (uintptr_t) stck;

istate_get():

       return (istate_t *) ((uint8_t *)
            thread->kstack + STACK_SIZE - sizeof(istate_t));

comment:4 Changed 6 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

Fixed in mainline,1750.

Note: See TracTickets for help on using tickets.