mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.58k stars 2.38k forks source link

bug?: kfree the same page twice #191

Open qin-you opened 12 months ago

qin-you commented 12 months ago

in kernel/proc.c freeproc() function :

kfree((void*)p->trapframe);                                  // first
proc_freepagetable(p->pagetable, p->sz);
         uvmunmap(pagetable, TRAPFRAME, 1, 0);
                     kfree((void*)pa);                                // second

kfree will not give up this duplicated page, and this could lead to some problems. I delete the first kfree above and the code works well.