ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
orivej has joined #picolisp
orivej has quit [Ping timeout: 255 seconds]
aw- has joined #picolisp
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
orivej has joined #picolisp
orivej has quit [Ping timeout: 276 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #picolisp
orivej has quit [Ping timeout: 248 seconds]
aw- has quit [Quit: Leaving.]
rob_w has joined #picolisp
aw- has joined #picolisp
<tankfeeder> morning
<tankfeeder> Regenaxer: here ?
<Regenaxer> morning
<tankfeeder> pil32 on cygwin and hpux failed on this code
<tankfeeder> pil32 on linux (by default) all ok
<Regenaxer> strange, why?
<Regenaxer> too much memory?
<tankfeeder> ~70MB
<tankfeeder> maybe garbage collector on anon cells
<Regenaxer> hmm, not so big
<tankfeeder> (gc 200) saves something
<Regenaxer> Why should cygwin be different?
<tankfeeder> hpux too
<Regenaxer> no idea
<tankfeeder> with (gc 20) crashes
<Regenaxer> yes, memory
<Regenaxer> no system calls envolved
<Regenaxer> But perhaps the heap is destroyed *before* that?
<tankfeeder> flat list on 1M anons works
<tankfeeder> let me try 1000 lists on 1000 items
<Regenaxer> Does anything happen before?
<tankfeeder> no
<tankfeeder> just pil start
<tankfeeder> (grid 1000 1000) breaks it, not for
rob_w has quit [Quit: Leaving]
rob_w has joined #picolisp
<Regenaxer> It is a heisenbug
<Regenaxer> as always when gc gives problems
<Regenaxer> The heap is destroyed somewhere
<Regenaxer> only pil32?
<tankfeeder> cygwin and hpux only pil32
<tankfeeder> itself
<aw-> hi all
<Regenaxer> Hi aw-
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
mtsd has joined #picolisp
miskatonic has joined #picolisp
<mtsd> Good morning all
<beneroth> hi all
<Regenaxer> Hi mtsd, beneroth
<mtsd> Hi Regenaxer
<miskatonic> hi
<Regenaxer> Hi miskatonic
<beneroth> (tell (all) 'hi))
<beneroth> (incorrect but working)
<mtsd> :)
<mtsd> How can I check index sizes? I run things like (iter (tree 'nr '+Obj) '((N) (println (size N)))) to check external objects
<mtsd> Was thinking about how to do the same for indexes
<mtsd> To place them in database files and so on
<Regenaxer> You mean the sizes of the index nodes themselves? They are all of the same size, the specified block size
<beneroth> well how to find out how many nodes (blocks) an index tree uses?
<Regenaxer> When a node exceeds this size, it is split into two
<Regenaxer> hmm, this is not directly visible
<beneroth> aye
<beneroth> needs manual traversing through the tree I guess...
<mtsd> It is not a problem, was just thinking about it the other day
<Regenaxer> difficult, as the number of entries in a node may differ, eg. according to key lengths and objects
<Regenaxer> yes
<beneroth> I thought about it before, too. but haven't yet attempted to come up with a solution.
<Regenaxer> A recursive iteration is needed, yes
<mtsd> I use the setup from the demo app today, more or less. small indexes and normal indexes, (2 <indexes>) and (4 <indexes>)
<tankfeeder> netbsd 7, i386, pil32 doesnt crash
<tankfeeder> good sign.
<Regenaxer> I recommend to inspect some trees, eg. with (edit (cdr (root (tree 'nm '+User))))
<Regenaxer> Then click on the subnodes
<Regenaxer> with 'K'
<beneroth> yeah I have a tool for doing that.
<mtsd> Thanks Regenaxer! I will have a look. It is a good way to learn as well
<Regenaxer> beneroth, cool!
<beneroth> but too specific to publish. I basically use (step)
<Regenaxer> tankfeeder, hmm, but the bug may be there even if it does not crash
<beneroth> then I print a html list of nodes and their block usage in percent (100% = perfect usage of blocksize)
<beneroth> handy to spot under-/overusage
<mtsd> Good idea, beneroth
<beneroth> I use 4 and 6 as blocksizes for indices. Thought about using 2 too, but then ditched and and stayed with 4 and 6.
<beneroth> would only fit a small often-changing index into 2
<mtsd> I am optimising a bit at the moment. An app that has been running for a while and accumulated some data. It is to be extended now, and I am taking the opportunity to look into this
<beneroth> default page size (aka minimum IO blocksize during read actions? If I get this correctly?) is 4kb, so picolisp blocksize 6. much below that probably doesn't give much performance benefits (but storage and RAM usage benefits) I believe
<beneroth> someone with more OS knowledge please correct me
<beneroth> mtsd, very good. good opportunity :)
<Regenaxer> I also tried 6 and 4
<Regenaxer> I think unless the index is very big, I always stay with 4
<Regenaxer> only for very small ones I take 2
<Regenaxer> user names etc
<beneroth> I think it is not that bad when index blocksize is bigger than the usual usage.. much worse when the index is splitted over many blocks, no?
<Regenaxer> 6 did not give a measurable advantage
<Regenaxer> It loads less blocks, but loading is more expensive
<Regenaxer> I think for bigger block sizes the performance goes down
<Regenaxer> The bottleneck is disk cache
<mtsd> I saw this a great opportunity to dig deeper in the database part of pil
<tankfeeder> openbsd crash
<Regenaxer> So big block use up more cache, even if only one item is needed
<beneroth> Regenaxer, thanks
<Regenaxer> Perhaps very large memory changes it
<beneroth> I actually haven't indices 6 in use yet I just noticed xD
<mtsd> Perhaps 2 and 4 is more or less optimal already, for most uses
<beneroth> mtsd, probably so
<Regenaxer> yes
<beneroth> mtsd, I think for storage usage, it is more important to properly assign the objects to fitting block sizes.
<Regenaxer> tankfeeder, it would be important to know where exactly it crashes
<Regenaxer> well, it is in gc
<Regenaxer> but which cell, and who created it?
<tankfeeder> i cant do it, i dont understand sources
<beneroth> tankfeeder, maybe use strace to debug
<Regenaxer> yeah, it is difficult
<Regenaxer> strace does not help, it is in memory
<Regenaxer> Indexes: It is more helpful if a critical index is in its own file
<Regenaxer> then caching is better (near locations)
<beneroth> I had such a bug once, when I stupidly re-defined a function which was currently executing further calls. when the sub-calls finished, it jumped back into the function which called it, which got redefined -> its cells might got gc'ed -> if so = segfault
<Regenaxer> yes, I remember that case
<beneroth> hard to forget. good lesson. *g*
<Regenaxer> But tankfeeder did not do much before that
<beneroth> I guess so. he probably wouldn't produce such a stupid bug.
<Regenaxer> So it sounds nasty :(
<beneroth> well either a nasty nasty heisenbug. or a very tricky bug in the VM :(
<Regenaxer> yes
<Regenaxer> but pil32 was well seasoned I thought
<Regenaxer> tankfeeder, is this prog long?
<Regenaxer> Can you post it?
<beneroth> only on hpux and cygwin, yes?
<beneroth> weird
<Regenaxer> thx
<Regenaxer> same as before, ok
<tankfeeder> gdb run
<Regenaxer> yes, in mark() as expected
<Regenaxer> so the heap is corrupted
<Regenaxer> Can you call it without anything, just picolisp y ?
<tankfeeder> the same
<tankfeeder> pil64 openbsd & linux doesnt crash
<Regenaxer> mom, tel
<tankfeeder> freebsd-x64, pil64 doesnt crash too
<tankfeeder> hot news:
<tankfeeder> if i comment this two lines inside (grid) simul.l all works
<tankfeeder> #(con (: 0 -1) # north
<tankfeeder> # (or (car L) (and FY (car Col))) )
orivej has joined #picolisp
<beneroth> tankfeeder, every change in the program -> change in stack/heap -> change in bug
<beneroth> most fun category of bugs
<tankfeeder> this is not heisenbug
<beneroth> right
<beneroth> hm
<beneroth> sorry
<tankfeeder> i think it now
<beneroth> (: 0 -1) <- is this ok? using a number as a property name?
<tankfeeder> yea
<tankfeeder> its ok
<beneroth> ok
<beneroth> just wondered
<Regenaxer> Sorry, phone still
mtsd has quit [Ping timeout: 260 seconds]
<tankfeeder> ^^ con lines uncomment and replace or to and it works
<tankfeeder> con -> if con
<tankfeeder> (con (: 0 -1) (car Col)) - works
<tankfeeder> (con (: 0 -1) (car L)) - crash
<tankfeeder> and
<tankfeeder> so (con (: 0 -1) T), (con (: 0 -1) 123), (con (: 0 -1) NIL) - all combinations works
<aw-> hey beneroth
<Regenaxer> done
<beneroth> hey aw- :)
<Regenaxer> yes, 0 is not a property but the value cell for 'get' and ':' etc
<beneroth> we start using your JSON lib in my company this week :)
<beneroth> (for a domain registry API client)
<aw-> cool!
<beneroth> Regenaxer, ha! so (: 0) is the bad bit!
<aw-> i also use it in production, for many things
<Regenaxer> let me check 'grid'
<beneroth> " extracting the value (if the next argument is zero) or a property from a symbol"
<beneroth> ah
<beneroth> I jump to conclusions too fast, sorry tankfeeder
<Regenaxer> yes, (con (: 0 -1) ..) should be fine, but only if the value (: 0) is a cell
<Regenaxer> Is that not the case?
<Regenaxer> Can you trace 'con'?
<Regenaxer> 'grid' assumes it always has a cell there
<Regenaxer> I don't remember the details (as ever ;)
<tankfeeder> doing, waiting finish long run code
<Regenaxer> I trace now
<Regenaxer> hmm, 'con' is not called at all in (for Col G (for This Col (=: B6 1)))
<Regenaxer> ah
<Regenaxer> stupid
<Regenaxer> must trace before 'grid' :)
<tankfeeder> before grid is nothing
<Regenaxer> no, my error was to do (trace 'con) *after* grid
<Regenaxer> now I have a long trace
<Regenaxer> 4000000 lines
<Regenaxer> I filtered the output. All OK
<Regenaxer> All have the form 'con : ('
<Regenaxer> ie. a cell
<Regenaxer> All of the form
<Regenaxer> con : (NIL) $346522604077
<Regenaxer> con = $346522604077
<Regenaxer> con = $346522572273
<Regenaxer> con : (NIL) $346522572273
<Regenaxer> con : (NIL) $346522604104
<Regenaxer> So (con (: 0 -1) .. is not wrong
<Regenaxer> The problem must be before that
<tankfeeder> inside for problem always occurs in position 264x14
<tankfeeder> inside (grid 1000 1000)
<Regenaxer> Very strange
<Regenaxer> on both systems?
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<tankfeeder> now i playing only inside openbsd
<tankfeeder> in grid 1100x1100, crash occurs always on 180x211
<tankfeeder> 1200x1200 -> 23x1082
<tankfeeder> openbsd' malloc guards didnt find anything
<Regenaxer> ok
<tankfeeder> after openbsd reboot, crash on the same address inside grid
<Regenaxer> Perhaps a speculative of prefetching of heap cells! :D
<beneroth> xD
<tankfeeder> start crashing since (gc 50) and lower
<tankfeeder> all code ~70MB in memory
<Regenaxer> This is just because in a small heap gc runs more often, increasing the probability
<Regenaxer> Too bad that I don't have a 32-bit machine currently
<Regenaxer> ah, old notebook
<Regenaxer> I'll try
<Regenaxer> Latest pil?
<tankfeeder> yeap
<tankfeeder> any in year
<Regenaxer> om
<Regenaxer> ok
<Regenaxer> : (version)
<Regenaxer> 18.1.15 C
<Regenaxer> No crash
<Regenaxer> : (heap)
<Regenaxer> -> 54
<tankfeeder> linux ?
<tankfeeder> all linuxes works
<Regenaxer> Debian
<Regenaxer> I don't see a reason why this should depend on the OS
<tankfeeder> netbsd works, openbsd crash
<Regenaxer> no syscalls involved
<tankfeeder> heapAlloc and Free ?
<beneroth> OS page sizes?
<Regenaxer> glibc?
<beneroth> glibc, good point
<Regenaxer> malloc() is very standard
<Regenaxer> page sizes should not matter, they are transparent to a C program
<Regenaxer> Does it also crash in a minmal call?
<Regenaxer> picolisp prog.l
<Regenaxer> no libs loaded?
<tankfeeder> no libs
<tankfeeder> picolisp prog.l - crash
<Regenaxer> only simul.l in prog.l
<Regenaxer> ok
<tankfeeder> only simul
<Regenaxer> yes
<tankfeeder> i want update openbsd
<Regenaxer> but cygwin too
<Regenaxer> same glibc in openbsd and cygwin?
<Regenaxer> What do they have in common?
<tankfeeder> code inside gc.c
<tankfeeder> hpux too
<Regenaxer> no, gc is only the *symptom*
<Regenaxer> The reason is somewhere else
<Regenaxer> Terrorist pointer or something
<Regenaxer> gc crashes after the heap is corrupt
<Regenaxer> Cant crash it on my pil32 netbook
<Regenaxer> tried all combinations of calls
<beneroth> "terrorist pointer" :D
<Regenaxer> :)
<tankfeeder> latest openbsd crashes too
aw- has quit [Quit: Leaving.]
<tankfeeder> when i compile picolisp by gcc-4.9 from ports all works
<tankfeeder> gcc 4.2.1 -> 4.9.4
<tankfeeder> cygwin gcc 6.4.0
<tankfeeder> gcc 4.2.1 -> 4.9.4 on openbsd
<Regenaxer> interesting, we did not think about gcc, yes
<tankfeeder> centos 7 - 4.8.5
<beneroth> wow
<tankfeeder> hpux - 4.2.3 !!!
<Regenaxer> One more reason to write everything in Asm!!
<tankfeeder> i think issue closed for now.
<tankfeeder> enough.
<Regenaxer> Don't believe a compiler you have not written yourself ;)
<Regenaxer> Let's hope that this was the reason
<Regenaxer> Did you try a lower optimization? -O omitted or so?
<Regenaxer> default in pil32 is -O2
<tankfeeder> let me try
<Regenaxer> I had problems with -O3 10 years or so ago
<tankfeeder> default gcc from openbsd crashes without -O
<Regenaxer> ok
<tankfeeder> and with this too:
<tankfeeder> -fstack-protector-strong -fstack-shuffle -fstack-protector-all -Wbounded
<tankfeeder> bbl
<tankfeeder> i will try bump gcc on cygwin too and try
<tankfeeder> last time i failed
<beneroth> interesting issue
<beneroth> thanks for investing tankfeeder !
orivej has quit [Ping timeout: 255 seconds]
orivej has joined #picolisp
<tankfeeder> mingw works!, gcc lower than cygwin's - 6.3.0 vs. 6.4.0
<tankfeeder> this is good sign.
<Regenaxer> So the evil point is perhaps 6.4.0?
<tankfeeder> unknown
<Regenaxer> m_mans, yesterday you asked something about Telegram interface
rgrau has quit [Ping timeout: 256 seconds]
rgrau has joined #picolisp
<rick42> hi all
<Regenaxer> Hi rick42
<rick42> wow lol | <Regenaxer> One more reason to write everything in Asm!!
<rick42> hi Reg!
<Regenaxer> :)
<beneroth> Regenaxer is right :)
<beneroth> hi rick42 o/
<rick42> either you write the asm or some program does, and in the latter case, you wrote it or somebody else did (and in this case are most likely very ignorant of how it works (true for /me))
<rick42> beneroth: o/
<rick42> or the hw could have a bug ... but let's not go there (enough has been said lately :)
<Regenaxer> T
<beneroth> rick42, Turtles upon Turtles! better built the hardware too!
<beneroth> (pilOS calling...)
<rick42> :)
rob_w has quit [Quit: Leaving]
orivej has quit [Ping timeout: 248 seconds]
<cess11> interesting heisendebugging
Kev1n has joined #picolisp
Kev1n has quit [Remote host closed the connection]
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #picolisp
<tankfeeder> solaris x64 11.3 gcc 4.5.2, crash
<tankfeeder> just checked.
<Regenaxer> So the gcc theory breaks?
<Regenaxer> "x64" - So it is pil64 here? No gcc at all?
<tankfeeder> x64 as platform
<tankfeeder> pil32
<Regenaxer> ah, ok
<tankfeeder> still gcc
<tankfeeder> i belive in picolisp
<Regenaxer> I doubt it is the compiler's fault
<Regenaxer> hmm, mysterious
<tankfeeder> yea
Regenaxer has left #picolisp [#picolisp]
Regenaxer has joined #picolisp
<Regenaxer> Wanted to say:
<Regenaxer> Strange thing is that *this* specific code only gives the problem
<Regenaxer> pil32 is around a long time before that
orivej has joined #picolisp
<beneroth> tankfeeder, is maybe "pil32 on x64 OS" a common pattern?
<rick42> alleluia! :) | <tankfeeder> i belive in picolisp
<beneroth> heyo
<tankfeeder> beneroth: no, it was i386
<tankfeeder> hpux was on itanium
<beneroth> ok
<beneroth> weird riddle
<beneroth> "Is it ever possible that (a ==1 && a== 2 && a==3) could evaluate to true, in JavaScript?"
<beneroth> answer: yes
<beneroth> (it is hook-able)