freenode/#clasp - IRC Chatlog
Search
20:55:06
drmeister
C++ method pointers are 16 bytes, two qwords. The second qword is always zero in my tests - as I hoped.
21:17:26
drmeister
freemint: Just a bit - I can save simple images and load them in and fixup vtable pointers.
21:19:20
freemint
Julia is not gonna work on such functionality for some time and maybe it is technocally impossible without a major rewrite.
21:19:48
drmeister
Yeah - I've been mucking around with clasp internals for the last three months. It's not easy to implement this.
21:20:22
drmeister
I'm still not certain it's possible. There are lots of places where it could go off the rails.
21:21:50
drmeister
I'm working on reconnecting function and method pointers at the moment. I'm in the middle of a heart stopping moment where I have function pointers like 0x21. I'm working on figuring out where they are coming from.
21:22:21
freemint
Julia could use some work on GC but it is good enough for the fast non allocating you tend to write in Julia.
21:32:09
drmeister
Bike: Yeah - I'm doing an inventory of all the code pointers that I need to save/load. I'm identifying what library they belong to.
21:32:40
drmeister
I found about two dozen that look bogus - they have function pointers that look like 0x21 and 0x1dc - small values like that.
21:33:26
drmeister
So I added some code to trap and print a message when a bogus function pointer like that comes through. The first one I looked at was DoubleFloat_O::castToInteger.
21:36:56
drmeister
And it does this weird thing - but that may not be related to its weird function pointer.
21:38:37
drmeister
ABI specification documents? We don't need no stinkin' ABI specification documents!
21:41:07
drmeister
But on that, I was perusing the x86-64 ABI specification this morning before breakfast and I see that they give x86-64 code examples for different types of calls. Small code model calls, medium code model calls, large code model calls.
21:43:02
drmeister
I'll have to look again but I didn't see any conditional tests in there - it's straight up load registers and calls. So a function pointer like 0x21 may be a bug in clasp that we haven't encountered? Or is there code down at the bottom of memory?
21:52:36
drmeister
I don't understand how these methods are callable - their function pointer values are messed up but they appear to work.
21:53:30
drmeister
I have like 3500 function/method pointers that are fine. I have about 25 that are messed up with these low values - but I am able to call them - weird.
21:53:59
drmeister
I'd like to understand how they work before I go implementing image save/load and do what with them? Ignore them?
22:03:38
karlosz
drmeister: this is just a shot in the dark, but maybe the function pointers are not actually 0x21 and they are just printing/displaying that way?
22:04:27
freeemint
drmeister, could it be that you loaded these funcion from something external, maybe some shared/hard linked binary?
22:32:20
drmeister
What's going on here is that clasp is registering methods and this is a method pointer stored at 0x11f5ce5d0 and it's 16 bytes wide (8 bytes for function pointer??? and 8 bytes for "this" adjustment).
22:32:55
drmeister
Hmmm, this is C++ ABI stuff - it's not x86-64 ABI - this is not a regular function pointer.
22:35:05
drmeister
All of these weird method pointers have #b001 in the low bits - I'm wondering if it's some kind of tagging scheme?
22:39:07
drmeister
Well - this ain't a problem then. I'll just leave anything with any low bits set alone.
22:39:47
drmeister
In that case then I know how to deal with function/method pointers for this first tentative step.
22:40:17
drmeister
The first tentative step being - can I start up the iclasp-boehmprecise -I -n interpreter, save the image and then start the interpreter back up and load the image and continue.