Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Comments

Add file and line info to backtraces under Linux#1354

Merged
MartinNowak merged 3 commits intodlang:masterfrom
yazd:dwarf-debug
Sep 16, 2015
Merged

Add file and line info to backtraces under Linux#1354
MartinNowak merged 3 commits intodlang:masterfrom
yazd:dwarf-debug

Conversation

@yazd
Copy link
Contributor

@yazd yazd commented Aug 21, 2015

This work provides file and line info by reading the DWARF debug section .debug_line and resolving the stacktrace addresses.

Example stacktrace output on exception when program is compiled with -g:

std.format.FormatException@/home/administrator/Projects/d-devel/phobos/std/format.d(487): Orphan format specifier: %s
----------------
/home/administrator/Projects/d-devel/phobos/std/exception.d:589 pure @safe bool std.exception.enforceEx!(std.format.FormatException).enforceEx!(bool).enforceEx(bool, lazy immutable(char)[], immutable(char)[], ulong) [0x4335b7]
/home/administrator/Projects/d-devel/phobos/std/format.d:487 pure @safe uint std.format.formattedWrite!(std.array.Appender!(immutable(char)[]).Appender, char).formattedWrite(std.array.Appender!(immutable(char)[]).Appender, const(char[])) [0x430a09]
/home/administrator/Projects/d-devel/phobos/std/format.d:6548 pure @safe immutable(char)[] std.format.format!(char).format(const(char[])) [0x430473]
foo/bar.d:9 void foo.bar.f1!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f1(int) [0x430412]
foo/bar.d:19 void foo.bar.f2!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f2(int) [0x438c3c]
foo/bar.d:13 void foo.bar.f1!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f1(int) [0x430424]
foo/bar.d:19 void foo.bar.f2!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f2(int) [0x438c3c]
foo/bar.d:13 void foo.bar.f1!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f1(int) [0x430424]
main.d:10 _Dmain [0x4303e5]
??:? _D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv [0x43f12e]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x43f089]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x43f0ea]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate()) [0x43f089]
??:? _d_run_main [0x43f00a]
??:? main [0x43ad87]
??:? __libc_start_main [0x891eca3f]

vs

std.format.FormatException@/usr/include/dmd/phobos/std/format.d(487): Orphan format specifier: %s
----------------
./main(pure @safe uint std.format.formattedWrite!(std.array.Appender!(immutable(char)[]).Appender, char).formattedWrite(std.array.Appender!(immutable(char)[]).Appender, const(char[]))+0x9a) [0x42c302]
./main(pure @safe immutable(char)[] std.format.format!(char).format(const(char[]))+0x34) [0x42bd94]
./main(void foo.bar.f1!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f1(int)+0x23) [0x42bd33]
./main(void foo.bar.f2!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f2(int)+0x15) [0x42f845]
./main(void foo.bar.f1!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f1(int)+0x35) [0x42bd45]
./main(void foo.bar.f2!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f2(int)+0x15) [0x42f845]
./main(void foo.bar.f1!(pure nothrow @nogc @safe int main.main().__lambda1(int)).f1(int)+0x35) [0x42bd45]
./main(_Dmain+0xe) [0x42bd06]
./main(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x1f) [0x435d47]
./main(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x435ca2]
./main(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x2b) [0x435d03]
./main(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x435ca2]
./main(_d_run_main+0x1d2) [0x435c22]
./main(main+0x20) [0x431a48]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f4f61981a40]

-L--export-dynamic linker option is still needed to provide the function names. Otherwise only file and line number are shown.

TODOs:

  • add tests
  • add nothrow and @nogc
  • ???

@complexmath, I added your name in authors field as I copied some code from rt/runtime.d.
@MartinNowak, you were interested in this.

Please review freely and if you see any possible enhancements, I will work on them.

Edit: updated output from stacktrace to (file:line function [addr])

@MartinNowak
Copy link
Member

@MartinNowak MartinNowak self-assigned this Aug 22, 2015
@MartinNowak
Copy link
Member

@nogc

That would be important, stack traces must not use the GC.

@MartinNowak
Copy link
Member

add tests

As simple as adding this here and diffing the output like here.

@MartinNowak
Copy link
Member

[0x432c37] pure @safe bool std.exception.enforceEx!(std.format.FormatException).enforceEx!(bool).enforceEx(bool, lazy immutable(char)[], immutable(char)[], ulong) @ /home/administrator/Projects/d-devel/phobos/std/exception.d:589

I think the order should be file:line function [addr] instead.

/home/administrator/Projects/d-devel/phobos/std/exception.d:589 pure @safe bool std.exception.enforceEx!(std.format.FormatException).enforceEx!(bool).enforceEx(bool, lazy immutable(char)[], immutable(char)[], ulong) [0x432c37]

It would be great to abbreviate the demangled names somehow (@ibuclaw any idea?), but it's not part of this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

char[1024] symbolBuffer = void

@PetarKirov
Copy link
Member

Great! This is a step in the right direction.

I think the order should be file:line function [addr] instead.
...
It would be great to abbreviate the demangled names somehow...

@MartinNowak, to abbreviate the demangled names we can use:

  • eponymous templates if possible (when template and function names match) - there's no ambiguity, so DRY.

And omit:

  • Return type: file + line is enough to remove ambiguity.
  • Function attributes: there's so ambiguity and attributes won't provide any additional info at this point (when the program crashed).
  • Fully qualified function name (full name only for template args): file name is enough, so DRY.
  • Runtime function params (only tempate params): again, file + line is enough to remove ambiguity.
  • Anything before _Dmain, if the exception is not actually in druntime.

With my and your proposed changes it should look something like this:

std.format.FormatException@/home/administrator/Projects/d-devel/phobos/std/format.d(487): Orphan format specifier: %s
----------------
/home/administrator/Projects/d-devel/phobos/std/exception.d:589 enforceEx!(std.format.FormatException, bool)(..) [0x432c37]
/home/administrator/Projects/d-devel/phobos/std/format.d:487 formattedWrite!(std.array.Appender!(immutable(char)[]), char)(..) [0x430089]
/home/administrator/Projects/d-devel/phobos/std/format.d:6548 format!(char)(..) [0x42faf3]
foo/bar.d:9 f1!(main.main().__lambda1(int))(..) [0x42fa92]
foo/bar.d:19 f2!(main.main().__lambda1(int))(..) [0x4382bc]
foo/bar.d:13 f1!(main.main().__lambda1(int))(..) [0x42faa4]
foo/bar.d:19 f2!(main.main().__lambda1(int))(..) [0x4382bc]
foo/bar.d:13 f1!(main.main().__lambda1(int))(..) [0x42faa4]
main.d:10 _Dmain [0x42fa65]

Additionally, we can pretty print the backtrace by:

  • Reversing the order: _Dmain first (at the top) -> throw location last (at the bottom) - so there's no need to scroll.
  • Grouping the functions by package.
  • Omitting the unnecessary .d file extention.
  • Placing the template instantiation arguments after the function name and address.
  • Aligning the function names and addresses in each package.

For example:

in package main (./):
    at main:10 _Dmain(..) [0x42fa65]

in package foo (./foo):
    at bar:13 f1!(..)(..) [0x42faa4] instanciated with: (main().__lambda1(int))
    at bar:19 f2!(..)(..) [0x4382bc] instanciated with: (main().__lambda1(int))
    at bar:13 f1!(..)(..) [0x42faa4] instanciated with: (main().__lambda1(int))
    at bar:19 f2!(..)(..) [0x4382bc] instanciated with: (main().__lambda1(int))
    at bar:9  f1!(..)(..) [0x42fa92] instanciated with: (main().__lambda1(int))

in package std (/home/administrator/Projects/d-devel/phobos/std):
    at format:6548:    format!(..)(..)         [0x42faf3] instanciated with: (char)
    at format:487:     formattedWrite!(..)(..) [0x430089] instanciated with: (std.array.Appender!(immutable(char)[]), char)
    at exception:6548: enforceEx!(..)(..)      [0x432c37] instanciated with: (std.format.FormatException, bool)

-------------------
std.format.FormatException@/usr/include/dmd/phobos/std/format.d(487): Orphan format specifier: %s

I want to work on this (and this is totally outside the scope of this PR), but I won't be able to probably until mid-September. Should I add myself to the trello card?

@yazd
Copy link
Contributor Author

yazd commented Aug 22, 2015

updated

  • changed order to file:line function [addr]
  • added @nogc and nothrow
  • fixed indentation
  • void initialized buffers
  • add tests
  • fix non-linux and 32-bit builds
  • simplify resolveAddresses into resolveAddress

@yazd
Copy link
Contributor Author

yazd commented Aug 22, 2015

I wanted to abbreviate function names but I don't know of a way to do it easily.
@ZombineDev, I agree with all of your suggestions except for the grouping by package. But let's keep this discussion for the next PR.

@MartinNowak
Copy link
Member

Omitting the unnecessary .d file extention.

That one is a false friend. What you want is to hightlight the filename and line number to quickly open that in your editor, e.g. /home/administrator/Projects/d-devel/phobos/std/format.d:6548.

@MartinNowak
Copy link
Member

Grouping by package sounds nice but might not work well in callback heavy code.
Lots of good ideas @ZombineDev.

@ibuclaw
Copy link
Member

ibuclaw commented Aug 23, 2015

It would be great to abbreviate the demangled names somehow

Omit the return type and attributes from the demangle would be a start. Can core.demangle even do that? Not sure about abbreviating templates, but it sounds like could turn into an art form.

@MartinNowak
Copy link
Member

Not sure about abbreviating templates, but it sounds like could turn into an art form.

So be it, but the ideas above already look great, and it's also a useful functionality to have for core.demangle.

@MartinNowak
Copy link
Member

@yazd, do you need help with the tests or anything else?

@yazd
Copy link
Contributor Author

yazd commented Aug 23, 2015

I am good. But I do wonder if I should version out all of the code for the other OS'es.
I will have time to do the tests and all that's remaining tomorrow if not today.

@MartinNowak
Copy link
Member

src/rt/backtrace/elf.d(172): Error: undefined identifier 'Elf32_Ehdr', did you mean alias 'Elf_Ehdr'?

Might want to put a version(linux): at the top of the file. I'll try to follow up with FreeBSD and OSX support.

@yazd
Copy link
Contributor Author

yazd commented Aug 23, 2015

Adding FreeBSD support should be easy as it uses ELF. To support OSX, a Mach-O reader is needed.

@MartinNowak
Copy link
Member

To support OSX, a Mach-O reader is needed.

Ah right, forgot about that detail ;-).

@yazd
Copy link
Contributor Author

yazd commented Aug 24, 2015

I have added a test and I needed to use sed to make the diff not depend on the addresses (is there a problem with depending on sed?). The test works on 64-bit, but not on 32-bit as there seems to be a bug in resolving addresses under 32-bit. I will download a 32-bit distro and test under a VM tomorrow night.

@yazd
Copy link
Contributor Author

yazd commented Aug 25, 2015

Btw, I added @nogc and nothrow to everything but to the opApply implementation due to two reasons:

  • core.demangle.demangle is not @nogc, nothrow.
  • opApply takes a delegate that is not necessarily @nogc and calls it.

The current state is similar to the old one.

@MartinNowak
Copy link
Member

opApply takes a delegate that is not necessarily @nogc and calls it.

Just as a side note, you can overload opApply for different delegates or templatize the function and let the compiler infer @nogc and nothrow.

I will download a 32-bit distro and test under a VM tomorrow night.

You can simply do make MODEL=32 -f posix.mak unittest.

@yazd
Copy link
Contributor Author

yazd commented Aug 25, 2015

All green. Let me squash the commits once the review is done.

@MartinNowak
Copy link
Member

As I have noted in the main post: --export-dynamic is used to get the function name. Currently .debug_line is the only section parsed and it only provides file and line number information. There is another section .debug_info that can provide the function name without --export-dynamic. I guess that will be my next task if it is needed. :P

We already rely on --export-dynamic for our current backtraces so it won't be an issue, but getting away w/o it would be preferred.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to make FIRSTFRAME a template parameter, simply traceHandlerOpApplyImpl!(true)(callstack[FIRSTFRAME .. min(FIRSTFRAME, numframes)], dg); should work as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably use the return value of snprintf instead of searching for the null terminator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@yazd
Copy link
Contributor Author

yazd commented Sep 2, 2015

Updates:

  • use output from snprintf instead of strlen.
  • use externDFunc.

@yazd
Copy link
Contributor Author

yazd commented Sep 2, 2015

And always enabled using backtrace_symbols (instead of having it a compile-time option) so as to use externDFunc.

@yazd
Copy link
Contributor Author

yazd commented Sep 3, 2015

Please do not merge. I have found a bug in resolving the addresses.

@MartinNowak
Copy link
Member

Please do not merge. I have found a bug in resolving the addresses.

OK, the rest LGTM.

@yazd
Copy link
Contributor Author

yazd commented Sep 3, 2015

Fixed bug + all green.

@yazd
Copy link
Contributor Author

yazd commented Sep 11, 2015

Anything left to address?

@MartinNowak
Copy link
Member

Sorry for the delay, been busy with the betas.

@yazd
Copy link
Contributor Author

yazd commented Sep 12, 2015

No problem. Take your time.
The tester failure looks unrelated to this PR and it has happened to different pull requests.

@MartinNowak
Copy link
Member

It's a lot nicer than what we have currently but it's still far from a readable stracktrace.

../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/data/json.d:987 const(pure @safe void function(immutable(char)[])) vibe.data.json.Json.checkType!(immutable(char)[]).checkType [0x7190b5]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/data/json.d:451 vibe.data.json.Json.get!(immutable(char)[]).getinout(@property inout(immutable(char)[]) function()) [0x718f9c]
source/app.d:46 app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]) [0x70c3ba]
/home/dawg/Code/D/DPL/dmd/src/../../phobos/std/algorithm/iteration.d:549 @property app.Track std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult.front() [0x71f753]
/home/dawg/Code/D/DPL/dmd/src/../../phobos/std/algorithm/iteration.d:988 ref std.algorithm.iteration.__T12FilterResultS273app7resolveFAyaZ9__lambda5TS3std9algorithm9iteration100__T9MapResultS56_D3app10resolveURLFHAyaS4vibe4data4json4JsonZS3app5TrackTAHAyaS4vibe4data4json4JsonZ9MapResultZ.FilterResult std.algorithm.iteration.__T12FilterResultS273app7resolveFAyaZ9__lambda5TS3std9algorithm9iteration100__T9MapResultS56_D3app10resolveURLFHAyaS4vibe4data4json4JsonZS3app5TrackTAHAyaS4vibe4data4json4JsonZ9MapResultZ.FilterResult.__ctor(std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult) [0x71fb81]
/home/dawg/Code/D/DPL/dmd/src/../../phobos/std/algorithm/iteration.d:947 std.algorithm.iteration.__T12FilterResultS273app7resolveFAyaZ9__lambda5TS3std9algorithm9iteration100__T9MapResultS56_D3app10resolveURLFHAyaS4vibe4data4json4JsonZS3app5TrackTAHAyaS4vibe4data4json4JsonZ9MapResultZ.FilterResult std.algorithm.iteration.__T6filterS273app7resolveFAyaZ9__lambda5Z.filter!(std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult).filter(std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult) [0x71fb2a]
source/app.d:81 std.typecons.Tuple!(immutable(char)[], app.Track[]).Tuple app.resolve(immutable(char)[]) [0x70cad0]
source/app.d:146 void app.download(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse) [0x70d019]
/home/dawg/Code/D/DPL/dmd/src/../../phobos/std/functional.d-mixin-1198:1209 void std.functional.DelegateFaker!(void function(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)*).DelegateFaker.doIt(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse) [0x7e8c9f]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/http/router.d:270 _D4vibe4http6router9URLRouter13handleRequestMFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZ21__T9__lambda3TmTAAyaZ9__lambda3MFmMAAyaZv [0x79153a]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/http/router.d:653 const(void function(immutable(char)[], scope void delegate(ulong, scope immutable(char)[][]))) vibe.http.router.MatchTree!(vibe.http.router.Route).MatchTree.doMatch [0x792879]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/http/router.d:586 void vibe.http.router.MatchTree!(vibe.http.router.Route).MatchTree.match(immutable(char)[], scope void delegate(ulong, scope immutable(char)[][])) [0x792108]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/http/router.d:263 void vibe.http.router.URLRouter.handleRequest(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse) [0x7912de]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/http/server.d:1711 bool vibe.http.server.handleRequest(vibe.core.stream.Stream, vibe.core.net.TCPConnection, vibe.http.server.HTTPListenInfo, ref vibe.http.server.HTTPServerSettings, ref bool) [0x81ab24]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/http/server.d:1482 void vibe.http.server.handleHTTPConnection(vibe.core.net.TCPConnection, vibe.http.server.HTTPListenInfo) [0x8192de]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/http/server.d:1376 void vibe.http.server.listenHTTPPlain(vibe.http.server.HTTPServerSettings).doListen(vibe.http.server.HTTPListenInfo, bool).__lambda3(vibe.core.net.TCPConnection) [0x818d01]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/core/drivers/libevent2_tcp.d:546 void vibe.core.drivers.libevent2_tcp.ClientTask.execute() [0x7f353a]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/core/core.d:459 void vibe.core.core.makeTaskFuncInfo!(void delegate()).makeTaskFuncInfo(ref void delegate()).callDelegate(vibe.core.core.TaskFuncInfo*) [0x73fa29]
../../../../.dub/packages/vibe-d-0.7.25-rc.1/source/vibe/core/core.d:969 void vibe.core.core.CoreTask.run() [0x73daa8]
??:? void core.thread.Fiber.run() [0x8f6eb9]
??:? fiber_entryPoint [0x8f6d9b]
??:? [0xffffffff]
./app(vibe.data.json.Json.get!(immutable(char)[]).getinout(@property inout(immutable(char)[]) function())+0x59) [0x6ed6b1]
./app(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]])+0x147) [0x6e38ff]
./app(@property app.Track std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult.front()+0x68) [0x6f41a0]
./app(ref std.algorithm.iteration.__T12FilterResultS273app7resolveFAyaZ9__lambda5TS3std9algorithm9iteration100__T9MapResultS56_D3app10resolveURLFHAyaS4vibe4data4json4JsonZS3app5TrackTAHAyaS4vibe4data4json4JsonZ9MapResultZ.FilterResult std.algorithm.iteration.__T12FilterResultS273app7resolveFAyaZ9__lambda5TS3std9algorithm9iteration100__T9MapResultS56_D3app10resolveURLFHAyaS4vibe4data4json4JsonZS3app5TrackTAHAyaS4vibe4data4json4JsonZ9MapResultZ.FilterResult.__ctor(std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult)+0x42) [0x6f45da]
./app(std.algorithm.iteration.__T12FilterResultS273app7resolveFAyaZ9__lambda5TS3std9algorithm9iteration100__T9MapResultS56_D3app10resolveURLFHAyaS4vibe4data4json4JsonZS3app5TrackTAHAyaS4vibe4data4json4JsonZ9MapResultZ.FilterResult std.algorithm.iteration.__T6filterS273app7resolveFAyaZ9__lambda5Z.filter!(std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult).filter(std.algorithm.iteration.MapResult!(app.Track app.resolveURL(vibe.data.json.Json[immutable(char)[]]), vibe.data.json.Json[immutable(char)[]][]).MapResult)+0x53) [0x6f4583]
./app(std.typecons.Tuple!(immutable(char)[], app.Track[]).Tuple app.resolve(immutable(char)[])+0x55b) [0x6e3f8b]
./app(void app.download(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x7e) [0x6e44d6]
./app(void std.functional.DelegateFaker!(void function(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)*).DelegateFaker.doIt(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x64) [0x7c2a40]
./app(_D4vibe4http6router9URLRouter13handleRequestMFC4vibe4http6server17HTTPServerRequestC4vibe4http6server18HTTPServerResponseZ21__T9__lambda3TmTAAyaZ9__lambda3MFmMAAyaZv+0x1fb) [0x76830f]
./app(const(void function(immutable(char)[], scope void delegate(ulong, scope immutable(char)[][]))) vibe.http.router.MatchTree!(vibe.http.router.Route).MatchTree.doMatch+0x196) [0x769686]
./app(void vibe.http.router.MatchTree!(vibe.http.router.Route).MatchTree.match(immutable(char)[], scope void delegate(ulong, scope immutable(char)[][]))+0x93) [0x768eeb]
./app(void vibe.http.router.URLRouter.handleRequest(vibe.http.server.HTTPServerRequest, vibe.http.server.HTTPServerResponse)+0x196) [0x7680aa]
./app(bool vibe.http.server.handleRequest(vibe.core.stream.Stream, vibe.core.net.TCPConnection, vibe.http.server.HTTPListenInfo, ref vibe.http.server.HTTPServerSettings, ref bool)+0x17d9) [0x7f5211]
./app(void vibe.http.server.handleHTTPConnection(vibe.core.net.TCPConnection, vibe.http.server.HTTPListenInfo)+0x1a3) [0x7f3933]
./app(void vibe.http.server.listenHTTPPlain(vibe.http.server.HTTPServerSettings).doListen(vibe.http.server.HTTPListenInfo, bool).__lambda3(vibe.core.net.TCPConnection)+0x36) [0x7f3332]
./app(void vibe.core.drivers.libevent2_tcp.ClientTask.execute()+0x487) [0x7cd85b]
./app(void vibe.core.core.makeTaskFuncInfo!(void delegate()).makeTaskFuncInfo(ref void delegate()).callDelegate(vibe.core.core.TaskFuncInfo*)+0x72) [0x7153a6]
./app(void vibe.core.core.CoreTask.run()+0x129) [0x713359]
./app(void core.thread.Fiber.run()+0x2a) [0x8cc9ca]
./app(fiber_entryPoint+0x61) [0x8cc8b9]

@MartinNowak
Copy link
Member

Works nicely.
The code style is somewhat different than druntime, but that's no problem.
Thanks for the great work Yazan.

MartinNowak added a commit that referenced this pull request Sep 16, 2015
Add file and line info to backtraces under Linux
@MartinNowak MartinNowak merged commit 3050cc7 into dlang:master Sep 16, 2015
MartinNowak added a commit to MartinNowak/druntime that referenced this pull request Sep 16, 2015
@MartinNowak
Copy link
Member

Oh, of course we should mention that in the changelog, see #1387.

9rnsr added a commit that referenced this pull request Sep 17, 2015
fixup #1354 - add changelog entry for backtraces
@yazd
Copy link
Contributor Author

yazd commented Sep 17, 2015

Thanks for the review. I will work on adding FreeBSD support in the next few days.

@MartinNowak
Copy link
Member

Thanks for the review. I will work on adding FreeBSD support in the next few days.

Nice, let me know if you need help.

@yazd
Copy link
Contributor Author

yazd commented Sep 30, 2015

I've just pushed a FreeBSD follow up PR: #1399.

dnadlinger pushed a commit to weka/druntime that referenced this pull request Oct 27, 2015
Add file and line info to backtraces under Linux
dnadlinger pushed a commit to weka/druntime that referenced this pull request Nov 1, 2015
Add file and line info to backtraces under Linux
burner pushed a commit to burner/druntime that referenced this pull request Jan 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants