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

Java / Boot (Clojure build tool) does not work #277

Closed
seancorfield opened this issue Apr 27, 2016 · 10 comments
Closed

Java / Boot (Clojure build tool) does not work #277

seancorfield opened this issue Apr 27, 2016 · 10 comments

Comments

@seancorfield
Copy link

Per #49 I installed JDK 7u79 manually and java -version works.
After downloading the boot shell script (which is a Java program with a shell prelude) and unning boot -h, it hangs trying to download the base version 2.5.2.
strace -f on the main process yields:

strace: Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature.
Process 479 attached with 3 threads
[pid   484] gettimeofday( <unfinished ...>
[pid   485] sched_yield( <unfinished ...>
[pid   484] <... gettimeofday resumed> {1461732294, 712294}, NULL) = 0
[pid   485] <... sched_yield resumed> ) = 0
[pid   484] rt_sigreturn( <unfinished ...>
[pid   485] sched_yield( <unfinished ...>
[pid   484] <... rt_sigreturn resumed> ) = 4209649592
[pid   485] <... sched_yield resumed> ) = 0
[pid   484] --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0xc} ---
strace: ptrace(PTRACE_SYSCALL,pid:484,sig:11): Invalid argument
Process 479 detached
Process 484 detached
Process 485 detached

The gettimeofday call is not always present if you run the strace multiple times.

@seancorfield
Copy link
Author

FWIW, Leiningen, Clojure's other build tool, gets a little further. It's able to download itself so you can run lein version but lein repl hangs, just like Boot does. If you run lein inside a project with dependencies that need to be fetched, the downloads all fail (both from Maven Central and Clojars) with SocketException errors. Happy to do further debugging and provide any extra details that will help debug these Java problems.

@seancorfield
Copy link
Author

seancorfield commented May 27, 2016

With Build 14352, we get a little further, here's the strace -f from lein repl now:

With build 14352, we get a little further. lein run works. lein repl still hangs. Here's the strace -f from that:

strace: Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature.
Process 72 attached with 19 threads
[pid    78] sched_yield()               = 0
[pid    78] sched_yield()               = 0
[pid    78] sched_yield()               = 0
[pid    78] sched_yield()               = 0
[pid    78] sched_yield()               = 0
[pid    78] sched_yield()               = 0
[pid    86] futex(0x7fff000c7f28, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid    78] sched_yield()               = 0
[pid    86] <... futex resumed> )       = 0
[pid    78] sched_yield( <unfinished ...>
[pid    86] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    78] <... sched_yield resumed> ) = 0
[pid    86] <... clock_gettime resumed> {707, 298165000}) = 0
[pid    78] sched_yield( <unfinished ...>
[pid    86] gettimeofday( <unfinished ...>
[pid    78] <... sched_yield resumed> ) = 0
[pid    86] <... gettimeofday resumed> {1464325897, 583266}, NULL) = 0
[pid    78] sched_yield()               = 0
[pid    86] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    78] sched_yield()               = 0
[pid    86] <... clock_gettime resumed> {707, 300901000}) = 0
[pid    78] sched_yield()               = 0
[pid    86] clock_gettime(CLOCK_MONOTONIC,  <unfinished ...>
[pid    78] sched_yield()               = 0
[pid    86] <... clock_gettime resumed> {707, 303133000}) = 0
[pid    78] sched_yield()               = 0
[pid    86] futex(0x7fff000c7f54, FUTEX_WAIT_BITSET_PRIVATE, 1, {707, 353133000}, ffffffff <unfinished ...>
[pid    78] sched_yield()               = 0
[pid    78] sched_yield()               = 0
[pid    89] rt_sigreturn( <unfinished ...>
[pid    78] sched_yield( <unfinished ...>
[pid    89] <... rt_sigreturn resumed> ) = 0
[pid    78] <... sched_yield resumed> ) = 0
[pid    89] --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0x7fff09660100} ---
strace: ptrace(PTRACE_SYSCALL,pid:89,sig:11): Invalid argument

@seancorfield
Copy link
Author

Boot now gets as far as completing the download of its core JAR but then hangs. Here's the strace -f for that:

[pid   213] rt_sigreturn()              = 11535290
[pid   213] --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0x7fff834e0000} ---
strace: ptrace(PTRACE_SYSCALL,pid:213,sig:11): Invalid argument

(all other processes show "detached").

@leftofnull
Copy link

leftofnull commented Aug 13, 2016

Any traction on this? It would be great to have lein repl working, as well as boot. So far, I've had the same experiences as described above.

@seancorfield
Copy link
Author

We're definitely getting a bit further now -- Boot seems to be able to download dependencies for projects but then fails with:

boot repl
sun.nio.fs.UnixException: Bad file descriptor
at sun.nio.fs.UnixNativeDispatcher.read(Native Method)
at sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:315)
at java.lang.Thread.run(Thread.java:745)

@calvinlfer
Copy link

calvinlfer commented Oct 10, 2016

The same thing happens for SBT (Scala Build Tool) although I'm using Java 8

sun.nio.fs.UnixException: Bad file descriptor
        at sun.nio.fs.UnixNativeDispatcher.read(Native Method)
        at sun.nio.fs.LinuxWatchService$Poller.run(LinuxWatchService.java:318)
        at java.lang.Thread.run(Thread.java:745)

@seancorfield
Copy link
Author

Based on my latest tests on build 14946, with both OpenJDK 7 and Oracle Java 8, I think this issue can be closed since everything I've tried with Boot now works as expected. I'm able to run all sorts of very complex Boot tasks, compiling and testing Clojure code. I haven't fully exercised all our code base (some 40Kloc of Clojure) yet but that's mostly because I'll need Redis, MongoDB, MySQL and several other things installed to run everything.

@seancorfield
Copy link
Author

I'm happy to close my issue as "fixed" now. Thank you. #911 is a different issue (that also affects some of our actual code, as well as some of our other tooling).

@metasoarous
Copy link

@seancorfield @calvinlfer Sorry for commenting on an old thread, but while I'm able to build most Leiningen projects without any issue (and in general work with Clojure code), I'm not able to run figwheel. The problem seems to be the file watcher, as I get the same Bad file descriptor language you both get. Were you able to resolve that issue specifically? Or should I open up a separate issue?

@calvinlfer
Copy link

@metasoarous I think that looks like it should be filed as a separate issue

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

No branches or pull requests

4 participants