IRC channel logs
2021-09-26.log
back to list of logs
<oriansj>Store_String only allocates 256bytes (buffer overflow) <stikonas>are you incraesing the buffer? or should I do that? <oriansj>I'm thinking of what the correct thing to do is. the simplest would be unify the max string size to match the M1 default (4K) but because M0 doesn't deduplicate nor use a scratch it ends up being a good bit bigger in terms of RAM (about 300MB if we do 4K but only 16MB if we do 256) <stikonas>especially since M0 does not compile large programs... <stikonas>M1 might be used to build something much bigger <oriansj>and 16MB of RAM is far easier to bootstrap in regards to core memory or current libre lithography process than 300MB <oriansj>and having different values would enable us to notice the differences between architectures to highlight if we change M2-Planet in a way that breaks the 256 boundary like this in the future. <stikonas>well, in principle that should be enough if cc_riscv64 is implemented without bugs <oriansj>unless I modify M2-Planet's test1000 to also check for too large strings in M1. <stikonas>although, let me test if M0 now works fine on M2.M1 <oriansj>the question is does M1 and M0 output (when built by the full C hex2 produce the exact same output) <oriansj>(hence why I suggested after both pass through the full C hex2) <oriansj>as whitespace differences are expected between M0 and M1 but the hex2 inputs should functionally be identical <stikonas>so I think you found a different bug with those weird strings <oriansj>well one stupid hack is have brk add 512 to all non-zero sized requests <oriansj>and if the garbage still exists it is because the kernel isn't zeroing memory before passing it to our process. <oriansj>which will eliminate all under allocation problems (or add 1MB if you are really worried) <stikonas>maybe it's qemu translation layer messing up something <stikonas>not too sure about what qemu does exactly <stikonas>although, it might be crashing less frequently <oriansj>make all allocations a multiple of 8? <stikonas>let me first reduce string buffer back to 256 <stikonas>crash in #0 Reverse_List_Loop () at M0_riscv64.S:257 <stikonas>but that's only because it's the first place where dereference happens <stikonas>well, a1 already contains some garbage at that time <oriansj>does the load not set the whole register? <stikonas>and M0 is able to build cc_riscv64 just fine... So must be quite corner-case bug <stikonas>as that malloc is the only function that writes to s4 register <stikonas>no, I don't think syscalls touch s registers <oriansj>what registers does linux syscalls actually use <stikonas>a7 is syscall number then a0, a1, a2, ... a6 are syscall arguments <oriansj>because any register used in a syscall maybe modified during any syscall <stikonas>well, it returns a0 and then we do mv s1, a0 # Set our malloc pointer <stikonas>for some reason I have it only once pushed and popped from the stack <stikonas>but not used at all, so those lines can be removed <oriansj>well the pops at the end of Reverse_List are to undo all register changes except the register used to return the reversed list <oriansj>one thing you can do is have gdb break when S4 changes <stikonas>well, some are comments but there are still a lot... <oriansj>the top 32bits from malloc should always be zero right? <oriansj>so only break if the top 32bits are anything other than zero <stikonas>but I don't understand yet why that happens... <oriansj>well breaking when it does, lets us know where to give us more clues <janneke>pabs3: thanks. i've completed the commit messages by adding the changelog and and applied the patch set <pabs3>janneke: the commit messages were already in the patchset, there were two commits <pabs3>ah, I see what you mean, you copied the list of changed files into the commit message. I generally just use `git log --stat` when I want to see that. <NieDzejkob>hot take: gnu-style changelogs are a relic from the era of VCSes not existing and the only reason they're still being used is that nobody realized that they don't make sense anymore <oriansj>NieDzejkob: there is a big difference between not making sense anymore and not being in a form that optimally matches the tools that are available *now* <oriansj>learning how to shoe a horse is a skill that in a public school would fall into the not making sense anymore category. Whereas teaching of visual basic would be in a form that doesn't optimally match the tools that are available now. <oriansj>I'd argue gnu-style changelogs are more of not being optimal than being senseless these days; as there is great value in good commit messages and commit patterns in a style that makes it easier for others to disect and understand. A skill I hope to one day properly learn (if abit slowly at this point) <NieDzejkob>Listing the functions and files the commit touched doesn't "make it easier for others to understand" <oriansj>NieDzejkob: but "What was the rationale for a given change, and what were its main ideas?" certainly does <NieDzejkob>yes, but that's the opposite of the GNU changelog format. <oriansj>another good bit: Is there any additional information regarding the change, and if so, where can it be found? <oriansj>and suggests: one commit for each logical changeset <NieDzejkob>hmm. Apparently what the document actually says and what the Guix folks are doing while citing the document are two entirely different things. <oriansj>yes it is called using a previously learned skill without updating it to match the new improved standards. <civodul>NieDzejkob: it's not quite that they don't make sense anymore; they give a view of the intended language-level changes, as oppose to line-by-line changes <oriansj>as scheme isn't so much a programming language but as glue for a community to create its own langague to express the solving of a problem. <stikonas>fsopen seems to be something to do with file systems <oriansj>well that is what an open command does. it opens a file in a file system. <stikonas>and fsopen seems to open a file system, not a file in filesystem <stikonas>and I just spend lots of time resetting up my openwrt router after upgrade refused to carry over old configuration <stikonas>so didn't really have time to look at M0 crashe yet... <stikonas>otherwise we will be hitting too long string bug