8041772: (ch) PendingFuture.CANCELLED has backtrace that potentially keeps objects alive

Zhong Yu zhong.j.yu at gmail.com
Thu May 1 00:50:14 UTC 2014


On Wed, Apr 30, 2014 at 1:34 PM, Florian Weimer <fweimer at redhat.com> wrote:
> On 04/30/2014 09:28 AM, Alan Bateman wrote:
>>
>> On 29/04/2014 22:47, Zhong Yu wrote:
>>>
>>> This would change the stacktrace the application sees; does it matter?
>>>
>> It's a good question and could be confusing to have get throw
>> CancellationException with the stack trace of the thread that called
>> cancel. So I think we'll leave this as it was.
>
>
> Would it make sense to call setStackTrace(new StackTraceElement[0]) on the

It doesn't clear `Throwable.backtrace` (should it though?) so it won't
solve the problem.

Calling constructor Throwable(x,x,x, writableStackTrace=false) seems working.

> marker exception?  The class retention issue looks it could cause problems
> in some cases.
>
> --
> Florian Weimer / Red Hat Product Security Team


More information about the nio-dev mailing list