beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
bjorkintosh has quit [Quit: "Every day, computers are making people easier to use." David Temkin]
bjorkintosh has joined #picolisp
bjorkintosh has joined #picolisp
<abu[7]> ?
<tankf33der> Morning
<tankf33der> please extend yesterdays freebsd fix to openbsd too. One issue of two will be fixed.
<abu[7]> Good morning tankf33der!
<abu[7]> ok
<abu[7]> What exactly is the *OS string?
<tankf33der> OpenBSD
<tankf33der> Second issue is task.
<tankf33der> If i run task's example of receive-send rpc message it send but second instance dont receive.
<tankf33der> Trying compile pil32 on latest openbsd
<tankf33der> Asap.
<abu[7]> task in the tests?
<tankf33der> Yeap
<tankf33der> Or task example from documentation
<abu[7]> udp
<tankf33der> Yeap
<tankf33der> port is lestining
<tankf33der> I see 4444 udp6
<abu[7]> I released OpenBSD fix
<abu[7]> So udp does not receive on OpenBSD
<abu[7]> ?
<tankf33der> I think so
<tankf33der> so issue or firewall :)
<abu[7]> it is just localhost
<tankf33der> Freebsd works
<tankf33der> yes
<abu[7]> this is new then
<abu[7]> what says pil32 ?
<tankf33der> didnt compile yet
<tankf33der> after 2h
<tankf33der> 2-3
<abu[7]> ok
rob_w has joined #picolisp
<taleon> tankf33der: Are you using OpenBSD in a virtual machine?
<taleon> cr@hal:~$ uname -a
<taleon> OpenBSD hal.local 7.5 GENERIC.MP#119 amd64
<taleon> cr@hal:~$ pil +
<taleon> Illegal instruction (core dumped)
<taleon> I still have the problem that pil + does not work. Both under OpenBSD stable and OpenBSD current. I have tested this on two different Thinkpads. Maybe there is a difference to the real hardware and virtual machine.
<taleon> pil (without +) works
<abu[7]> Hi taleon o/
<taleon> Hi :-)
<taleon> Under OpenBSD 7.4, pil + also works on real hardware.
<tankf33der> back
<tankf33der> so
<tankf33der> taleon: in general pil21 works on openbsd
<taleon> aye
<tankf33der> i am under vm of course
<taleon> My guess is that it is due to the new pinsyscall. golang also has massive problems with syscalls.
<tankf33der> truss ?
<taleon> Not sure what you mean by truss.
<tankf33der> ktrace /root/pil21/bin/picolisp
<taleon> works
<tankf33der> never used before
<tankf33der> failed compile pil32 on openbsd 7.5
<tankf33der> last command in chain failed
<tankf33der> google is empty
<tankf33der> reinstalling openbsd, clean install
<abu[7]> Looks like libs mismatch with the compiler
<tankf33der> run
<tankf33der> which pil
<taleon> /home/cr/mystuff/src/github.com/pil21/pil
<abu[7]> 6*
<abu[7]> 6/13
<tankf33der> is this correct ?
<taleon> This was the github version
<tankf33der> ```/home/cr/mystuff/src/github.com/pil21/bin/picolisp
<tankf33der> will be the same ?
<taleon> cr@hal:src$ /home/cr/mystuff/src/github.com/pil21/bin/picolisp
<taleon> 24.6.13
<taleon> : (version)
<tankf33der> see
<tankf33der> :)
<tankf33der> huge progress
<tankf33der> mine situation: the same errors after fresh reinstall
<tankf33der> if i compile hello worlds program all works
<tankf33der> compiled dte editor - works
<tankf33der> by clang btw
<tankf33der> gcc works too
<tankf33der> i know what happened with openbsd:
<tankf33der> i can not compile -m32 binary on it, no multilib anymore
<tankf33der> abu[7]: can i compile pil64 sources by pil21 ? :)
<abu[7]> Not sure, probably yes
<tankf33der> never mind compiled on freebsd :)
<tankf33der> works
<tankf33der> so
<abu[7]> 👍
<tankf33der> testing task on pil64 on openbsd
<abu[7]> ok
<tankf33der> dont send
<tankf33der> firewall disabled
<tankf33der> udp6 0 0 *.4444 *.*
<tankf33der> server listen
<tankf33der> old-new bug
<tankf33der> not ported, i meant
<abu[7]> You said not received (?)
<tankf33der> yeap
<abu[7]> T
<tankf33der> two lines from task example
<tankf33der> works on linux and freebsd
<tankf33der> let me try freebsd again
<abu[7]> Did it work before?
<tankf33der> unknown
<tankf33der> freebsd, pil21 works
<tankf33der> i receive data from udp
<abu[7]> ok
<tankf33der> do you have energy to digg in ?
<tankf33der> i can now
<abu[7]> Yes
<abu[7]> Can you trace?
<tankf33der> i will take all day, completely new ecosystem on openbsd
<tankf33der> ktrace-kdump binaries
<abu[7]> tough ;)
<taleon> Not sure how to continue debugging.
<taleon> "Assuming you have identified an application crash caused by ILL_BTCFI, you will need to locate the sections of code with indirect jumps and calls and implement the endbr64 command as a crucial mitigation measure. endbr64, which stands for “ENDBRanch 64-bit”, is a security-enhancing instruction within the x86-64 architecture, utilized by processors adhering to the AMD64 or Intel 64 instruction sets,
<taleon> which support 64-bit processing."
<abu[7]> Do you have gdb?
<taleon> GNU gdb 6.3
<taleon> also lldb
<abu[7]> We can inspest the core
<abu[7]> $ gdb bin/picolisp core
<abu[7]> then 'bt'
<abu[7]> (backtrace)
<abu[7]> I did not find lldb useful
<taleon> I am not sure if I have done this correctly :)
<abu[7]> Perfect!
<tankf33der> at the same time mine pil21 works on openbsd for years
<tankf33der> and i seen this issue before
<taleon> At the beginning of the year, this still worked for me under OpenBSD 7.4.
<abu[7]> There is no 'Pack' in the base system
<abu[7]> It must be ht:Pack
<abu[7]> So shared libs don't work
<taleon> I think it has something to do with the new pinsyscall.
<taleon> Does picolisp do `direct-syscalls-inside-the-binary`?
<abu[7]> Yes
<taleon> This is the only major change to OpenBSD between 7.4 and the current 7.5
<tankf33der> got ktrace running ok
<tankf33der> compiling pil21
<taleon> Yes it only crashes, with pil +
<tankf33der> taleon: did you used docs from this:
<tankf33der> ?
<tankf33der> openbsd chapter
<abu[7]> It must be ht:Pack
<abu[7]> ie loading the 'ht' shared lib
<tankf33der> yesyesyes, now i remember
<abu[7]> "Dwarf Error: wrong version in compilationunit header"
<abu[7]> ht:Pack is called in 'docs' in lib/debug.l
<tankf33der> recompiled pil21 on the same openbsd 7.5
<tankf33der> pil works
<abu[7]> Sounds good
<abu[7]> pil + ?
<tankf33der> ok
<tankf33der> works
<abu[7]> cool
<tankf33der> what i got:
<tankf33der> this task:
<tankf33der> (task (port T 4444) (eval (udp @)))
<tankf33der> DID NOT received any syscalls
<tankf33der> on this run from another putty:
<tankf33der> (udp "localhost" 4444 '(println *Pid))
<abu[7]> ok
<tankf33der> this is what i see
<tankf33der> and:
<tankf33der> this task: (udp "localhost" 4444 '(println *Pid))
<tankf33der> generates syscalls
<tankf33der> this is what i see
<tankf33der> what does it means ?
<tankf33der> what does it mean ?
<abu[7]> Does it call "recv" ?
<abu[7]> It is the only syscall from 'udp'
<abu[7]> (vi 'udp)
<abu[7]> ((ge0 (%@ "recv" ..
<abu[7]> (udp "localhost" 4444 is the sending part
<abu[7]> (Port ..
<abu[7]> it it a lot more complicated
<taleon> tankf33der: https://termbin.com/ymqk
<tankf33der> abu[7]: getpid() on line 45 and below
<tankf33der> abu[7]: so i sendto(3, ...)
<abu[7]> Why the Makefile?
<abu[7]> You said receiving does not work
<tankf33der> taleon: did you installed llvm
<taleon> tankf33der asked me above whether I followed his instructions. Hence the Makefile.
<abu[7]> Ah
<taleon> doas pkg_add git llvm gmake libffi readline
<tankf33der> abu[7] :)
<abu[7]> (udp @) is receiver
<tankf33der> maybe i can try run tcpdump on port 4444
<tankf33der> i bet i will not see the traffic
<abu[7]> udp dump ;)
<tankf33der> 12:31:15.822130 127.0.0.1.11371 > 127.0.0.1.4444: udp 15
<tankf33der> damn, i see
<tankf33der> but without guaranties server touch it
<abu[7]> sendto returns 15, so success
<tankf33der> why no syscalls on server's side ?! magic
<abu[7]> It must call recv()
<abu[7]> There is no further condition
<tankf33der> maybe wrong pid
<abu[7]> : *Pid
<tankf33der> correct then
<abu[7]> before testinm
<abu[7]> g*
<tankf33der> these are syscalls how server starts listen on port 4444
<taleon> 2023-12-13 syscall(2) removed from -current -> syscall(2) removed from -current
<tankf33der> abu[7]: and no syscalls on receive!
<taleon> Instead of syscall you should now call libc.
<abu[7]> bind() returns 0
<abu[7]> it is "success"
<tankf33der> simple udp client-server c implementation from internet works on the same machine
<tankf33der> will be back after 25mins
<abu[7]> ok
<tankf33der> back
<tankf33der> this one works on openbsd
<abu[7]> Because it is TCP, not UDP
<tankf33der> (port T 6666)
<tankf33der> (udp 3)
<tankf33der> and no syscalls on: (udp "localhost" 6666 '(a b c))
<abu[7]> Not sure what kbind is
<tankf33der> me too
<abu[7]> sendto is not called
<abu[7]> Hmm, even socket is not called
<abu[7]> So this must fail: (let? Lst (server SOCK_DGRAM X Port)
<abu[7]> makes no sense
<tankf33der> freebsd truss the same
msavoritias has joined #picolisp
<tankf33der> ok
<abu[7]> I see
<tankf33der> i am finished, no ideas
<abu[7]> Me neither :(
<tankf33der> installing 32bit openbsd for pil32
<tankf33der> testing
<abu[7]> Good
nat-418 has quit [Remote host closed the connection]
<tankf33der> compiled
<tankf33der> didnt received
<abu[7]> Same as pil12?
<tankf33der> pil32, 64, 21 - the same - didnt receive
<abu[7]> :(
<taleon> - Introduce pinsyscalls(2): The kernel and ld.so(1) register the precise entry location of every system call used by a program, as described in the new ELF section .openbsd.syscalls inside ld.so and libc.so. ld.so uses the new syscall pinsyscalls(2) to tell the kernel the precise entry location of system calls in libc.so.
<taleon> Attempting to use a different system call entry instruction to perform a non-corresponding system call operation will fail and the process will be terminated with signal SIGABRT.
<taleon> Removed support for syscall(2), the "indirection system call," a dangerous alternative entry point for all system calls.
<taleon> Together with pinsyscalls(2) this change makes it impossible to perform system call through any other way than the libc system call wrapper functions.
<taleon> From the 7.5 changelog
<tankf33der> c code works without problems
<tankf33der> c code from internet
<tankf33der> for udp
<abu[7]> And pil uses native calls
<taleon> The obsolete syscall(2) was finally removed from OpenBSD 7.5 at the request of Theo de Raadt, as a more precise and therefore more secure system call scheme using pinsyscalls(2) has been implemented over the last five years. To further protect against return-oriented programming (ROP) attacks, the OpenBSD compiler inserts an additional statement at all points where a branch is to land. If a ROP attack
<taleon> causes a branch to jump to another location, this triggers a CPU error and the executing program terminates with "illegal instruction" (SIGILL). The exact cause of the error can be traced in ktrace.
<taleon> Translated from heise.de
<taleon> terminates with "illegal instruction"
<taleon> Exactly what happens to me when I call up pil +
<tankf33der> did you installed 64bit openbsd? :)
<tankf33der> did you install 64bit openbsd? :)
<taleon> pinsyscalls came with OpenBSD 7.5 and exactly since this version pil + does not work anymore on real hardware. Tried on several different computers.
<taleon> Yes
<tankf33der> your issue does explain why all works on my side
<tankf33der> does not
<taleon> Tried with OpenBSD 7.5 stable and OpenBSD 7.5 current. All 64 bit and real hardware
<tankf33der> generic kernel ?
<tankf33der> default one right ?
<taleon> Maybe virtual machines work differently? I honestly have no idea.
<taleon> Yes default
rob_w has quit [Remote host closed the connection]
<tankf33der> taleon: eh
<taleon> Newly installed, original kernels.
<taleon> Tested on Thinkpad X1, Thinkpad X13 and Thinkpad X270.
<taleon> Unfortunately, I don't have any manufacturers other than Thinkpads to test.
<taleon> Lenovo Thinkpads
<tankf33der> lets try with your issue
<abu[7]> Hmm, but Pil calls the native C library, thus the internal syscall mechanism should be irrelevant, no?
<tankf33der> show me output from:
<tankf33der> ldd bin/picolisp
<tankf33der> first i want your issue on my side
<taleon> The only difference to the standard installation is that I have added the user to the `staff` group and increased a few values in /etc/login.conf. Likewise in /etc/sysctl.conf
<tankf33der> this is your nonstandard readline!!!
<tankf33der> you MUST you readline
<tankf33der> you MUST use you readline
<tankf33der> normal gnu version
<taleon> The original readline provided with OpenBSD is too old and does not work with Picolisp.
<abu[7]> T, libereadline.so.3.0
<tankf33der> my instruction provided steps
<taleon> We already had this topic last time and you have therefore adapted the Makefile so that it also works with the readline from the packages.
<taleon> If I follow your steps, many programs no longer work for me. Not even xterm.
<tankf33der> i do not think so
<abu[7]> Why is it so old?
<abu[7]> I have ibreadline.8.2.so
<tankf33der> :)
<abu[7]> Any reason?
<tankf33der> gnu is /usr/local/lib/libreadline.so.8.2
<tankf33der> your version is
<tankf33der> your version is /usr/local/lib/libereadline.so.3.0
<tankf33der> show me your 'ldd xterm' output
<taleon> Not possible
<taleon> # ldd /usr/X11R6/bin/xterm
<taleon> /usr/X11R6/bin/xterm:
<taleon> /usr/X11R6/bin/xterm: Permission denied
<taleon> /usr/X11R6/bin/xterm: exit status 1
<tankf33der> use termbin :)
<taleon> sorry :)
<tankf33der> empty
<taleon> Yes, permission denied
<tankf33der> pb1n.de ? :")
<taleon> OpenBSD will not let me run ldd on system tools. Not even as root.
<tankf33der> ok, never mind
<tankf33der> so
<taleon> very strange
<taleon> I will deinstall the readline package
<tankf33der> try
<tankf33der> no conflicts, right ?
<taleon> 2024-06-13-154458_2560x1440_scrot.png
<taleon> permission denied
<taleon> xterm works, however. I work with it all the time. Very very strange.
<tankf33der> restart :)
<tankf33der> show output ls -l /usr/local/lib/libread*
<taleon> ls: /usr/local/lib/libread*: No such file or directory
<taleon> I deinstalled readline before
<tankf33der> good
<taleon> ldd xterm same error
<tankf33der> install gnu readline from internet
<tankf33der> follow my steps
<tankf33der> afk.
<taleon> 2024-06-13-160823_2560x1440_scrot.png
<taleon> Which llvm version should I install? I installed llvm-16 because I need the clang-tools, like clangd etc.
<taleon> I will test with llvm-17
<taleon> I really have no idea anymore.
<tankf33der> Easy
<tankf33der> I am walking in city
<tankf33der> without pc
<tankf33der> so
<tankf33der> did you installed gmake?
<taleon> pkg_add vim git wget llvm gmake libffi
<taleon> yes
<tankf33der> Next:
<tankf33der> Install any version of llvm
<tankf33der> no big deal
<taleon> I installed 16 and 17
<tankf33der> good
<tankf33der> next:
<tankf33der> cp makefile makefile.openbsd
<tankf33der> we will modify openbsd version
<tankf33der> remove silent directove
<taleon> ok
<tankf33der> directivi
<taleon> ok
<tankf33der> next
<tankf33der> Lets switch llvm16
<tankf33der> Add postfix -16 to every llvm ecosystem call
<tankf33der> type gmake
<tankf33der> oops
<tankf33der> gmake -f Makefile.openbsd
<tankf33der> opt
<tankf33der> llc
<tankf33der> llvm-config
<tankf33der> and so on
<taleon> afk some minutes
<tankf33der> replace MAIN line from my doc
<taleon> Same error
<tankf33der> Ok
<tankf33der> ldd bin/picolisp
beneroth has joined #picolisp
<abu[7]> First version of Steno documentation is done! ☺ https://software-lab.de/StenoBoard/README
<abu[7]> Also a Cheat Sheet at https://software-lab.de/StenoBoard/cheat.pdf
<tankf33der> I will do marketing in hour
<abu[7]> Marketing?
<tankf33der> Posts to blogs
<abu[7]> 👍
<tankf33der> Done from bus
<tankf33der> HN, lobste.rs, tilde.news
theruran has joined #picolisp
<taleon> tankf33der: It seems that you cannot run ldd on xterm. However, there is another way: https://termbin.com/sr7e
<taleon> readelf -d `which xterm` | grep hare
<taleon> "ldd, by the way, can run arbitrary code, so maybe don't use it so much especially if a confused user has a binary in their home dir they want you to look at as root"
<beneroth> good advice ^^
<tankf33der> taleon: xterm do not use readline, see
<taleon> ou're right. I also installed readline directly as in your instructions and xterm still works. I don't know why that made half my system unusable the other day.
<tankf33der> :)
<tankf33der> I do not have openbsd systems home since cannot install openbsd on qemu
<tankf33der> lets continue tomorrow
<abu[7]> Thanks to both of you!
<tankf33der> I will send you mine bin/picolisp or you have to switch to pil64
<tankf33der> afk.
msavoritias has quit [Remote host closed the connection]
msavoritias has joined #picolisp
<taleon> Aye, thank you for your time and support.
<taleon> Under linux, OpenBSD should also run in qemu. In any case, it has always worked for me.
<taleon> qemu-system-x86_64 -m 4G -hda /dev/nvme0n1 -hdb -cdrom install75.iso -curses -boot d
<taleon> qemu-system-x86_64 -m 4G -hda /dev/nvme0n1 -cdrom install75.iso -curses -boot d
msavoritias has quit [Ping timeout: 252 seconds]
bjorkintosh has quit [Remote host closed the connection]
bjorkintosh has joined #picolisp
bjorkintosh has joined #picolisp
bjorkintosh has quit [Changing host]