IRC channel logs

2021-10-25.log

back to list of logs

<oriansj>stikonas: looks like it fixed the bug introduced by 435dc609438f0ca260fd9524e5d88ab743187e3a so merged
<stikonas>yes, before that commit some exit statuses were ignored, but it broke crash detection...
<stikonas>now everything should work
<oriansj>glad to see more details are being properly addressed.
<stikonas>on the other hand, I'm not sure what causes mes-m2 to crash on risc-v...
<stikonas>somehow malloc fails to reserve memory and returns 0 pointer
<stikonas>but I don't yet understand why
<oriansj>well mes-m2 is much harder to reason about than all of stage0-posix put together.
<oriansj>as interpreters are harder to reason about than compilers
<stikonas>in general yes, but this crash happens really early in mes init before any complicated stuff is reached
<stikonas>but yes, mes-m2 is definitely much more complicated than m2-planet
***stikonas_ is now known as stikonas
<muurkha> https://raw.githubusercontent.com/mortie/rv32i-logisim-cpu/main/screenshots/cpu.png this is a whole RISC-V CPU design
<muurkha>well, maybe it would be fairer to call it a prototype. it can run programs compiled with clang though
<stikonas>well, we don't support riscv32 in stage0-posix yet
<stikonas>somebody has to do it, but should be easy enough
<cwebber>hi hi
<stikonas>cwebber: hi
<gbrlwck>in mes-m2: what is char **envp? it is passed from main to init but seems unused?
<fossy>envp contains all envars
<muurkha>yeah, a few (mostly very old) C programs depend on this way of providing the environment
<gbrlwck>huh, thanks!
<muurkha>remember that in the early days of C there wasn't much of a standard library. vi predates malloc()
<muurkha>not sure when getenv() and family were born
<stikonas>do we actually need to support those very old C programs?
<stikonas>is there something in live-bootstrap that does not use getenv()?
<muurkha>probably, because both GCC https://www.gnu.org/s/libc/manual/html_node/Program-Arguments.html and Visual C++ https://docs.microsoft.com/en-us/cpp/c-language/arguments-to-main support them
<muurkha>but maybe we don't really care
<fossy>dosent stage0-POSIX use envp
<muurkha>even POSIX doesn't guarantee the envp argument: https://stackoverflow.com/questions/10321435/is-char-envp-as-a-third-argument-to-main-portable
<stikonas>yes, kaem indeed uses envp
<muurkha>we could change it if we wanted
<gbrlwck>what is the "location" argument used for in try_open_boot?
<gbrlwck>what would be the benefit of changing the envp thing?
<stikonas>gbrlwck: where is that try_open_boot?
<stikonas>oh, that's in mes.c
<stikonas>gbrlwck: I guess directory
<stikonas>where boot-0.scm is located
<gbrlwck>but it's only used in that debugging output
<stikonas>hmm
<stikonas>janneke: ?
<stikonas>oh, I think it has to match paths in open_boot
<stikonas>so try_open_boot indeed only uses it for debugging
<stikonas>but if you look at open_boot there are a few invocation of try_open_boot with different arguments
<stikonas>but with different g_datadir
<gbrlwck>yeah, i guess it's just a hint on why a file has been tried