freenode/#clasp - IRC Chatlog
Search
15:26:05
Shinmera
It's so that the kids in this channel are saved from being exposed to swear words when they work on clasp.
15:28:17
Shinmera
Ahahaha, it's all me https://www.google.ch/search?q=site%3Airclog.tymoon.eu+clasp+"fucking"&oq=site%3Airclog.tymoon.eu+clasp+"fucking"
15:28:49
Bike
https://www.google.ch/search?q=site%3Airclog.tymoon.eu+clasp+"fucking"&oq=site%3Airclog.tymoon.eu+clasp+"fucking"
15:43:00
drmeister
ACTION is glad to know that as far as google is concerned - he is a pure as the driven snow.
15:44:04
Bike
on the topic of binaries, what is needed to actually run clas? just iclasp boehm and an image, or more?
15:44:05
jackdaniel
I'm sure they have already profiled you as a cursing person who obfuscates these words. They wouldn't be able to make many if they didn't know such things ;-)
15:45:33
jackdaniel
I'm going to give some rest to my brain (that is – going to watch a movie which doesn't require a single thought [as I've been told] – justice league ;)
15:46:06
drmeister
Bike: minimally - I'd start with the executable and a couple of bitcode files: builitins.* fastgf.* intrinsics.*
15:46:56
drmeister
They are linked and inlined with JITted code, dispatchers and compile-file'd code.
15:47:43
drmeister
They are incorporated into the image - but as native code - these are bitcode - for llvm.
15:51:26
drmeister
I'd rather embed them in the executable. I've been thinking of base64 encoding them in an array.
15:52:19
drmeister
Note: We still have a problem with backtraces on linux. That's kind of a show stopper.
15:52:59
drmeister
I tried to get libunwind to work - but there is a complicated JIT registration system that has thwarted me until now.
16:00:02
drmeister
ACTION goes back to debugging thread local variables - which he appears to have broken this morning.
16:03:13
frgo
When doing coding for clasp I often hear https://www.youtube.com/watch?v=OpnmLRKktU4 and find that kind of very matching ...
16:05:57
frgo
And - I have a real use case for Clasp: Binding RTI Connext DDS' C++ library to Lisp. AND I need to have that running in January 2018. I very much would like to be able to have PoC ready.
16:08:35
frgo
The title / interpret I mentioned helps in pushing the cpu fan noise into the background
16:11:51
drmeister
stassats: A lot of Clasp's problems are inherent to the way it builds itself up from C++ and the way that it starts up - there are a lot of optimizations that we can't take advantage of.
16:12:15
drmeister
Bike is working on it - he got cclasp to build cclasp a new way yesterday that is a stepping stone to getting sbcl to build it.
16:12:16
frgo
drmeister: Re clbind: I have a class dds::domain::DomainParticipant. How would I expose that using clbind? Like so:
16:13:26
Bike
though on the note of speeding things up, i asked this a few days ago but: i realize parallel jit is broken, but what about parallel compile file?
16:15:27
frgo
drmeister: Sure: Example here: https://community.rti.com/static/documentation/connext-dds/5.3.0/doc/api/connext_dds/api_cpp2/classdds_1_1domain_1_1DomainParticipant.html
16:20:48
drmeister
I am being pulled out the door to get some brunch - I'll be back in an hour or so.
16:21:39
drmeister
That example needs more classes exposed to flesh it out because many of the functions take instances of other classes that need to be exposed as arguments.
16:22:16
frgo
Yeah. Thx. And the DDS C++ shared lib? Do I link that just to clasp during compile or do I do a dlopen() and load it at runtime?
17:09:12
drmeister
The shared lib can be loaded with dlopen or linked and the wrapper code can be loaded as bitcode. If you compile the shared lib as bitcode then everything can be linked as bitcode and LTO will inline (almost) everything into everything.
18:21:13
drmeister
Yes - the extension modules give you something in addition - they let you define GC managed C++ classes.
18:28:24
drmeister
The way I see it is an asynchronous signal handler should get the SIGINT signal and should set a flag that some thread (which?) will occasionally check and then unwind the stack.
18:33:17
frgo
E.g.: Do we want to stop clasp on sigkill? Certainly. But in a controlled way, Now: What is the "controlled way"? Send sigkill to all threads - meaning; Calling a function per thread that kills the thread? Would be one way to do it.
18:34:13
drmeister
But the underlying mechanism - how does a thread recognize that it got a sigkill?
18:36:11
frgo
we need to have a function registered in the thread struct that gets called when the process' signal handler is invoked. So:
18:37:20
frgo
Signal -> Caught by signal handler in process -> That signal handler does for all threads: Check if function (generally or a separate one for each signal)
18:38:01
frgo
The called function my be set to something thread specific - but normally would just exit the thread .
18:40:21
frgo
For applicatoions that really need to shutdown gracefully no matter what signal is received it is required to have an alternate stack in place (via function sigaltstack) that is used to handle signal handler function execution.
18:42:46
frgo
Yes. That is the question. For C++ only that's magic (for me) - for clasp: I don't know.
18:44:41
Bike
if signals are process level they're hard to use. say we get a floating point exception, how could we know what thread triggered it?
18:44:44
drmeister
The only way I know how is for C++ to occasionally check a flag (global or thread local) and proceed based on the results.
18:45:52
drmeister
Bike: Martin Cracauer brought that up - he said we shouldn't involve signals at all - they are too expensive, and bring problems like the one you are raising - they are the wrong mechanism.
18:45:55
frgo
Well, a thread that does cause a non-recoverabele error wll be in a defunct state that we can check for.
18:47:42
drmeister
The only way I see is for every thread to occasionally check a flag to see if it should check further for directions.
18:49:01
frgo
I've never done it, but: I would like to test if we can setup signal handlers per thread. Hang on ...
18:50:27
drmeister
Even if you can - they are fundamentally asynchronous and the stack will be in a dirty state and shouldn't be touched, let alone unwound.
18:52:42
drmeister
Unless someone has a better idea or understanding - I would say we have a thread-local variable that each thread checks as it leaves a function or at the bottom of loops (and could be generated or not using a (DECLARE (OPTIMIZE ...))) and take the hit in performance.
18:55:17
frgo
So we have pthread_sigqueue to send a signal to a specific thread. will read up on that again ...
19:02:39
drmeister
Hmmph - I just figured out what I broke this morning - I moved GC managed pointers out of GC managed memory.
19:07:12
drmeister
I managed it in a special way - I defined a ThreadLocalState struct that contained all of the thread local data structures directly.
19:08:01
drmeister
I allocated that at the top of the stack. With it on the stack it is managed, its roots are identified by the conservative stack scanner.
19:09:40
drmeister
I ran into an issue with header file order now that I want to define the allocation points within the ThreadLocalState structure - so I defined ThreadLocalState to contain pointers to some of the thread local data structures - BRRRRAAAAPPPP! Wrong - don't do that.
19:12:11
drmeister
As long as the thread is live the stack is active and the thread local roots are roots.
19:14:23
drmeister
Bike: By the way - David Lovemore (Ravenbrook) says (re: Saving and restoring MPS memory) "It's not possible at the moment. But it ought to be possible."
19:46:25
jackdaniel
just as I thought, watching this movie was a great rest for the brain – I had enough visual effects to keep it at some low futile gear yet it has too little meaning to engage higher parts
20:59:47
drmeister
Bike: Is there a way to identify the bottom of loops - to insert a check for notifications from the system to threads?
21:00:47
Bike
we could detect obvious ones. that would cover most of it but obviously we can't identify all possibly nonterminating regions
21:01:46
drmeister
Could we insert an invocation of an inlined test controlled by a (declare (optimize ...)) policy?
0:48:10
drmeister
It's a little slow - I'm not sure why - it took 1h45m on my system here when a couple of days ago it was 1h30m
0:51:01
Bike
for the not found, you have to set the variable in wscript.config to point to the externals config llvm-config.
0:52:14
drmeister
stassats: Put this in your wscript.config: LLVM_CONFIG_BINARY = '/Users/meister/Development/externals-clasp/build/release/bin/llvm-config'
0:52:43
stassats
this is what make says Checking for program 'llvm-config' : /usr/lib/llvm-5.0/bin/llvm-config
1:02:22
stassats
and please, don't remove makefile altogether, i wouldn't remember the right build incantation
1:07:20
Bike
yeah, looks like some arm cpus have a "performance monitoring unit" that has a few counters
1:16:30
stassats
export LIBRARY_PATH=/usr/local/lib/ works (and why do i have it in /usr/local? because i had to build it by hand for clasp to get linked by clang)
1:16:31
drmeister
Bike: There's a guy at Temple who could help us set up some virtual servers to do continuous integration.
1:17:38
drmeister
stassats: You had to build boost recently by hand? I've been using package managers to install boost for a couple of months.
1:19:46
frgo
-> missing file: '/opt/common-lisp/lang/clasp/src/clasp/build/mps/src/gctools/interrupt.sif'
1:22:15
drmeister
interrupt.sif should have been built by the scraper - I don't understand how it could be missing. It's automatic.
1:25:21
drmeister
When it was building clasp - did it report something like: [ 19/356] Scraping with preproc.scan src/gctools/interrupt.cc
1:26:37
drmeister
It's using sbcl and running the preprocessor on each source file - I'm worried that it failed somehow for interrupt.cc
1:27:59
frgo
Yes, it did fail for interrupt.cc - see: https://gist.github.com/dg1sbg/5538a17e93b32543d3fa4bd33cc0569f#file-gistfile1-txt-L53
1:36:57
frgo
drmeister: For a later date: Signal handling the safe way - that's what we need to do in clasp: https://gist.github.com/dg1sbg/3b608bf1c880148cc06faffd641c8809
1:38:11
drmeister
stassats: It's a macro that generates a wrapper around a C++ function so that it compiles the lambda list/argument handling with Cleavir rather than using the C++ LambdaListHandler_O class.
1:49:26
frgo
To get rid of that FRGO... tag I need to assign a new one. How should be name the current state of affairs? which version of clasp do we currently have? like pre_0.5 ?
1:51:23
stassats
all uses of GENERATE-DIRECT-CALL-DEFUN use MAGIC-INTERN, maybe it should just be moved into generate-direct-call-defun?
2:01:42
drmeister
There's a chance that it might not use magic-intern - but they are all using it at the present time. I think I'll leave that this way.
2:49:09
drmeister
Ok, just to be clear - cclasp built, asdf built, when you start slime it compiles all of the slime code and then segfaults.
3:03:18
drmeister
I'm not aware of any OS X/Linux differences that could be tripping stuff up - but I was working with threading, MPS and thread local storage.
3:12:27
stassats
(mp:process-run-function nil (lambda () (load "quicklisp/setup.lisp"))) does it for me
3:19:02
stassats
there's core__catch_function, then there are some core__call_with_variable_bound, and then _Unwind_Find_FDE