xv6-riscv icon indicating copy to clipboard operation
xv6-riscv copied to clipboard

balloc: out of blocks when compiled with -O3

Open efenniht opened this issue 4 years ago • 9 comments

I compiled xv6 with -O3 (modified CFLAGS in Makefile), and ran usertests. I expected it runs successfully, but I got kernel panic: balloc: out of blocks in writebig.

efenniht avatar Jan 19 '21 06:01 efenniht

I did not change anything but also got the kernel panic: balloc: out of blocks in writebig. BTW, I am working on lock lab, ran xv6 in wsl2.

gygzhang avatar Mar 28 '22 08:03 gygzhang

I did not change anything but also got the kernel panic: balloc: out of blocks in writebig. BTW, I am working on lock lab, ran xv6 in wsl2.

Hello, have you solved it? I am encountering this PANIC with the same env you showed

horbyn avatar Apr 13 '22 06:04 horbyn

I did not change anything but also got the kernel panic: balloc: out of blocks in writebig. BTW, I am working on lock lab, ran xv6 in wsl2.

Hello, have you solved it? I am encountering this PANIC with the same env you showed

no, i gave up, I think just pass the bcachetest is enough probably. Actually, i can pass kmemtest, bcachetest, usertests one by one in xv6, but just failed in "writebig" while runing make grade or ./grade-lab-lock

gygzhang avatar Apr 13 '22 08:04 gygzhang

I did not change anything but also got the kernel panic: balloc: out of blocks in writebig. BTW, I am working on lock lab, ran xv6 in wsl2.

Hello, have you solved it? I am encountering this PANIC with the same env you showed

no, i gave up, I think just pass the bcachetest is enough probably. Actually, i can pass kmemtest, bcachetest, usertests one by one in xv6, but just failed in "writebig" while runing make grade or ./grade-lab-lock

ohhhhh, i have solved unexpectedly!!! Just modify the macro FSSIZE to bigger(i modified from 1000 to 10000) in kernel/param.h

horbyn avatar Apr 13 '22 09:04 horbyn

I did not change anything but also got the kernel panic: balloc: out of blocks in writebig. BTW, I am working on lock lab, ran xv6 in wsl2.

Hello, have you solved it? I am encountering this PANIC with the same env you showed

no, i gave up, I think just pass the bcachetest is enough probably. Actually, i can pass kmemtest, bcachetest, usertests one by one in xv6, but just failed in "writebig" while runing make grade or ./grade-lab-lock

ohhhhh, i have solved unexpectedly!!! Just modify the macro FSSIZE to bigger(i modified from 1000 to 10000) in kernel/param.h

you slove it ! i gonna try it later

gygzhang avatar Apr 13 '22 11:04 gygzhang

I did not change anything but also got the kernel panic: balloc: out of blocks in writebig. BTW, I am working on lock lab, ran xv6 in wsl2.

Hello, have you solved it? I am encountering this PANIC with the same env you showed

no, i gave up, I think just pass the bcachetest is enough probably. Actually, i can pass kmemtest, bcachetest, usertests one by one in xv6, but just failed in "writebig" while runing make grade or ./grade-lab-lock

ohhhhh, i have solved unexpectedly!!! Just modify the macro FSSIZE to bigger(i modified from 1000 to 10000) in kernel/param.h

Yeah I think that this issue is caused by the fact that FSSIZE is too small. When you move forward and in the next "file system" lab you would see the macros below.

#ifdef LAB_FS
#define FSSIZE       200000  // size of file system in blocks
#else
#ifdef LAB_LOCK
#define FSSIZE       10000  // size of file system in blocks
#else
#define FSSIZE       2000   // size of file system in blocks
#endif
#endif

u2386 avatar May 04 '22 06:05 u2386

Just FYI, I faced this same issue in xv6-labs-2021 while doing the traps labs. While the alarmtest was successful, the usertests were failing. I had two solutions for solving the alarmtest, one that I would describe the normal way and the other one the lazy way. I tried both and although alarmtest was passing for both, usertests were failing in the manywrites test and I was getting the exact same error described in this thread. I changed the FSSIZE parameter from 1000 to 10000 and then the usertests passed.

sudk1896 avatar Aug 07 '22 07:08 sudk1896

Met the same problem when adding -g3, here is the detailed description: https://github.com/mit-pdos/xv6-riscv/issues/133

ttzytt avatar Aug 21 '22 03:08 ttzytt

I came up with the same problem with the environment on GitHub Codespace when doing the Lab Traps. I can pass the alarmtest too. Only need to do is to modify the macro FSSIZE in kernel/param.h form 1000 to 1010 is Ok.

SourVoice avatar Oct 11 '22 11:10 SourVoice