ceylon / ceylon-runtime

DEPRECATED
24 stars 5 forks source link

ceylon test waits forever and doesn’t do anything #56

Closed lucaswerkmeister closed 10 years ago

lucaswerkmeister commented 10 years ago

When I do a ceylon test test.ceylon.formatter, it prints the “JBoss Modules version” and then doesn’t do anything. No CPU time used at all, it just doesn’t do anything. I let it run for over half an hour and still nothing happened. The last thing that strace shows is

futex(0x7f87964e39d0, FUTEX_WAIT, 6662, NULL

(I assume the missing ) means that the call didn’t return yet?) According to this little program

#include <time.h>
#include <stdio.h>
void main() {
  int i = 6662;
  struct timespec *t = &i;
  printf("%d s %d ns\n", t->tv_sec, t->tv_nsec);
}

a struct timespec (which is the type of futex’ third argument) of 6662 corresponds to “6662 s 32767 ns”, so almost two hours. I might let this run overnight if nothing better comes up :)

To reproduce, the following should work (but untested):

# cd /tmp or something like that
git clone https://github.com/lucaswerkmeister/ceylon.formatter.git
cd ceylon.formatter
ceylon compile --src source-gen source_gen.ceylon.formatter
ceylon run source_gen.ceylon.formatter
ceylon compile ceylon.formatter
ceylon compile --src test-source test.ceylon.formatter

ceylon test test.ceylon.formatter
# OR
strace ceylon test test.ceylon.formatter

I’m on current master of everything; I think it still worked about a week ago.

Is this even the right repository? I don’t even know what could cause this, so I’m not really sure where it belongs. This repository contains the test and test-js tools, so I’m just guessing that it might belong here.

lucaswerkmeister commented 10 years ago

If I ceylon test a minimal module, strace ends like this:

futex(0x7f1d3a38a9d0, FUTEX_WAIT, 7584, NULLNote: JBoss Modules version 1.1.3.GA 
======================== TESTS STARTED =======================
running: tmp::foo
======================== TEST RESULTS ========================
run:     1
success: 1
failure: 0
error:   0
ignored: 0
time:    0s

======================== TESTS SUCCESS =======================
) = 0
exit_group(0)                           = ?
+++ exited with 0 +++

As you can see, the futex call only terminates after ceylon test is done, so that might be something JVM-internal, I don’t know.

lucaswerkmeister commented 10 years ago

Weird. I can remove all actual tests in the test.ceylon.formatter module and it still hangs up… but I have to keep testSamples.ceylon:testFile.

lucaswerkmeister commented 10 years ago

The more code I remove from the testFile function, the longer it takes until the “JBoss Modules version” shows up… what the hell is going on?

lucaswerkmeister commented 10 years ago

Okay, here’s a minimal test case to reproduce:

void f() {
    object w satisfies Writer {
        shared actual void close() {}
        shared actual void flush() {}
        shared actual void write(String string) {}
        shared actual void writeLine(String line) {}
    }
}
lucaswerkmeister commented 10 years ago

I stepped through ceylon test and found the bit that hangs up, and with that was able to reproduce the bug without ceylon test. So I suppose this was the wrong repository… oh well

lucaswerkmeister commented 10 years ago

Re-reported as ceylon/ceylon.language#429… let’s hope that’s the right repository. Closing this one.