J-dbd / PintOS_lab

Other
0 stars 0 forks source link

11/24 timer_sleep try #4

Closed J-dbd closed 11 months ago

J-dbd commented 11 months ago
os -- run alarm-multiple
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
Kernel command line: run alarm-multiple
0 ~ 9fc00 1
100000 ~ ffe0000 1
Pintos booting with: 
        base_mem: 0x0 ~ 0x9fc00 (Usable: 639 kB)
        ext_mem: 0x100000 ~ 0xffe0000 (Usable: 260,992 kB)
Kernel PANIC at ../../lib/kernel/list.c:158 in list_insert(): assertion `is_interior (before) || is_tail (before)' failed.
Call stack: 0x80042132e2 0x800421382b 0x8004213ad3 0x8004206d1e 0x800420977e 0x80042069ed 0x80042060df.
The `backtrace' program can make call stacks useful.
Read "Backtraces" in the "Debugging Tools" chapter
of the Pintos documentation for more information.

Kernel PANIC at ../../lib/kernel/list.c:158 in list_insert(): assertionis_interior (before) || is_tail (before)' failed.` 11/25: 살펴 보고 체크하기.

unblock() 에서 pop 함수 다시 넣고 시도

@:~/workspace/PintOS_lab/threads/build$ pintos -- run alarm-multiple
qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
Kernel command line: run alarm-multiple
0 ~ 9fc00 1
100000 ~ ffe0000 1
Pintos booting with: 
        base_mem: 0x0 ~ 0x9fc00 (Usable: 639 kB)
        ext_mem: 0x100000 ~ 0xffe0000 (Usable: 260,992 kB)
Kernel PANIC at ../../lib/kernel/list.c:242 in list_remove(): assertion `is_interior (elem)' failed.
Call stack: 0x80042132f8 0x8004213b4e 0x8004213bb3 0x8004206e21 0x8004206c21 0x80042069ce 0x80042060df.
The `backtrace' program can make call stacks useful.
Read "Backtraces" in the "Debugging Tools" chapter
of the Pintos documentation for more information.

Kernel PANIC at ../../lib/kernel/list.c:242 in list_remove(): assertionis_interior (elem)' failed.`

void
thread_unblock (struct thread *t) {
    enum intr_level old_level;

    ASSERT (is_thread (t));

    old_level = intr_disable ();
    ASSERT (t->status == THREAD_BLOCKED);
    list_push_back (&ready_list, &t->elem);
    /////////////////////////////////////////////

    if(list_empty(&blocked_list)){
        /* blocked_list가 비어있지 않다면 <-이게 누락됐었음 */
        list_pop_front(&blocked_list); //block list의 front pop;
    }

    /////////////////////////////////////////////
    t->status = THREAD_READY;
    intr_set_level (old_level);
}

이하 코멘트

J-dbd commented 11 months ago

Kernel PANIC at ../../lib/kernel/list.c:158 in list_insert(): assertion 'is_interior (before) || is_tail (before)' failed.

Kernel command line: -q run alarm-multiple
0 ~ 9fc00 1
100000 ~ ffe0000 1
Pintos booting with: 
        base_mem: 0x0 ~ 0x9fc00 (Usable: 639 kB)
        ext_mem: 0x100000 ~ 0xffe0000 (Usable: 260,992 kB)
Kernel PANIC at ../../lib/kernel/list.c:158 in list_insert(): assertion `is_interior (before) || is_tail (before)' failed.
Call stack: 0x8004213312 0x800421385b 0x8004213b03 0x8004206d1e 0x80042097ae 0x80042069ed 0x80042060df.
The `backtrace' program can make call stacks useful.
Read "Backtraces" in the "Debugging Tools" chapter
of the Pintos documentation for more information.
Timer: 0 ticks
Thread: 0 idle ticks, 0 kernel ticks, 0 user ticks
Console: 637 characters output
Keyboard: 0 keys pressed
Powering off.

아까와 같은 문제 같은데 다시 체크

J-dbd commented 11 months ago

Kernel PANIC at ../../lib/kernel/list.c:158 in list_insert(): assertion 'is_interior (before) || is_tail (before)' failed.

Kernel command line: -q run alarm-multiple
0 ~ 9fc00 1
100000 ~ ffe0000 1
Pintos booting with: 
        base_mem: 0x0 ~ 0x9fc00 (Usable: 639 kB)
        ext_mem: 0x100000 ~ 0xffe0000 (Usable: 260,992 kB)
Kernel PANIC at ../../lib/kernel/list.c:158 in list_insert(): assertion `is_interior (before) || is_tail (before)' failed.
Call stack: 0x8004213312 0x800421385b 0x8004213b03 0x8004206d1e 0x80042097ae 0x80042069ed 0x80042060df.
The `backtrace' program can make call stacks useful.
Read "Backtraces" in the "Debugging Tools" chapter
of the Pintos documentation for more information.
Timer: 0 ticks
Thread: 0 idle ticks, 0 kernel ticks, 0 user ticks
Console: 637 characters output
Keyboard: 0 keys pressed
Powering off.

아까와 같은 문제 같은데 다시 체크

thread_init (void) {
    ASSERT (intr_get_level () == INTR_OFF);

    /* Reload the temporal gdt for the kernel
     * This gdt does not include the user context.
     * The kernel will rebuild the gdt with user context, in gdt_init (). */
    struct desc_ptr gdt_ds = {
        .size = sizeof (gdt) - 1,
        .address = (uint64_t) gdt
    };
    lgdt (&gdt_ds);

    /* Init the globla thread context */
    lock_init (&tid_lock);
    list_init (&ready_list);
    list_init (&destruction_req);
    ////////////////////////////////////
    list_init (&blocked_list);
    /////////////////////////////////////

    /* Set up a thread structure for the running thread. */
    initial_thread = running_thread ();
    init_thread (initial_thread, "main", PRI_DEFAULT);
    initial_thread->status = THREAD_RUNNING;
    initial_thread->tid = allocate_tid ();
}

초기화 문제였으며 해결함

J-dbd commented 11 months ago
Kernel command line: -q run alarm-multiple
0 ~ 9fc00 1
100000 ~ ffe0000 1
Pintos booting with: 
        base_mem: 0x0 ~ 0x9fc00 (Usable: 639 kB)
        ext_mem: 0x100000 ~ 0xffe0000 (Usable: 260,992 kB)
Calibrating timer...  204,600 loops/s.
Boot complete.
Executing 'alarm-multiple':
(alarm-multiple) begin
(alarm-multiple) Creating 5 threads to sleep 7 times each.
(alarm-multiple) Thread 0 sleeps 10 ticks each time,
(alarm-multiple) thread 1 sleeps 20 ticks each time, and so on.
(alarm-multiple) If successful, product of iteration count and
(alarm-multiple) sleep duration will appear in nondescending order.
current_thread: thread 0
CT's tick setting: 108
Kernel PANIC at ../../threads/thread.c:230 in thread_block(): assertion `intr_get_level () == INTR_OFF' failed.
Call stack: 0x800421332b 0x8004206ce5 0x800420cf19 0x8004216f38 0x8004207210.
The `backtrace' program can make call stacks useful.
Read "Backtraces" in the "Debugging Tools" chapter
of the Pintos documentation for more information.
Timer: 38 ticks
Thread: 2 idle ticks, 36 kernel ticks, 0 user ticks
Console: 1 *  Terminal will be reused by tasks, press any key to close it. 

thread_block의 이슈 시작

J-dbd commented 11 months ago

11/25 일에 pintos pptx를 보면서 다시 시작함