IRC channel logs

2025-03-17.log

back to list of logs

<ekaitz>uuuh mes-m2's assert_msg fail with segfaults
<ekaitz>enough debugging for today
<ekaitz>so yeah janneke i think we have segfaults in the assert function
<ekaitz>in mes-gcc works, but in mes-m2 segfaults
<ekaitz>at least after the update
<janneke>ekaitz: oh crap
<ekaitz>the good part is it segfaults when the assert fails
<ekaitz>so the effect is similar to the assert failing
<ekaitz>so it "works"
<ekaitz>janneke: your master branch includes the "don't run main twice" issue?
<ekaitz>oh forget it, yes it does include it
<janneke>:)
<ekaitz>janneke: it also segfaults in master
<janneke>great!
<ekaitz>also there's a really interesting way to reproduce
<ekaitz>that doesn't make any sense
<janneke>is this with a newer m2-planet or so?
<janneke>i'm pretty user master was tested in the bootstrap
<janneke>*sure
<ekaitz>this is with mes' master branch as it is
<ekaitz>the thing is, the failure only happens when assert_msg(0, "whatever"); happens
<ekaitz>and that shouldn't happen
<ekaitz>so we don't see that
<ekaitz>the thing is, this assert_msg segfaults, instead of actually asserting and printing the message
<ekaitz>but as the assert shouldn't happen in normal execution, we don't see that
<janneke>eh, i believe assert is /implemented/ as segfault
<janneke>when it fails
<ekaitz>OH
<ekaitz>really?
<janneke>yeah, why not?
<ekaitz>oh it makes actual sense then
<ekaitz>lol
<ekaitz>ooooh now i see
<ekaitz>fuck me
<ekaitz>I'm working in this branch btw: https://github.com/ekaitz-zarraga/mes/tree/faster
<ekaitz>hah thanks that you mentioned it because I was starting to go into the rabbit hole
<ekaitz>in any case, when we build crt1.c there's a character in the strings that is escaped but is not considered in the escape character parsing, that's also very interesting
<ekaitz>i realized that because I put an assert in the default case and it crashed
<janneke>hehe
<ekaitz>oh it's a \ for newline cancelation
<ekaitz>and we are not doing that properly I think
<ekaitz>janneke: i just fixed that
<janneke>ekaitz: \o/
<ekaitz>i found it because i converted many ifs to a switch
<ekaitz> https://paste.debian.net/1363669/ <-- janneke this is what happened before
<ekaitz>guile returns "" in that case
<ekaitz>so i just copied what guile does
<janneke>nice
<ekaitz>it's not much, but it's something
<ekaitz>and i'm getting used to mes codebase and your weird curly bracket indentation :)
<janneke>ekaitz: https://en.wikipedia.org/wiki/GNU_coding_standards
<janneke>it's the emacs default too, of course
<ekaitz>i know... i don't like the curly bracket position though :)
<ekaitz>but i'll get used to it
<ekaitz>and probably like it in the future
<janneke>haha, yep that was my path :)
<stikonas>ekaitz: any speeds up you noticed from if/else -> switch conversion or negligible?
<ekaitz>stikonas: that's a very good question, but I'm going to answer it with a second question: do you have any suggestion for a benchmark I should try?
<stikonas>well, I guess mescc itself?
<stikonas>i.e. how long it takes to rebuild mes?
<ekaitz>stikonas: but that takes a lot of time to build... yeah
<ekaitz>many minutes
<stikonas>at some point I think I tried running calgrind on mes
<ekaitz>baby needs me, be right back
<fossy>btw stikonas, i have reproduced the "rm: remove write-protected regular file" thing on bubblewrap...
<fossy>it is very strange...
<matrix_bridge><Andrius Štikonas> fossy: oh, there are more cases?
<stikonas_>not just the ones I fixed?
<fossy>yes, it appears to be random
<fossy>ish
<stikonas_>I guess just need to force all rm's
<fossy>i'd much prefer to fix the underlying problem
<stikonas_>if we can understand that...
<fossy>something appears to be causing many files to be extracted ro in bubblewrap mode
<fossy>not sure what yet
<stikonas_>but files are also random?
<stikonas_>it's not like the whole unpacked archive has wrong umask...
<stikonas_>hmm
<fossy>i'm uncertain about that, but it's strange that i'm getting different ones to you
<stikonas_>which packages did you see it on?
<fossy>perl-5.6.2, coreutils-5.0 thus far
<stikonas_>I wonder if untar has some bug...
<fossy>we have proper tar by that time
<stikonas_>old gnu tar is used then
<stikonas_>yes...
<stikonas_>I wonder if we can update it a bit...
<stikonas_>but that's orthogonal to this bug I guess
<stikonas_>at some point we need to also update to the new release of stage0-posix
<stikonas_>but until janneke releases new mes, we would have to manually copy x86 defines from m2libc to mes source...
<fossy>maybe would fix it, who knows
<fossy>will investigate later
<ekaitz>stikonas: so i want to make some benchmarking but only leave the full mescc check for the more detailed check
<ekaitz>i could just go fibonacci
<ekaitz>or anything like that
<ekaitz>and see what happens
<ekaitz>that's not very real though because it's not going to trigger the gc in the same way
<ekaitz>i could use the scheme benchmarks
<stikonas>most of the time is probably spent in eval.c file
<stikonas>if I recall correctly in eval_apply() function
<ekaitz>of course
<ekaitz>but that's not very meaningful right now
<ekaitz>stikonas: my goal is to rewrite the evaluator
<ekaitz>and make a bytecode interpreter
<stikonas>yeah, I was just thinking maybe switch port already helped there a bit, since that file is very heavy on if/else if
<stikonas>but yes, bytecode interpreter should help more
<stikonas>I'm not an expert on those though