00:22
LamBaah has joined #picolisp
00:22
LamBaah has quit [Client Quit]
01:06
GrayArea has quit [Ping timeout: 256 seconds]
01:51
orivej has quit [Ping timeout: 246 seconds]
07:55
<
Regenaxer >
Still a bug in tty handling in pil21
07:55
<
Regenaxer >
if a child process reads from tty
07:55
<
Regenaxer >
I have that in a REPL in GUI child process
07:56
<
Regenaxer >
when the process times out
07:56
<
Regenaxer >
Can also be reproduced with this:
07:56
<
Regenaxer >
$ bin/picolisp -'unless (fork) (char)' -bye
07:56
<
Regenaxer >
Needs an "stty sane" after that
07:57
<
Regenaxer >
Must have something to do with readline
08:57
<
Regenaxer >
Must be some signal issue
08:57
<
Regenaxer >
Problem is that strace does not help
08:57
<
Regenaxer >
when strace'd, the issue disappears
09:50
orivej has joined #picolisp
10:38
<
Regenaxer >
ok, changed terminal reset a little. Now for GUI children it is ok
10:38
<
Regenaxer >
But not for the unless (fork) case
10:39
<
tankf33der >
i am worried about llvm12 issue, we could ignore until it became release candidate or spent time now. i could write to llvm-dev ml, but they will not understand me and issue.
10:40
<
Regenaxer >
I think better find the reason
10:40
<
Regenaxer >
could be something fundamental
10:40
<
Regenaxer >
just by chance not showing in other versions
10:41
<
Regenaxer >
The crash is in heap operations
10:41
<
Regenaxer >
So what exactly is wrong?
10:41
<
Regenaxer >
is the heap
*sometimes* not aligned?
10:42
<
Regenaxer >
e.g. after the second block is malloc()ed
10:42
<
Regenaxer >
Did you try valgrind etc.?
10:43
<
Regenaxer >
btw, how do you type with your repaired shoulder?
10:48
<
tankf33der >
fingers are working
10:48
<
tankf33der >
i will post here my llvm progress
10:48
<
tankf33der >
leaving the hospital
10:54
<
Regenaxer >
Good news!
12:54
<
tankf33der >
Regenaxer: two runs on different llvms
12:54
<
tankf33der >
first: llvm11 stable
12:54
<
tankf33der >
last: night build snapshot
12:57
<
tankf33der >
both runs under valgrind of course
12:58
orivej has quit [Ping timeout: 256 seconds]
13:08
<
Regenaxer >
interesting!
13:09
<
Regenaxer >
Why two runs? I see only one
13:09
<
Regenaxer >
anyway some argument to eval in stem it seems
13:10
<
tankf33der >
two runs with multi newline separator
13:10
<
Regenaxer >
"equal" I meant
13:10
<
tankf33der >
do you see text after first two lines?
13:11
<
tankf33der >
refresh, should be
13:12
<
Regenaxer >
Perhaps cause I'm in w3m
13:12
<
Regenaxer >
anyway 'stem' -> 'equal'
13:12
<
Regenaxer >
ah, empty, same in w3m
13:13
<
tankf33der >
first two lines from llvm11, no warnings, see
13:13
<
Regenaxer >
yeah, understand
13:13
<
Regenaxer >
But how can it be different?
13:14
<
tankf33der >
because llvm12 generates that code, i belive in wrong backend
13:14
<
Regenaxer >
only relevant line is (equal (car L) (car P))
13:15
<
Regenaxer >
Which arg is wrong, and why is the question
13:15
<
Regenaxer >
or this line fails (? (atom (shift L)))
13:16
<
Regenaxer >
pointer/alignment etc
13:16
<
Regenaxer >
so it reads nonsense from the heap
13:18
<
tankf33der >
i could try to ask on irc or here:
13:19
<
Regenaxer >
Not sure, it is difficult to ask so that the problem is understood by non-PicoLispers ;)
13:19
<
Regenaxer >
Perhaps post a fragment of the .ll code?
13:20
<
Regenaxer >
Or debug the code
13:22
<
Regenaxer >
then call stem manually
13:22
<
Regenaxer >
shows the values passed to 'equal'
13:55
GrayArea has joined #picolisp
14:20
<
tankf33der >
asked on irc, on oftc server, #llvm
15:16
<
Regenaxer >
tankf33der, when will you be home?
15:21
<
tankf33der >
Regenaxer: already home
15:22
<
tankf33der >
no good answers on irc from llvm
15:22
<
Regenaxer >
I thought so
15:23
<
Regenaxer >
did you try (dbg ...)?
15:23
<
Regenaxer >
To trace down what exactly goes wrong
15:40
GrayArea has quit [Ping timeout: 272 seconds]
16:26
<
tankf33der >
i built pil21 with memory sanitizer and got always different warnings, but silence on llvm11
16:27
<
beneroth >
weird stuff
16:28
GrayArea has joined #picolisp
16:31
<
Regenaxer >
What is the output of (dbg ...)s?
16:34
<
Regenaxer >
Experiment with various locations
16:35
<
Regenaxer >
(cd src; make) && ./pil -'msg (stem (chop "abc/def\\ghi") "/" "\\")' -by
16:36
<
Regenaxer >
tests in quick succession from bash history
16:36
<
Regenaxer >
That's how I search for such bugs
16:36
<
Regenaxer >
s/-by/-bye
16:37
<
tankf33der >
llvm11 fails now under msan
16:37
<
tankf33der >
switch to dec13 branch and it is ok
16:39
<
Regenaxer >
We really need to know
*what* goes wrong
*where*
16:39
<
Regenaxer >
on a system where it is reproducible
16:40
<
tankf33der >
this is llvm11
16:40
<
Regenaxer >
Perhaps simpler data like (stem (1 2 3) 2)
16:41
<
Regenaxer >
The crashes are all only symptoms of some deeper problem
16:42
<
Regenaxer >
As you seem to reproduce it in llvm12, you should find the exact problem there
16:43
<
tankf33der >
this is llvm11
16:43
<
tankf33der >
pil21 is broken
16:46
<
Regenaxer >
valgrind passes here on llvm12/Debian
16:47
<
Regenaxer >
llvm11/Debian I mean
16:51
<
tankf33der >
bisect found problem started from this commit
16:52
<
Regenaxer >
What do you mean with "bisect"?
16:53
<
tankf33der >
git bisect - i set start and bad range and git do binary search on commits to find where problem started
16:54
<
Regenaxer >
11dec20 - 14dec20 was the big I/O change
16:55
<
tankf33der >
i think this why llvm12 fails now.
16:55
<
Regenaxer >
yes, but
*where* exactly does it go wrong
16:55
<
Regenaxer >
the infos don't help me
16:56
<
Regenaxer >
How did you check with the sanizer?
16:57
<
tankf33der >
CC = clang -fsanitize=memory
16:57
<
tankf33der >
and rebuild.
16:58
<
tankf33der >
it could crashes without backtrace too.
17:00
<
Regenaxer >
Can't build on termux
17:18
<
Regenaxer >
Can build on Debian
17:18
<
Regenaxer >
but then just "bin/picolisp" does not work
17:19
<
Regenaxer >
uninitialized bytes in readline
17:19
<
Regenaxer >
before any Lisp code runs
17:22
<
Regenaxer >
I think this is not usable
17:22
<
Regenaxer >
Why don't you 'dbg' on llvm12? It is where we have a
*real* error
17:25
DKordic has quit [Ping timeout: 260 seconds]
17:32
<
tankf33der >
because llvm11 fails too if i understands correct
17:33
<
Regenaxer >
Not fails
17:34
<
tankf33der >
how you run it?
17:34
<
Regenaxer >
the checker says something we don't understand
17:34
<
Regenaxer >
(dbg ) is like (msg ) in Lisp
17:34
<
Regenaxer >
you can put it anywhere and compile
17:34
<
Regenaxer >
(cd src; make) && ./pil -'msg (stem (chop "abc/def\\ghi") "/" "\\")' -bye
17:35
<
Regenaxer >
'dbg' takes a 64-bit integer and a Lisp Item
17:35
<
Regenaxer >
(dbg 7 $T) prints "7 T"
17:36
<
Regenaxer >
(dbg 1 L) prints "1 ("a" "b" .. etc
17:36
<
Regenaxer >
afp under shower
17:39
<
tankf33der >
============
17:39
<
tankf33der >
llvm12
17:39
<
tankf33der >
./pil -'msg (stem (chop "abc/def\\ghi") "/" "\\")' -bye
17:39
<
tankf33der >
("a" "b" "c" "/" "d" "e" "f" "\\" "g" "h" "i")
17:39
<
tankf33der >
=============
17:39
<
tankf33der >
llvm11
17:39
<
tankf33der >
$ ./pil -'msg (stem (chop "abc/def\\ghi") "/" "\\")' -bye
17:39
<
tankf33der >
("g" "h" "i")
17:39
<
tankf33der >
========
17:39
<
tankf33der >
so whats the point? how it could help?
17:52
ym has joined #picolisp
17:55
<
Regenaxer >
It
*must* print something to stderr
17:55
<
Regenaxer >
if you inserted dbg as in the link above
17:56
<
tankf33der >
aaaaaaaaaaaaaaaaaaaaa
17:56
<
Regenaxer >
It is where the loop traverses the list
17:56
<
tankf33der >
it make sence
17:56
<
Regenaxer >
either it prints something or crashes if wrong data :)
17:57
<
Regenaxer >
The next line calls 'equal'
17:57
<
tankf33der >
my head still feels bad after surgery
17:57
<
Regenaxer >
this is where I think llvm12 crashed
17:57
<
Regenaxer >
No hurry
18:07
<
tankf33der >
1 ("a" "b" "c" "/" "d" "e" "f" "\\" "g" "h" "i")
18:07
<
tankf33der >
Segmentation fault (core dumped)
18:07
<
tankf33der >
$ ./pil -'msg (stem (chop "abc/def\\ghi") "/" "\\")' -bye
18:07
<
tankf33der >
it crashed this way on llvm11
18:07
<
Regenaxer >
hmm, before printing anything?
18:08
<
tankf33der >
used this diff
18:08
<
tankf33der >
yea, copy-paste from cli
18:08
<
Regenaxer >
yes, looks good
18:08
orivej has joined #picolisp
18:08
<
tankf33der >
really? :)
18:08
<
tankf33der >
then trying on llvm12
18:09
<
Regenaxer >
crashes also if you just : (stem (1 2 3) 2) in repl?
18:09
<
Regenaxer >
Has nothing to do with the version
18:10
<
Regenaxer >
I try here
18:10
<
tankf33der >
$ pil21 +
18:10
<
tankf33der >
1 (1 2 3)
18:10
<
tankf33der >
: (stem (1 2 3) 2)
18:10
<
tankf33der >
Segmentation fault (core dumped)
18:10
<
Regenaxer >
you are right
18:10
<
tankf33der >
llvm11 ^^^
18:11
<
Regenaxer >
wrong call, my mistake
18:13
<
tankf33der >
what is correct then?
18:14
<
Regenaxer >
Just with 'L' it works:
18:14
<
Regenaxer >
$~/pil21 (cd src; make) && ./pil -"stem (1 2 3)
18:14
<
Regenaxer >
2" -bye +
18:14
<
Regenaxer >
1 (1 2 3)
18:14
<
Regenaxer >
1 (2 3)
18:14
<
Regenaxer >
~/pil21
18:14
<
Regenaxer >
'P' seems bad (?)
18:15
<
Regenaxer >
'P' is a stack structure
18:15
<
Regenaxer >
try (car P)
18:16
<
Regenaxer >
Printing L and (car P):
18:16
<
Regenaxer >
$~/pil21 (cd src; make) && ./pil -"stem (1 2 3)
18:16
<
Regenaxer >
2" -bye +
18:16
<
Regenaxer >
1 (1 2 3)
18:16
<
Regenaxer >
1 (2 3)
18:17
<
Regenaxer >
on llvm12 ?
18:17
<
tankf33der >
this is llvm11
18:17
<
tankf33der >
now llvm12
18:21
<
tankf33der >
llvm12
18:22
<
Regenaxer >
(NIL . @)
18:22
<
Regenaxer >
it is the stack structure
18:22
<
Regenaxer >
so the stack is not aligned
18:22
<
Regenaxer >
'equal' never succeeds
18:22
<
Regenaxer >
that explains it
18:23
<
Regenaxer >
But what exactly is wrong on the stack?
18:24
<
Regenaxer >
Can you try with (dbg A $T)?
18:24
<
Regenaxer >
instead of the other two
18:24
<
Regenaxer >
'A' should be the address
18:24
<
Regenaxer >
must be a multiple of 8
18:25
<
Regenaxer >
I thought llvm guarantees to allocate the stack at 64-bit boundaries
18:26
<
Regenaxer >
must check the reference
18:26
<
Regenaxer >
on Arm64 even the hardware forces this
18:26
<
tankf33der >
llvm12 ^^^
18:26
<
Regenaxer >
yes, 140734108545264 is
*not* aligned
18:26
<
Regenaxer >
multiple of 4 but not 8
18:27
<
Regenaxer >
Is there a compile time option?
18:29
<
Regenaxer >
from lang ref
18:30
<
Regenaxer >
I must set a layout option
18:31
<
tankf33der >
then you break ortability
18:31
<
tankf33der >
then you break portability
18:31
<
Regenaxer >
it
*needs* 64-bit alignment
18:31
<
Regenaxer >
pil21 would not run at all
18:32
<
tankf33der >
how it works in llvm7+
18:32
<
Regenaxer >
It was always aligned obviously
18:33
<
beneroth >
so wrong use of llvm which worked, or llvm changed default behavior?
18:33
<
Regenaxer >
I expected it to be a hardware requirement
18:33
<
Regenaxer >
it
*is* on Arm64
18:33
<
Regenaxer >
but x86 is more tolerant
18:34
<
Regenaxer >
I cannot find where I set the options
18:34
<
Regenaxer >
meta data in .ll
18:35
<
Regenaxer >
target datalayout
18:35
<
tankf33der >
page 4
18:35
<
tankf33der >
correct
18:36
<
Regenaxer >
Must study
18:36
<
tankf33der >
i can generate llvm-ir from simple c file on both lllvms and compare
18:36
<
Regenaxer >
I will insert a "target datalayout" section
18:37
<
Regenaxer >
I thought I had that
18:37
<
Regenaxer >
but omitted
18:37
<
Regenaxer >
example: target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
18:37
<
tankf33der >
i told you about this a year ago :)
18:37
<
Regenaxer >
really?
18:37
<
Regenaxer >
I know I had it
18:37
<
Regenaxer >
but it was not needed
18:37
<
Regenaxer >
we can't assume most of them
18:38
<
Regenaxer >
only 'S' remains probably
18:39
<
Regenaxer >
We should
*not* say 'E' or 'e'
18:39
<
Regenaxer >
cause we cannot know
18:40
<
tankf33der >
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
18:40
<
tankf33der >
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
18:40
<
tankf33der >
equal for 11 and 12
18:41
<
Regenaxer >
but not for machines with big endian
18:41
<
tankf33der >
target datalayout = "E-m:e-i64:64-n32:64-S128"
18:41
<
Regenaxer >
this is the full spec:
18:41
<
tankf33der >
sparc, clang10
18:42
<
Regenaxer >
We can o
18:42
<
Regenaxer >
we can use only 'S'
18:42
<
Regenaxer >
and perhaps 'p'
18:42
<
Regenaxer >
and p must be 64
18:42
<
Regenaxer >
so only 'S' makes sense
18:43
<
Regenaxer >
and I believed it is 64 anyways
18:43
<
tankf33der >
will you release immediatly or give me a line to test before ? :)
18:43
<
Regenaxer >
what is -128?
18:44
<
tankf33der >
-S128?
18:44
<
tankf33der >
where you find -128 in three lines?
18:44
<
Regenaxer >
at the end of the example above
18:44
<
Regenaxer >
target datalayout = "64-S128"
18:44
<
Regenaxer >
I would use this
18:45
<
Regenaxer >
but I forgot what the -128 means
18:47
<
tankf33der >
full doc
18:47
<
Regenaxer >
"The layout specification consists of a list of specifications separated by the minus sign character ('-')"
18:47
<
Regenaxer >
thats what I sent above
18:47
<
Regenaxer >
so why 2 values for 'S'?
18:50
<
Regenaxer >
it must be:
18:50
<
Regenaxer >
target datalayout = "S128"
18:51
<
tankf33der >
trying
18:51
<
Regenaxer >
hmm, moment
18:53
<
Regenaxer >
I think I know why the layout is not needed
18:53
<
Regenaxer >
I specify an alignment for each 'push'
18:54
<
Regenaxer >
this must go wrong
18:55
<
Regenaxer >
checking
18:57
<
Regenaxer >
So the .ll does not need a target layout
18:58
<
Regenaxer >
somehow the 'push' in _stem is wrong
18:58
<
Regenaxer >
wrong type?
18:58
<
tankf33der >
unknown
18:59
<
Regenaxer >
ok, sorry, no time now
18:59
<
Regenaxer >
will check tomorrow, ok?
18:59
<
Regenaxer >
Too tired anyway
18:59
<
Regenaxer >
and you must recover
18:59
<
tankf33der >
see you
18:59
<
Regenaxer >
thanks!!
19:51
ym has quit [Quit: Leaving]
19:59
<
beneroth >
you are awesome, I thank you both
20:19
<
Regenaxer >
Hmm, can't stop ;)
20:20
<
Regenaxer >
Alignment in push is not always done
20:20
<
Regenaxer >
So I better set a data layout
20:26
<
Regenaxer >
gives error when linking with code from .c
20:26
<
Regenaxer >
So I change the alignment in 'push'
20:29
orivej has quit [Ping timeout: 246 seconds]
20:30
<
Regenaxer >
I released it
21:19
<
tankf33der >
llvm7 and 11 are ok
21:21
<
tankf33der >
llvm12 fails on stem like before.
21:21
<
tankf33der >
sleep.
21:32
<
Regenaxer >
ok, tomorrow
21:33
<
Regenaxer >
I was absolutely sure the stack is now aligned to 8 bytes
21:35
<
tankf33der >
then i will dbg again on llvm12 now
21:38
<
Regenaxer >
No, better sleep :)
21:38
<
Regenaxer >
repair your shoulder
21:39
<
tankf33der >
last attempt
21:40
<
tankf33der >
140726631093744 T
21:40
<
tankf33der >
140726631093744 T
21:40
<
tankf33der >
140726631093744 T
21:40
<
tankf33der >
the same 4s
21:41
<
Regenaxer >
for 'A'?
21:41
<
tankf33der >
(dbg A $T)
21:41
<
tankf33der >
in loop before equal
21:42
<
tankf33der >
and 4s on llvm11 too
21:43
<
Regenaxer >
is line 89412 in src/base.ll this?
21:43
<
Regenaxer >
%44 = alloca i64, i64 1, align 8
21:43
<
Regenaxer >
ie align 8 ?
21:44
<
Regenaxer >
Why is it not aligned then?
22:30
orivej has joined #picolisp
23:04
viaken has quit [Quit: reboot]
23:05
viaken has joined #picolisp