ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Check also http://www.picolisp.com for more information
orivej has joined #picolisp
orivej_ has quit [Ping timeout: 258 seconds]
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej_ has joined #picolisp
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
orivej has quit [Read error: Connection reset by peer]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 210 seconds.]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
orivej_ has joined #picolisp
orivej_ has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
<Regenaxer> tankf33der: Now I have 5 little tests here which crash on your systems, but none of them ever crahed here
<Regenaxer> What might be the difference?
<Regenaxer> I tested all with debug-gc
<Regenaxer> with and without '+' mode
<Regenaxer> $ ./pil <script>.l [+]
<tankf33der> i cant belive it
<Regenaxer> T
<Regenaxer> It is 9.0.1 on Debian Buster
<Regenaxer> I also tried $ bin/picolisp ... but some need 'msg' or 'hex'
<tankf33der> maybe my systems have some stack protection enabled
<Regenaxer> There must be something different
<Regenaxer> No, we see a null pointer
<Regenaxer> movq (%rax), %rcx
<Regenaxer> %rax is 0
<tankf33der> btw, i dont have llvm9
<Regenaxer> I would not think it depends on the llvmdversion
<Regenaxer> But on llvm 10 it crashes for you?
<tankf33der> and 7
<tankf33der> always 4 different distros
<tankf33der> centos, void, arch
<tankf33der> alpine
<Regenaxer> funny
<tankf33der> i need llvm9 and on non debian system
orivej has quit [Ping timeout: 240 seconds]
<tankf33der> i alreadu have modern ubuntu lts, i will try in hour
<tankf33der> afk
<Regenaxer> cu
<tankf33der> btw, your Makefile is original? without modifications and optimizations?
<Regenaxer> yes
<Regenaxer> as in the TGZ
rob_w has joined #picolisp
<tankf33der> llvm-as: assembly parsed, but does not verify as correct!
<tankf33der> mpech@ubuntu:~/pil21/src$ make
<tankf33der> Intrinsic has incorrect argument type!
<tankf33der> void (i8*, i8*, i64, i1)* @llvm.memcpy.p0i8.p0i8.i64
<tankf33der> Intrinsic has incorrect argument type!
<tankf33der> void (i8*, i8*, i64, i1)* @llvm.memcpy.p0i8.p0i8.i64
<tankf33der> Intrinsic has incorrect argument type!
<tankf33der> ..
<tankf33der> ..
<tankf33der> llvm6
<tankf33der> i need newer ubuntu then.
f8l has joined #picolisp
Guest92206 has quit [Ping timeout: 246 seconds]
<Regenaxer> hmm
<Regenaxer> memcpy
<Regenaxer> it is now (i8*, i8*, i32, i1)
<Regenaxer> i32 according to the llvm lang ref
<Regenaxer> hmm, but then pil21/srv/llvm.l is indeed not correct
<Regenaxer> llvm6 is just more strict?
<tankf33der> unknown.
<tankf33der> latest ubuntu installed.
<Regenaxer> I check
<tankf33der> lets see.
<Regenaxer> Sorry, I looked up wrong in the ref
<Regenaxer> llvm.l is correct
<Regenaxer> I use the i64 version
<Regenaxer> I think in llvm6 the 64bit version of memcpy did not exist yet or something like that
<tankf33der> damn ubuntu is llvm10, lets try anyway
<Regenaxer> :)
<Regenaxer> Problem is that I want to reproduce it here, so that I can debug
<tankf33der> ubuntu 20, llvm10, cant bootstrap with modified gc.
<tankf33der> met first time, all distros could bootstrap itself with modified gc.
<tankf33der> so frustrating.
<tankf33der> mpech@ubuntu20:~/pil21/src$ pil21 +
<tankf33der> Segmentation fault (core dumped)
<tankf33der> : (range 1 100000)
<Regenaxer> Strange that Debian Buster does not have 10 yet
<tankf33der> just stable branch, debian 11 has.
<Regenaxer> Buster is unstable
<Regenaxer> $ apt list -a llvm
<Regenaxer> Listing... Done
<Regenaxer> llvm/unstable,now 1:9.0-49.1 amd64 [installed]
<Regenaxer> llvm/stable 1:7.0-47 amd64
<Regenaxer> "1:9.0-49.1" looks like llvm9, right?
<tankf33der> buster is latest stable
<Regenaxer> $ llvm-config --version
<Regenaxer> 9.0.1
<Regenaxer> oops
<Regenaxer> yes, this is production server
<Regenaxer> Let me check my local one
<Regenaxer> no, this *is* the local
<Regenaxer> see the line above
<Regenaxer> llvm/unstable,now 1:9.0-49.1 amd64 [installed]
<Regenaxer> "unstable", right?
<tankf33der> maybe your buster uses wrong channels
<tankf33der> let me install buster from scratch then :)
<Regenaxer> No, it is ok
<Regenaxer> I installed Buster, then added Sid
<Regenaxer> dist upgraded
<Regenaxer> So I have most packages from Sid
<Regenaxer> That means, also Sid does only have llvm9
<tankf33der> why you use unstable channels then ?
<Regenaxer> I need latest versions e.g. picolisp
<Regenaxer> Why not use unstable?
<Regenaxer> The question is "why do you use stable?"
<Regenaxer> The answer is that the rented root server has Buster pre-installed
<Regenaxer> Same for servers at customer's sites
<Regenaxer> So I dist upgrade to Sid usually
<tankf33der> ok
<Regenaxer> hmm, but I still think the llvm version should not matter
<Regenaxer> (except it is very old perhaps)
<Regenaxer> It must be my error
<Regenaxer> and depends on memory layout or alignment or something like that
<Regenaxer> Something which canges at random at runtime
<Regenaxer> If it were the llvm version, it would crash more reproducible
<Regenaxer> Just speculating
<Regenaxer> no real idea ...
<Regenaxer> I'm visually checking all 'gc' code again
<tankf33der> maybe it needs this one
<Regenaxer> I omitted it deliberately
<Regenaxer> Not portable then
<Regenaxer> I want to put all system-specific stuff into src/lib.c
<Regenaxer> If you ask LLVM people, they say it is impossible to distribute a portable *.bc file
<Regenaxer> But that's what I do
<Regenaxer> I want to bootstrap on any 64 bit system
<beneroth> good so
<Regenaxer> thats the premisse
<Regenaxer> yeah, and until now it seemed to work
<beneroth> I guess if you ask them about incompatibilities between LLVM versions they also say its impossible? yet it seems so? :(
<Regenaxer> I think if it would not, we would notice
<Regenaxer> Who knows ;)
<beneroth> probably not them...
<Regenaxer> They think only of C-like languages
<beneroth> yeah
<Regenaxer> all static, hard-compiled
<beneroth> C is the most compatible language, a bit pointless to reinvent a cross-compiler architecture...
<beneroth> just for C
<Regenaxer> hi beneroth
<Regenaxer> indeed
<Regenaxer> And as a result, all new langs look like C ;)
<beneroth> that is a feature, you know parenthesis are in shortage
<Regenaxer> :)
<beneroth> just curly brackets
<beneroth> so stupid
<Regenaxer> T
<tankf33der> Regenaxer: look how install different llvms on debian
<Regenaxer> I think the defaults for datalayout are all we need
<tankf33der> 9 or 10
<Regenaxer> hmm, ok, but I'm not convinced yet that the version matters at all
<tankf33der> http://ix.io/2qd1
<tankf33der> default layout on x64
<Regenaxer> what matters for pil21 is the alignment of alloca
<Regenaxer> and there I specify it directly
<Regenaxer> %3 = alloca i64, i64 2, align 16
<Regenaxer> in cases where it matters
<tankf33der> debian buster has llvm7
<Regenaxer> yes
<Regenaxer> apt list above
<Regenaxer> ok, I'll downgrade
<Regenaxer> now
<tankf33der> cant bootstrap with modified gc
<Regenaxer> I do this:
<Regenaxer> $ (cd src; pil lib/llvm.l main.l -bye > base.ll && llvm-as -o base.bc base.ll)
<Regenaxer> ie use global pil
<Regenaxer> then (cd src; make)
<tankf33der> i just modify Makefile
<tankf33der> ok
<tankf33der> root@debian10:~/pil21# ./pil
<tankf33der> Segmentation fault
<tankf33der> : (range 1 100000)
<tankf33der> with modified gc
<Regenaxer> How to pass version to "apt install" ?
<tankf33der> unknown. try google.
<tankf33der> show /etc/apt/sources.list
<Regenaxer> Just Buster and Sid
<Regenaxer> No, I just need the option to apt
<Regenaxer> or I use apt-get with -t
<Regenaxer> apt install -t buster clang llvm
<Regenaxer> works, but gives a lot of trouble
<Regenaxer> wants to change a lot of other packages
<Regenaxer> give up
<Regenaxer> Why should just 9 work? When 7 or 10 don't? I don't believe
<tankf33der> ok
<tankf33der> so
<tankf33der> (gc 4) (range 1 100000) - ok
<tankf33der> (range 1 100000) - crash
<tankf33der> with modified gc.
<Regenaxer> ok
<Regenaxer> Here no crash
<tankf33der> did you apply patch ?
<Regenaxer> modified gc?
<tankf33der> apply and try again.
<Regenaxer> No need, it is the *source* of the patch :)
<Regenaxer> You start as
<Regenaxer> $ ./pil +
<Regenaxer> ?
<Regenaxer> $ ./pil +
<Regenaxer> : (range 1 100000)
<tankf33der> no crash if patch no applied here
<Regenaxer> ok
<tankf33der> [root@void pil21]# ./pil +
<tankf33der> : (range 1 100000)
<tankf33der> Segmentation fault
<tankf33der> i have copy pil21 as pil
<tankf33der> to have both versions in the path
<Regenaxer> ok
<tankf33der> [root@void pil21]# which pil
<tankf33der> [root@void pil21]# which pil21
<tankf33der> /root/picolisp/pil
<tankf33der> /root/pil21/pil21
<Regenaxer> oh! You run as root?
<tankf33der> yea
<Regenaxer> Can that be a reason?
<tankf33der> and under bash
<Regenaxer> me too
<tankf33der> trying non-rot
<tankf33der> trying non-root
<Regenaxer> shell does not matter probably
<Regenaxer> ok
<Regenaxer> I try as root
<tankf33der> and ulimit -s 16000
<Regenaxer> I have 65536
<Regenaxer> no crash with root
<Regenaxer> and also not with ulimit -s 16000
<tankf33der> crashed as non-root
<Regenaxer> ok
<Regenaxer> mysterious!
<beneroth> the more layers, the more magic, the more confusion :(
<Regenaxer> yeah
<Regenaxer> I tried on three systems, but two are both Debian Sid x84, the other is Termux on arm64
<Regenaxer> Never succeeded to crash
<tankf33der> http://ix.io/2qd9
<Regenaxer> And tankf33der crashes it easily
<tankf33der> under valgrind.
<Regenaxer> I study
<Regenaxer> the first two are in readline()
<tankf33der> using -fno-stack-protector in clang did not helped.
<Regenaxer> "Invalid read of size 8" in cons() ???
<Regenaxer> cons does not read
<Regenaxer> tankf33der, can you fetch 7fach.de/pub/base.ll and diff it with your src/base.ll ?
<tankf33der> under sanitizer
<tankf33der> http://ix.io/2qda
<Regenaxer> To see if we are testing the same
<Regenaxer> "address points to the zero page." yes, the null pointer
<tankf33der> [mpech@void ~]$ diff -u pil21/src/base.ll ./base.ll
<tankf33der> +++ ./base.ll 2020-06-26 11:28:27.000000000 +0300
<tankf33der> --- pil21/src/base.ll 2020-06-26 14:51:46.104038346 +0300
<tankf33der> @@ -82452,6 +82452,8 @@
<tankf33der> %132 = call i64 @getUsec()
<Regenaxer> in cons()
<tankf33der> store i64 %132, i64* @$USec
<tankf33der> ; # (set $USec (getUsec))
<tankf33der> + store i1 1, i1* @$Jam
<tankf33der> +; # (set $Jam YES)
<tankf33der> ; # (unless (setjmp QuitRst) (loadAll 0) (set $Repl YES) (iSignal (va...
<tankf33der> ; # (setjmp QuitRst)
<tankf33der> %133 = call i32 @setjmp(i8* @QuitRst)
<tankf33der> i think this is gc patch applied
<tankf33der> let try clean
<Regenaxer> Did you not set (set $Jam YES) in main.l?
<tankf33der> no, why /
<tankf33der> ?
<Regenaxer> if not, it surely crashes
<Regenaxer> cause gc is *never* called
<tankf33der> you did not tell me
<Regenaxer> I did
<Regenaxer> that explains all ;)
<tankf33der> http://ix.io/2qdd
<tankf33der> this is clean diff
<Regenaxer> ok, but $Jam needs to be switched on
<tankf33der> where insert (set $Jam YES) ?
<Regenaxer> 2020-06-25 06:06 <Regenaxer> > (set $Jam YES)
<beneroth> $Jam means ?
<beneroth> I mean.. its not jamming when its YES :D
<Regenaxer> I wrote:
<Regenaxer> main.l
<Regenaxer> 1312a1313
<Regenaxer> > (set $Jam YES)
<Regenaxer> beneroth, $Jam is a global for another purpose
<Regenaxer> abused here
<Regenaxer> it is in err() to avoid error-in-error
<beneroth> good old windows "there was an error displaying an error"
<Regenaxer> :)
<Regenaxer> tankf33der, so sorry, this was a total miscommunication
<tankf33der> and now i see real slow execution
<Regenaxer> I thought it was clear that (set $Jam YES) needs to be inserted
<tankf33der> i thought before why this is at the same speed
<Regenaxer> :)
<tankf33der> i thought its already enabled.
<Regenaxer> Now it all makes sense
<tankf33der> yea
<Regenaxer> yeah
<tankf33der> no crash
<Regenaxer> if the heap is full, it crashes
<Regenaxer> cause (g
<Regenaxer> c) is never called
<tankf33der> so i executed two scripts and left for lunch.
<Regenaxer> Too bad, now we are back at start
<tankf33der> afk.
<Regenaxer> cu :)
mario-go` has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
mario-goulart has joined #picolisp
<Regenaxer> By chance, I found a case where it crashes reproducibly for me with gc-debug
<Regenaxer> It is tab-expansion
<Regenaxer> enter a letter and press TAB
<Regenaxer> Crashes in mkStr()
<Regenaxer> in consStr()
rob_w has quit [Quit: Leaving]
<tankf33der> ret, still running.
orivej has joined #picolisp
<Regenaxer> Found and fixed the tab expansion
<Regenaxer> It was an uninitialized field on the stack
<Regenaxer> thus forced gc crashes
<Regenaxer> Perhaps there are more such cases
<Regenaxer> tab expansion is not related to tankf33der's tests I think
<Regenaxer> But I'm sure tankf33der can reproduce with forced gc version
<Regenaxer> just enter "e" (or any letter) an TAB
<tankf33der> # pil21 test-sha512.l
<tankf33der> Illegal instruction
<tankf33der> under gc+
<Regenaxer> ok
<tankf33der> modified gc lets call gc+
<Regenaxer> It can be a similar case
<Regenaxer> uninitialized stack field
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
<tankf33der> http://ix.io/2qdF
<tankf33der> backtrace for Illegal instruction
<Regenaxer> thx
<Regenaxer> I check all functions in the list for a case similar to the above case in tabExpansion
<Regenaxer> Did you try to reproduce it
<Regenaxer> It should crash 100%
<Regenaxer> well, no, depends on the random stack field contents
<Regenaxer> No similar case in the functions in the backtrace
<tankf33der> tabepansion can reproduce, 100%
<Regenaxer> great!
<Regenaxer> It is fixed in the release a few minutes ago
<tankf33der> ok
<Regenaxer> This was an easy case :)
<Regenaxer> easy to reproduce
<Regenaxer> and only a single function being called
<Regenaxer> Does test-sha512.l crash very quickly, or does it run for a while?
<tankf33der> fast.
<Regenaxer> good
<tankf33der> http://ix.io/2qdI
<tankf33der> reduced.
<tankf33der> http://ix.io/2qdJ
<tankf33der> gdb.
<Regenaxer> I try
<tankf33der> under gc+
orivej has quit [Ping timeout: 260 seconds]
<Regenaxer> sure
orivej has joined #picolisp
<Regenaxer> crash!
<Regenaxer> hex2.l
<Regenaxer> Now it should be easy
<Regenaxer> Please wait
<Regenaxer> No worry with further tests atm
<tankf33der> uh
<Regenaxer> I try to trace it down
<aw-> hi all
<Regenaxer> Hi aw-
<Regenaxer> It is indeed 'for'
<Regenaxer> hmm, no, wrong test
<aw-> i have a question: how to extract a "range" of elements from a list, ex: (1 2 3 4 5), I want the range 2-4 (result: (2 3 4))
<Regenaxer> I must stop now, tel conf
<Regenaxer> by position?
<aw-> by position, yes
<Regenaxer> (head 3 (tail ...
<aw-> yeah.. i try that but it doesn't work as expected
<aw-> ok do your tel conf, i will do more tests
<aw-> thanks
<Regenaxer> ok, sorry :)
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
orivej_ has joined #picolisp
orivej_ has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #picolisp
<tankf33der> # pil21 +
<tankf33der> -> (3 .)
<tankf33der> -> (2 .)
<tankf33der> : (head -3 (range 1 5))
<tankf33der> : (head 3 (range 1 5))
<tankf33der> :
<tankf33der> under normal gc all ok
<Regenaxer> Still in conf
<Regenaxer> BUT!!!!!!
<Regenaxer> I found it!!!
<Regenaxer> It is not OK at all
<Regenaxer> Explain later
<Regenaxer> If gc runs at the wrong moment, anything can happen
<Regenaxer> Problem is in src/lib/llvm.l
<Regenaxer> It is the 'set' function
<beneroth> congrats!
patrixl has quit [Quit: Leaving.]
orivej has quit [Ping timeout: 265 seconds]
orivej has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
patrixl has joined #picolisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #picolisp
<Regenaxer> Phew, telcon finished
<Regenaxer> Stupid tax changes!
<Regenaxer> The reason of the crash in pil21:
<Regenaxer> The 'set' function stores data in memory or stack
<Regenaxer> We have code (eg in 'for') like
<Regenaxer> (set
<Regenaxer> P (val (setq Y @))
<Regenaxer> 2 P Y
<Regenaxer> Y (eval (++ Z)) )
<Regenaxer> The P and 2 P ust be stored, and *then* eval called
<Regenaxer> P sets up the stack structure
<Regenaxer> eval is the (chop ...) in our case
<Regenaxer> So when chop runs, the stack must be set up
<Regenaxer> BUT
<Regenaxer> 'set' is a normal EXPR
<Regenaxer> it first evaluates *all* args, then does the storing
<Regenaxer> So 'eval' (the chop) is done when P is stored!
<Regenaxer> Bang!
<Regenaxer> I must change 'set' to an FEXPR
<Regenaxer> Such cases are probably not only in 'for' but in many other cases. I just assumed that each set happens one after the other, as the normal Lisp 'set' function
<tankf33der> i see.
<tankf33der> dont forget fix head too
ym has quit [Ping timeout: 264 seconds]
<Regenaxer> Lisp level functions are my least problem atm
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
ym has joined #picolisp
<tankf33der> T. Who cares about functions after all this :)
orivej has quit [Ping timeout: 258 seconds]
orivej has joined #picolisp
<Regenaxer> yep
<Regenaxer> Have no solution for the 'set' issue. In any case, some places may break
orivej_ has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
f8l has quit [Remote host closed the connection]
f8l has joined #picolisp
<Regenaxer> OK, now I had time to look at 'set'
<Regenaxer> I release now
<Regenaxer> Ideal food for tankf33der's test suite
<tankf33der> i will play asap
<Regenaxer> No hurry :)
<tankf33der> can you fix head? test suite crashing
<tankf33der> i meant failed tests
<Regenaxer> No time yet
<Regenaxer> ok, will look now
<beneroth> :)
<Regenaxer> Not in issues?
<Regenaxer> What was the problem with head?
<Regenaxer> found (head 3 (range 1 5))
<tankf33der> yea
<Regenaxer> Works now:
<Regenaxer> : (head 3 (range 1 5))
<Regenaxer> -> (1 2 3)
<Regenaxer> See? Just wait and all bugs disappear from alone ;)
<Regenaxer> So better not test too early :D
<tankf33der> with gc+?
<Regenaxer> ok, not yet
<Regenaxer> right, still there
<Regenaxer> interesting
<Regenaxer> ok, found
<Regenaxer> Result is not saved
<Regenaxer> Works now
<Regenaxer> Released
<tankf33der> ok
<Regenaxer> Thanks tankf33der!
<Regenaxer> Nuff for today. Need a beer
<beneroth> Prost! Regenaxer
<beneroth> thank you very much, tankf33der !
<Regenaxer> :)
casaca has quit [Remote host closed the connection]
<tankf33der> everything passed with and without gc+
<Regenaxer> Cool :)
orivej_ has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
casaca has joined #picolisp
<tankf33der> i will eat best pizza in riga in the car.
<beneroth> not in the cdr?
<beneroth> enjoy a good Pizza tankf33der !
orivej has quit [Ping timeout: 240 seconds]
orivej_ has joined #picolisp
orivej_ has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 265 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
twelvemonkeys has quit [Ping timeout: 260 seconds]
twelvemonkeys has joined #picolisp
<tankf33der> $ pil21 +
<tankf33der> : 123
<tankf33der> : @
<tankf33der> -> 123
<tankf33der> :
<tankf33der> -> T
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #picolisp
<beneroth> tankf33der, oopsie :))
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp