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

printStackTrace throws NullPointerException #68

Closed
aaronc opened this issue Oct 31, 2014 · 4 comments
Closed

printStackTrace throws NullPointerException #68

aaronc opened this issue Oct 31, 2014 · 4 comments

Comments

@aaronc
Copy link
Contributor

aaronc commented Oct 31, 2014

In my console output I see the following stack trace:

WARNING: fiber Fiber@10000003[task: ParkableForkJoinTask@471b2af9(Fiber@10000003), target: co.paralleluniverse.pulsar.ClojureHelper$3@404ca753, scheduler: co.paralleluniverse.fibers.FiberForkJoinScheduler@60ea09a3] is hogging the CPU or blocking a thread.
No stack trace
FiberTimedScheduler terminated!
java.lang.NullPointerException
    at co.paralleluniverse.strands.Strand.printStackTrace(Strand.java:877)
    at co.paralleluniverse.fibers.FiberTimedScheduler.reportProblemFibers(FiberTimedScheduler.java:458)
    at co.paralleluniverse.fibers.FiberTimedScheduler.work(FiberTimedScheduler.java:140)
    at co.paralleluniverse.fibers.FiberTimedScheduler.access$000(FiberTimedScheduler.java:45)
    at co.paralleluniverse.fibers.FiberTimedScheduler$1.run(FiberTimedScheduler.java:81)
    at java.lang.Thread.run(Thread.java:745)

Looking at Strand.printStackTrace, I see that it's written as:

    public static void printStackTrace(StackTraceElement[] trace, java.io.PrintStream out) {
        if (trace == null)
            out.println("No stack trace");
        for (StackTraceElement traceElement : trace)
            out.println("\tat " + traceElement);
    }

There is a missing else before the for loop. Even when there is no stack trace, it is still trying to print one out.

@aaronc
Copy link
Contributor Author

aaronc commented Oct 31, 2014

I've created a pull request to fix this: #69

I should mention that I consider this issue to be critical because it results in the FiberTimedScheduler being terminated which causes other fibers to be rejected (I get RejectedExecutionException's) later down the pipeline. This breaks my whole program.

@pron pron closed this as completed Nov 2, 2014
@aaronc
Copy link
Contributor Author

aaronc commented Nov 4, 2014

Any chance of getting 0.6.2-SNAPSHOT in sonatype snapshots with this commit?

@pron
Copy link
Contributor

pron commented Nov 4, 2014

Done.

@aaronc
Copy link
Contributor Author

aaronc commented Nov 5, 2014

Thanks!

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

2 participants