Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: generate sysimg.so #3625

Closed
wants to merge 7 commits into from
Closed

WIP: generate sysimg.so #3625

wants to merge 7 commits into from

Conversation

ihnorton
Copy link
Member

@ihnorton ihnorton commented Jul 4, 2013

DO NOT MERGE

This is an attempt to save and reload the startup image as a shared library, for #260. It gets to repl.c and calls several functions deep into sysimg.so, but segfaults at the first literal pointer (as predicted by Jeff).

  • save bitcode
  • compile to shared library linked against libjulia
  • reload shared library at startup and set pointers
  • replace all uses of literal_pointer_val with... (globals?)
  • make deleteBody optional
  • ???

@ihnorton
Copy link
Member Author

ihnorton commented Jul 4, 2013

Current backtrace, the segfault is at the literal_pointer_val emitted for a uv handle in julia_init_stdio.

#0  0x00007ffff4d0fff1 in julia_init_stdio () from /cmn/git/julia/usr/bin/../lib/sysimg.so
#1  0x00007ffff4e5ffc9 in julia_reinit_stdio () from /cmn/git/julia/usr/bin/../lib/sysimg.so
#2  0x00007ffff4e5f8cf in julia__start () from /cmn/git/julia/usr/bin/../lib/sysimg.so
#3  0x00007ffff4e5ff66 in julia__start1676 () from /cmn/git/julia/usr/bin/../lib/sysimg.so
#4  0x00007ffff6b8aae6 in jl_apply (f=0x1298f30, args=0x0, nargs=0) at julia.h:1023
#5  0x00007ffff6b8e483 in jl_trampoline (F=0x1298f30, args=0x0, nargs=0) at builtins.c:847
#6  0x00007ffff6b81df9 in jl_apply (f=0x1298f30, args=0x0, nargs=0) at julia.h:1023
#7  0x00007ffff6b865a1 in jl_apply_generic (F=0x1298eb0, args=0x0, nargs=0) at gf.c:1401
#8  0x0000000000403c46 in jl_apply (f=0x1298eb0, args=0x0, nargs=0) at /cmn/git/julia/src/julia.h:1020
#9  0x00000000004047c1 in true_main (argc=0, argv=0x7fffffffe1d0) at repl.c:263
#10 0x00007ffff6bee692 in julia_trampoline (argc=0, argv=0x7fffffffe1d0, pmain=0x4045f1 <true_main>) at init.c:646
#11 0x00000000004049b3 in main (argc=0, argv=0x7fffffffe1d0) at repl.c:303

@timholy
Copy link
Member

timholy commented Jul 4, 2013

Exciting stuff!

@StefanKarpinski
Copy link
Member

!!!

@kmsquire
Copy link
Member

kmsquire commented Jul 4, 2013

You forgot one part...

  • save bitcode
  • compile to shared library linked against libjulia
  • reload shared library at startup and set pointers
  • replace all uses of literal_pointer_val with... (globals?)
  • make deleteBody optional
  • ???
  • Profit!

;-)

@StefanKarpinski
Copy link
Member

I also believe that stealing underpants is one of the steps.

@ViralBShah
Copy link
Member

Awesome!

@ViralBShah
Copy link
Member

Does this also make it possible to pre-compile packages?

@ihnorton
Copy link
Member Author

ihnorton commented Jul 5, 2013

No, there is a ways to go; literal_pointer_val is used all over codegen. I hope this infrastructure stuff is helpful, but it's only a start.

@ihnorton ihnorton mentioned this pull request Jul 29, 2013
@ihnorton ihnorton closed this Jul 30, 2013
@ihnorton ihnorton deleted the reloadso branch May 4, 2014 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants