Code Monkey home page Code Monkey logo

Comments (9)

bblackham avatar bblackham commented on July 23, 2024 1

Some libc code now expects the stack to be 16-byte aligned (to use movaps instruction). The way in which the child process is spawned doesn't adhere to this. Here's a quick fix:

--- a/isolate.c
+++ b/isolate.c
@@ -814,7 +814,7 @@ run(char **argv)

   proxy_pid = clone(
     box_proxy,                 // Function to execute as the body of the new process
-    argv,                      // Pass our stack
+    (void*)((uintptr_t)argv & ~15),                    // Pass our stack, aligned to 16-bytes.
     SIGCHLD | CLONE_NEWIPC | (share_net ? 0 : CLONE_NEWNET) | CLONE_NEWNS | CLONE_NEWPID,
     argv);                     // Pass the arguments
   if (proxy_pid < 0)

@gollux: do you have any better suggestions?

from isolate.

seirl avatar seirl commented on July 23, 2024

Maybe this has to do with #42 and #43 ?

What's your kernel version?

from isolate.

t-lenz avatar t-lenz commented on July 23, 2024

It's 4.18.0-10-generic.

from isolate.

pehrsoderman avatar pehrsoderman commented on July 23, 2024

I seem to have encountered the same problem on Ubuntu 18.10 with a 4.18.0-13-generic Kernel. Any recommendations for how to work around it?

from isolate.

pehrsoderman avatar pehrsoderman commented on July 23, 2024

Some additional information:

I get the following message in the syslog:

2019-01-02T21:48:00.633297+01:00 pehrs kernel: [896241.606886] traps: isolate[1622] general protection ip:7ffff7c52cdd sp:7fffffffd9f8 error:0 in libc-2.28.so[7ffff7be5000+171000]

Also attaching a systrace from running isolate, which might help.
strace.log

The strace was generated running the following commands:

pehrs@pehrs:~$ sudo /usr/local/bin/isolate --box-id=0 --cg --cg-timing --processes=128 --env=HOME=/ --env=PATH --env=LANG --dir=/usr= --dir=/usr/lib/ --dir=/etc/alternatives/ --dir=/usr/bin/ --dir=/usr/include/ --dir=/usr/local/lib/ --dir=/usr/share/pyshared/ --env=PYTHONDONTWRITEBYTECODE=1 --env=PYTHONIOENCODING=UTF-8 --dir=/src=/var/lib/kattis/run/subs/comp_158309_206449/compile:rw:noexec --quota=40960,40960  --init
/var/local/lib/isolate/0
pehrs@pehrs:~$ sudo strace /usr/local/bin/isolate --box-id=0 --cg --cg-timing --processes=128 --env=HOME=/ --env=PATH --env=LANG --dir=/usr= --dir=/usr/lib/ --dir=/etc/alternatives/ --dir=/usr/bin/ --dir=/usr/include/ --dir=/usr/local/lib/ --dir=/usr/share/pyshared/ --env=PYTHONDONTWRITEBYTECODE=1 --env=PYTHONIOENCODING=UTF-8 --dir=/src=/var/lib/kattis/run/subs/comp_158309_206449/compile:rw:noexec --stderr=/src/__stderr --meta=/var/lib/kattis/run/subs/comp_158309_206449/compile.meta_file --chdir=/src --time=60 --wall-time=120 --cg-mem=1048580 --run -- /usr/bin/python2 -m py_compile ./hello.py 2> strace.log

from isolate.

pehrsoderman avatar pehrsoderman commented on July 23, 2024

Here is a core dump also:

core.isolate.tar.gz

I am not sure how helpful it is:

pehrs@pehrs:/tmp$ gdb /usr/local/bin/isolate core.2.isolate
GNU gdb (Ubuntu 8.2-0ubuntu1) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/bin/isolate...(no debugging symbols found)...done.
[New LWP 2]
Core was generated by `/usr/local/bin/isolate --box-id=0 --cg --cg-timing --processes=128 --env=HOME=/'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007ffff7c52cdd in _IO_str_init_static_internal (sf=sf@entry=0x7fffffffda28, ptr=ptr@entry=0x7fffffffdce8 "", size=size@entry=1023, 
    pstart=pstart@entry=0x7fffffffdce8 "") at strops.c:41
41	strops.c: No such file or directory.
(gdb) 

from isolate.

pehrsoderman avatar pehrsoderman commented on July 23, 2024

@seirl @gollux Could you offer any advice on this?

from isolate.

pehrsoderman avatar pehrsoderman commented on July 23, 2024

I have tested the patch above, and it seems to solve the issue I was having.

from isolate.

gollux avatar gollux commented on July 23, 2024

from isolate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.