Closed hermanzdosilovic closed 4 years ago
Can you strace it inside the box?
I have run strace
both in the box (isolate --cg -p --run -- /usr/bin/strace /usr/bin/scalac Main.scala
) and outside (strace scalac Main.scala
). You can find coresponding output in the attachment.
Could you try it with strace -f
, please?
Here they are, outputs with strace -f
.
Thanks. For whatever reason, Scala compiler calls ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}
, which is essentially the C function tcsetattr(). You probably left stdin/stdout connected to the parent process's terminal, so the sandboxed compiler runs essentially as a background session of that terminal, so it gets the SIGTTOU
signal when it tries to adjust settings of the terminal.
I think that redirecting stdin from /dev/null
and stdout to a file should fix the problem.
Thank you very much @gollux!
I can now confirm that both compilation and execution works but I need to redirect stdin from /dev/null
:
Compilation:
isolate --cg -p -i /dev/null --run -- /usr/bin/scalac Main.scala
Execution:
isolate --cg -p -i /dev/null --run -- /usr/bin/scala Main
Also, for others who might have the same problem, these also work:
$ echo "" | isolate --cg -p --run -- /usr/bin/scalac Main.scala
$ isolate --cg -p --run -- /usr/bin/scalac Main.scala < /dev/null
Hi,
I am trying to compile a simple Scala hello, world program with isolate.
To install Scala on my Arch Linux PC I used this package. I have also installed isolate from the latest commit at the time of this writing.
Steps to reproduce:
Main.scala
:isolate --cg --init
Main.scala
to box:sudo cp Main.scala /var/local/lib/isolate/0/box/
isolate --cg -p --run -- /usr/bin/scalac -verbose Main.scala
I have added the
-verbose
flag to better understand what is happening with thescalac
.Compilation and execution of the above hello, world program works as expected when I do not use isolate.
From my understanding after seeing the verbose output from
scalac
in both isolate and "native" compilation, they produce the same output but it seems there is some last step(s) thatscalac
needs to do before producing the class files but it does not finish in the case with isolate.Please let me know if you need any more details from my side regarding this issue.
Can you please help me understand what is happening here and how can this be resolved?
Thank you in advance.
Best regards, Herman