Re: How to find the cause of crash?
On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote: I developed a socks5 proxy server with vibe.d. but it crashed after running a few minutes, with the output below: Task terminated with uncaught exception: Operating on closed TCPConnection. Task terminated with uncaught exception: Operating on closed TCPConnection. Task terminated with unhandled exception: ./run: line 3: 4 段错误 (core dumped) ./ezsock the ./run is a simple shell to start ./ezsock. Now , my question is: How to get the position it crashes? Or get the method call stack? Any help is welcome,Thanks in advance!! ./run: line 3: 4 segment error (core dumped) ./ezsock
Re: How to find the cause of crash?
On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote: Now , my question is: How to get the position it crashes? Or get the method call stack? If you are developing under Linux, you can use GDB to debug your D apps, just like any C/C++ program. Make sure you are compiling in debug mode in order to have debug symbols in your binary. Under Windows, there is Mago with VisualD. Please refer to this page for more details on available debuggers : http://wiki.dlang.org/Debuggers If you don't know how to use these debuggers, there is a lot of documentation available on the web :)
Re: How to find the cause of crash?
On Wed, 11 Mar 2015 10:05:39 + zhmt via Digitalmars-d-learn wrote: > I want to know how to locate the position of crashing in dlang? > > for example: there is stack dump in c, exception stack in java, > they could help to locate the root of problems. > D has these too, you just need to compile it in debug mode. If you use dub dont use release build type
Re: How to find the cause of crash?
On Wed, 11 Mar 2015 10:05:39 + zhmt via Digitalmars-d-learn wrote: > I want to know how to locate the position of crashing in dlang? > > for example: there is stack dump in c, exception stack in java, > they could help to locate the root of problems. > D has these too, you just need to compile it in debug mode. If you use dub dont use release build type
Re: How to find the cause of crash?
On Wednesday, 11 March 2015 at 11:09:42 UTC, Daniel Kozák wrote: On Wed, 11 Mar 2015 10:05:39 + zhmt via Digitalmars-d-learn wrote: I want to know how to locate the position of crashing in dlang? for example: there is stack dump in c, exception stack in java, they could help to locate the root of problems. D has these too, you just need to compile it in debug mode. If you use dub dont use release build type Thank you. I compiled it in release mode, I'll try debug mode later.
Re: How to find the cause of crash?
On Wednesday, 11 March 2015 at 10:13:12 UTC, Théo Bueno wrote: On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote: Now , my question is: How to get the position it crashes? Or get the method call stack? If you are developing under Linux, you can use GDB to debug your D apps, just like any C/C++ program. Make sure you are compiling in debug mode in order to have debug symbols in your binary. Under Windows, there is Mago with VisualD. Please refer to this page for more details on available debuggers : http://wiki.dlang.org/Debuggers If you don't know how to use these debuggers, there is a lot of documentation available on the web :) Ok,Thanks. I want to try to compile in debug mode first. I will try GDB later if the debug mode fails.
Re: How to find the cause of crash?
On Wednesday, 11 March 2015 at 10:13:12 UTC, Théo Bueno wrote: On Wednesday, 11 March 2015 at 08:16:17 UTC, zhmt wrote: Now , my question is: How to get the position it crashes? Or get the method call stack? If you are developing under Linux, you can use GDB to debug your D apps, just like any C/C++ program. Make sure you are compiling in debug mode in order to have debug symbols in your binary. Under Windows, there is Mago with VisualD. Please refer to this page for more details on available debuggers : http://wiki.dlang.org/Debuggers If you don't know how to use these debuggers, there is a lot of documentation available on the web :) Thank you very much. I got the call stack by gdb: Program received signal SIGSEGV, Segmentation fault. 0x0077ca11 in vibe.core.drivers.libevent2_tcp.onSocketEvent ( buf_event=0xcd43f8, status=17, arg=0xcd54e0) at ../../../../root/.dub/packages/vibe-d-0.7.22/source/vibe/core/drivers/libevent2_tcp.d:651 Here is the code of libevent2_tcp.d: if (ctx.writeOwner && ctx.writeOwner != ctx.readOwner && ctx.writeOwner.running) { logTrace("resuming corresponding task%s...", ex is null ? "" : " with exception"); if (ctx.writeOwner.fiber.state == Fiber.State.EXEC) ctx.exception = ex; else ctx.core.resumeTask(ctx.writeOwner, ex); //LINE 651 } I dont know what is happening, may I should get help from vibe.d forum.
Re: How to find the cause of crash?
I want to know how to locate the position of crashing in dlang? for example: there is stack dump in c, exception stack in java, they could help to locate the root of problems.