IRC channel logs

2026-09-20.log

back to list of logs

<ekaitz>damn
<ekaitz>i'm converting all our changes in mes to M2
<ekaitz>my lord...
<ekaitz>now it segfaults who knows why
<ekaitz>stikonas: how would you do something as easy as STACK [g_stack++] = X;
<ekaitz>?
<stikonas>perhaps 2 lines?
<stikonas>gstack++; STACK[g_stack] = X;
<stikonas>?
<stikonas>++/-- are still working a bit poorly
<ekaitz>Got unsupported size 16 when storing number in register.
<stikonas>on gstack++?
<stikonas>hmm
<ekaitz>i'm finding that array access for setting things doesn't work well
<stikonas>strange...
<ekaitz>yeah
<matrix_bridge><Andrius Štikonas> gtker: any ideas
<ekaitz>i'm in 1.13.2
<stikonas>1.13.2?
<stikonas>you mean latest git?
<stikonas>1.13.1 seems to be the latest tag
<ekaitz>oh
<stikonas>there are some improvements in the PR here https://github.com/oriansj/M2-Planet/pull/169
<ekaitz>.1
<ekaitz>i misstyped
<stikonas>but I think siraben needs to finalize PR
<ekaitz>array access not being clean is a pain in the balls
<ekaitz>i'm doing things like: struct scm **t = STACK + g_stack; *t = x;
<ekaitz>but then STACK [N] is 0
<ekaitz>it's too late to make this kind of conversion in the first go
<stikonas>array access "should" work
<stikonas>it's really a basic thing
<ekaitz>setting doesn't
<ekaitz>at least for me
<stikonas>what is g_stack ?
<stikonas>some pointer?
<stikonas>can't be poitner
<stikonas>sorry, some integer?
<ekaitz>integer
<ekaitz>stack is a struct scm **
<ekaitz>well, no
<ekaitz>struct scm *STACK [STACK_SIZE];
<ekaitz>and g_stack is a integer
<ekaitz>a size_t
<stikonas>hmm, why does it think that it's 16 bytes...
<stikonas>probably today is too late for me to reason effectively :(
<stikonas>I guess need to write some smaller reproducer first
<ekaitz>let me try to do that
<ekaitz>i cannot reproduce it that easily
<ekaitz>stikonas: got a reproducer
<ekaitz>stikonas: https://paste.debian.net/hidden/2c91b656
<ekaitz>it complains about the line 13, the STACK [g_stack] = x
<ekaitz>if M2-Planet fixes this I'll be very happy
<stikonas>thanks
<stikonas>oh, that's a struct assignment
<stikonas>yeah, I think that's not supported yet
<ekaitz>where's the struct assignment?
<stikonas>x
<stikonas>it's not [] that is failing
<stikonas>but essentially a = b
<stikonas>where size of each is 16 bytes
<ekaitz>but STACK[g_stack] is a struct scm *
<ekaitz>not a struct
<ekaitz>and x is not a struct either
<stikonas>oh sorry
<stikonas>indeed
<stikonas>that's pointer, you pass &x
<stikonas>not x
<ekaitz>yep
<ekaitz>and this usecase appears *everywhere* in mes
<stikonas>well, need to investigate
<stikonas>perhaps it somehow misdetects size to be object size rather than pointer
<stikonas>with [] especially...
<ekaitz>yeah
<ekaitz>idk how but the trick we used earlier doesn't work very well either
<ekaitz>i'll just go to bed now and forget about it for the moment
<ekaitz>i'll try again tomorrow
<ekaitz>stikonas: thank you
<stikonas>yeah, I doubt I'll fix it today
<stikonas>late here too
<stikonas>perhaps I'll look tomorrow
<ekaitz>(also in the index it doesn't work properly)
<stikonas>hmm, switching to void pointers works but that's of course a hack
<stikonas>and then we would need to do return ((struct scm *)STACK[0])->car;
<stikonas>ok, so we are calling store = store_value(current_target->type->size); form expression function
<stikonas>ekaitz: yesterday I found a workaround but it's slightly ugly
<stikonas>using void* pointers work
<ekaitz>oh
<ekaitz>very
<ekaitz>stikonas: thank you for looking into it
<ekaitz>what I did is to continue using the same constructs Mes used for older versions of M2-Planet
<ekaitz>STACK + g_stack * M2_PTR_SIZE
<ekaitz>and stuff like that
<ekaitz>I made it compiler and run right now
<ekaitz>the ugly part is i'm using functions to make it readable, and that kills a big chunk of performance :(
<stikonas>void pointers might be less ugly than STACK + gstack * M2_PTR_SIZE
<stikonas>I think in your example I only had to change stack_push (struct scm *x) to stack_push (void *x)
<ekaitz>yeah... but we already have that everywhere
<stikonas>anyway, it should be properly fixed
<ekaitz>yes
<stikonas>might also be because it's lvalue...
<stikonas>not rvalue
<stikonas>I'll open github issue
<stikonas>so that we don't forget
<stikonas>in case I'm not able to solve it now
<stikonas>it might also be related to https://github.com/oriansj/M2-Planet/issues/165
<stikonas> https://github.com/oriansj/M2-Planet/issues/175
<ekaitz>thank you!
<ekaitz>stikonas: i found the problem also happens when you do things like STACK[1] or STACK[2]
<ekaitz>it compiles
<ekaitz>but returns some weird value I don't know where it's coming from
<stikonas>yeah, probably size is wrong
<stikonas>(type size)
<stikonas>in the big reproducer it is checking size of scm rather than pointer
<stikonas>so it somehow undid one too many indirections
<aleksi>I've also had the issue that a[c] only indexes c bytes into the array rather than c*sizeof(a[0]) bytes.
<aleksi>Even on a simple uint32_t array
<stikonas>aleksi do you remember if that was for lvalue?
<aleksi>I should check that, and also check that I was on the newest version of M2-Planet
<stikonas>according to git log struct arrays are fairly new addition too
<stikonas>from 2025
<matrix_bridge><wildwestrom> I used a few python scripts and clankers to churn through the IRC logs and come up with a history of the bootstrappable builds project. https://bpa.st/X6IQ
<wildwestrom>My bad. I exited the Matrix bridge by mistake. Falling back to Gamja.