Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Aeri reports of the form "NoStackTrace in <function>"

Not sure. Feel free to fix if it helps.

 

At the end of the day, the exception has to be turned into an IStatus in order for it to get logged. All I’ve been doing lately is allowing the log(Throwable) methods to work for CoreException too and take care of managing the IStatus object. I guess if you want the stack for the CoreException you could check if it has it’s own Throwable and if not, wrap it in another Status object.

 

Doug.

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Jonah Graham
Sent: Wednesday, July 5, 2017 4:20 AM
To: CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] Aeri reports of the form "NoStackTrace in <function>"

 

Hi Nate,

 

AFAICT this is happening because we (CDT) are discarding the stack trace.

 

This code is the culprit:

 

            /**

            * @noreference This method is not intended to be referenced by clients.

            */

            public static void log(Throwable e) {

                        if (e instanceof CoreException) {

                                    log(((CoreException) e).getStatus());

                        } else {

                                    String msg = e.getMessage();

                                    if (msg == null) {

                                                log("Error", e); //$NON-NLS-1$

                                    } else {

                                                log("Error: " + msg, e); //$NON-NLS-1$

                                    }

                        }

            }

 

 

We are unwrapping the CoreException and logging only the IStatus object which may not have its own associated exception. 

 

Perhaps Doug can comment, the unwrapping code was added fairly recently (just before Neon / CDT 9.0) in https://git.eclipse.org/r/#/c/71560/3/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/CCorePlugin.java

 

Thanks,

Jonah

 

 


~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com

 

On 5 July 2017 at 06:03, Nathan Ridge <zeratul976@xxxxxxxxxxx> wrote:

Often I come across Aeri problem reports whose titles are of the form "NoStackTrace in <function>". Example: [1]

These reports contain stack traces that point to places in the code where we catch an exception, and log it with "CCorePlugin.log(e)". The stack trace points to the place where we log it; however, the report does not contain the stack trace of where the original exception was thrown (and I assume this is what the "NoStackTrace" in the title refers to).

Is there something we can do in the code, to make the problem reports contain the stack trace of the original exception in such cases? Typically, I can't diagnose or fix the problem without seeing the original exception.

Thanks,
Nate

[1] https://dev.eclipse.org/recommenders/committers/aeri/v2/#!/problems/5951a1d4e4b0bc977c8c41f9
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev

 


Back to the top