RejectedSoftware Forums

Sign up

Line numbers missing on linux stacktraces

Hi,

Currently I cannot have the line numbers in stack traces when I get an error.
For example, I got this in the error log of our application in our production environment:

[D4B33F90:C0C2EF90 2015.08.12 09:55:35.538 CRITICAL] Task terminated with uncaught exception: Cannot convert NULL to scalar

I have no idea where this happened.

In this example below, I have the line of where the problem happened, but I have no line numbers in the rest of the stack trace:

[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] vibe.http.common.HTTPStatusException@webserver/src/router.d(870): Internal Server Error
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] ----------------
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/gittree/www/www(void context.DefaultHandlerProxy!(void router.handleAll(ref context.DefaultRequestContext, vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse, ebs.session.UserSession), 0).DefaultHandlerProxy(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x96) [0x7d79de]
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/git
tree/www/www(void std.functional.DelegateFaker!(void function(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)*).DelegateFaker.doIt(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x36) [0x94946a]
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/gittree/www/www(D4vibe4http6router9URLRouter13handleRequestMFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZ21T9lambda3TmTAAyaZ9__lambda3MFmMAAyaZv+0x1c8) [0x90d28c]
(... the stack trace continues, but you get the picture)

This severely affects my capacity to debug problems.
Am I the only one having this problem?

Thanks a lot,
Mario

Re: Line numbers missing on linux stacktraces

On Wed, 12 Aug 2015 11:28:31 GMT, Mario wrote:

Hi,

Currently I cannot have the line numbers in stack traces when I get an error.
For example, I got this in the error log of our application in our production environment:

[D4B33F90:C0C2EF90 2015.08.12 09:55:35.538 CRITICAL] Task terminated with uncaught exception: Cannot convert NULL to scalar

I have no idea where this happened.

In this example below, I have the line of where the problem happened, but I have no line numbers in the rest of the stack trace:

[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] vibe.http.common.HTTPStatusException@webserver/src/router.d(870): Internal Server Error
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] ----------------
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/gittree/www/www(void context.DefaultHandlerProxy!(void router.handleAll(ref context.DefaultRequestContext, vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse, ebs.session.UserSession), 0).DefaultHandlerProxy(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x96) [0x7d79de]
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/git
tree/www/www(void std.functional.DelegateFaker!(void function(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)*).DelegateFaker.doIt(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x36) [0x94946a]
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/gittree/www/www(D4vibe4http6router9URLRouter13handleRequestMFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZ21T9lambda3TmTAAyaZ9__lambda3MFmMAAyaZv+0x1c8) [0x90d28c]
(... the stack trace continues, but you get the picture)

This severely affects my capacity to debug problems.
Am I the only one having this problem?

Thanks a lot,
Mario

Yes, I've also had this problem when debugging. I used addr2line to correctly find the line number

e.g.

[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/git_tree/www/www(void context.DefaultHandlerProxy!(void router.handleAll(ref context.DefaultRequestContext, vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse, ebs.session.UserSession), 0).DefaultHandlerProxy(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x96) [0x7d79de]

addr2line -e ./myexe 0x7d79de

or you can use gdb: info symbol 0x7d79de

Obviously inconvenient compared to windows builds. In windbg (x64) you can get a full stack trace with locals and line info right in the debugger when you're attached.

Re: Line numbers missing on linux stacktraces

Hi Etienne,

Ok, thanks a lot for your reply.

Mario

On Wed, 12 Aug 2015 16:56:04 GMT, Etienne Cimon wrote:

On Wed, 12 Aug 2015 11:28:31 GMT, Mario wrote:

Hi,

Currently I cannot have the line numbers in stack traces when I get an error.
For example, I got this in the error log of our application in our production environment:

[D4B33F90:C0C2EF90 2015.08.12 09:55:35.538 CRITICAL] Task terminated with uncaught exception: Cannot convert NULL to scalar

I have no idea where this happened.

In this example below, I have the line of where the problem happened, but I have no line numbers in the rest of the stack trace:

[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] vibe.http.common.HTTPStatusException@webserver/src/router.d(870): Internal Server Error
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] ----------------
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/gittree/www/www(void context.DefaultHandlerProxy!(void router.handleAll(ref context.DefaultRequestContext, vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse, ebs.session.UserSession), 0).DefaultHandlerProxy(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x96) [0x7d79de]
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/git
tree/www/www(void std.functional.DelegateFaker!(void function(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)*).DelegateFaker.doIt(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x36) [0x94946a]
[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/gittree/www/www(D4vibe4http6router9URLRouter13handleRequestMFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZ21T9lambda3TmTAAyaZ9__lambda3MFmMAAyaZv+0x1c8) [0x90d28c]
(... the stack trace continues, but you get the picture)

This severely affects my capacity to debug problems.
Am I the only one having this problem?

Thanks a lot,
Mario

Yes, I've also had this problem when debugging. I used addr2line to correctly find the line number

e.g.

[75A2AF9C:75AAE79C 2015.08.12 08:38:42.376 WRN] /home/msilva/git_tree/www/www(void context.DefaultHandlerProxy!(void router.handleAll(ref context.DefaultRequestContext, vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse, ebs.session.UserSession), 0).DefaultHandlerProxy(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x96) [0x7d79de]

addr2line -e ./myexe 0x7d79de

or you can use gdb: info symbol 0x7d79de

Obviously inconvenient compared to windows builds. In windbg (x64) you can get a full stack trace with locals and line info right in the debugger when you're attached.