-
-
Notifications
You must be signed in to change notification settings - Fork 17
add unexec #176
Comments
With 7d2f258f586d854e7ba4f2500ee189dafd304ef4 I can successfully dump a binary cperl executable from any script, even -e. (darwin so far, the others need to be tested). |
the emacs undump code for win32 is unusable by perl. emacs uses a custom malloc that allows storing and restoring the custom heap from a disk file. I also cant figure out how the emacs code is going to recreate and make valid again all the FDs from the frozen proc. XS DLLs and 3rd party DLLs need to be frozen and unfrozen too. Win32 unexec code pretty much would have to use https://msdn.microsoft.com/en-us/library/windows/desktop/ms680360%28v=vs.85%29.aspx to make a memory dump file, then reinflate it, and tweak the PEB and TEB structs to register all the Win32 heaps to the master linked list of heaps. There might also be drama in having to defeat ASLR/C stack buffer overflow sentinal patterns. |
unexec has its own malloc, yes, to be able to access old dumped memory. Parallel to perlcc IO in BEGIN blocks or before the dump opcode may not be replayed. This is a known limitation, and already known from perlcc. open/chdir being the worst. Dynamic modules are correctly loaded with unexec. The corresponding section handles this, e.g. LC_LOAD_DYLIB on darwin. |
solarisworks for simple scripts, because it's trivial there.
accessing argv/argc fails on the empty PL_argvgv symbol while dumping. init_argv_symbols/init_postdump_symbols is uninitialized for -u.
darwin
elf (linux)
|
Run init_postdump_symbols 2x with -u:
|
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
dumps and starts fine, even if we don't record the regions yet. fails in starting at Perl_set_caret_X(), empty gv_fetchpvs() $^X symbol. we need to change the init order, as $^X and some others need to be initialized dynamically, similar to dynaloaded modules. prepared the other sources also, but untested. esp. win32 and solaris. macosx and win32 seem to be the most trickiest. harmonize error message, esp. when failing to create the file, most likely due to a BEGIN { chdir .. }, changed pwd. See #176
sources from emacs, and re-enable -u and dump.
with support for elf, coff, darwin, cygwin, win32/64, hpux, aix, sunos/solaris, dos.
TODO:
See ep. https://lwn.net/Articles/673815/
maybe use a 3rdparty/ptmalloc3 then
ported to emacs with http://www.sodan.org/~knagano/emacs/pdump/
@dl_modules
, and then mmap the rest. the question is how to avoid all the pointer updates for different bases, or if MAP_FIXED can be used. ASLR is a problem here. See https://stackoverflow.com/questions/6446101/how-do-i-choose-a-fixed-address-for-mmapSee
feature/gh176-unexec
The text was updated successfully, but these errors were encountered: