Re: catching segfault using try_ catch

2021-07-22 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 15:12:37 UTC, Adam D Ruppe wrote: On Thursday, 22 July 2021 at 14:19:37 UTC, seany wrote: how can I specify this with dub ? Probably easiest to just copy the memoryerror.d file from druntime into your dub source dir. I did copy in subfolder /etc/linux. same as

Re: catching segfault using try_ catch

2021-07-22 Thread Adam D Ruppe via Digitalmars-d-learn
On Thursday, 22 July 2021 at 14:19:37 UTC, seany wrote: how can I specify this with dub ? Probably easiest to just copy the memoryerror.d file from druntime into your dub source dir.

Re: catching segfault using try_ catch

2021-07-22 Thread seany via Digitalmars-d-learn
On Thursday, 22 July 2021 at 14:19:37 UTC, seany wrote: On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote: On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: What will it return to me? true if it succeeded. I want to catch the segfault and a segfault has occured, I want run

Re: catching segfault using try_ catch

2021-07-22 Thread seany via Digitalmars-d-learn
On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote: On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: What will it return to me? true if it succeeded. I want to catch the segfault and a segfault has occured, I want run a different code at that point. You mean transparently

Re: catching segfault using try_ catch

2021-07-14 Thread wjoe via Digitalmars-d-learn
On Wednesday, 14 July 2021 at 00:10:59 UTC, seany wrote: On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote: On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: [...] true if it succeeded. [...] You mean transparently rerun some code? That's better done with the lowlevel

Re: catching segfault using try_ catch

2021-07-13 Thread seany via Digitalmars-d-learn
On Tuesday, 13 July 2021 at 17:49:54 UTC, Adam D Ruppe wrote: On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: [...] true if it succeeded. [...] You mean transparently rerun some code? That's better done with the lowlevel sigaction handler. [...] Thank you. Is there a tutorial

Re: catching segfault using try_ catch

2021-07-13 Thread Adam D Ruppe via Digitalmars-d-learn
On Tuesday, 13 July 2021 at 16:52:43 UTC, seany wrote: What will it return to me? true if it succeeded. I want to catch the segfault and a segfault has occured, I want run a different code at that point. You mean transparently rerun some code? That's better done with the lowlevel

Re: catching segfault using try_ catch

2021-07-13 Thread seany via Digitalmars-d-learn
On Monday, 12 July 2021 at 00:04:05 UTC, Adam D Ruppe wrote: On Sunday, 11 July 2021 at 23:34:38 UTC, seany wrote: Is there an example i can use Thank you. You just call the registerMemoryHandler() function from that module at some point in your main function before doing other work. PS

Re: catching segfault using try_ catch

2021-07-13 Thread seany via Digitalmars-d-learn
On Monday, 12 July 2021 at 00:04:05 UTC, Adam D Ruppe wrote: On Sunday, 11 July 2021 at 23:34:38 UTC, seany wrote: Is there an example i can use Thank you. You just call the registerMemoryHandler() function from that module at some point in your main function before doing other work. OK

Re: catching segfault using try_ catch

2021-07-11 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 11 July 2021 at 23:34:38 UTC, seany wrote: Is there an example i can use Thank you. You just call the registerMemoryHandler() function from that module at some point in your main function before doing other work.

Re: catching segfault using try_ catch

2021-07-11 Thread seany via Digitalmars-d-learn
On Sunday, 11 July 2021 at 21:15:30 UTC, Paul Backus wrote: I know it's possible on Linux using the `etc.linux.memoryerror` module [1]. Not sure about Windows. Linux would be sufficient. Is there an example i can use Thank you.

Re: catching segfault using try_ catch

2021-07-11 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 11 July 2021 at 21:15:30 UTC, Paul Backus wrote: I know it's possible on Linux using the `etc.linux.memoryerror` module [1]. Not sure about Windows. With -m32, it just works. With -m32mscoff I'm not sure. With -m64, as far as I know, there is no way.

Re: catching segfault using try_ catch

2021-07-11 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 11 July 2021 at 20:18:18 UTC, seany wrote: Is it possible to catch a segfault - using try/catch loop? Thank you I know it's possible on Linux using the `etc.linux.memoryerror` module [1]. Not sure about Windows. [1] https://druntime.dpldocs.info/etc.linux.memoryerror.html

catching segfault using try_ catch

2021-07-11 Thread seany via Digitalmars-d-learn
Is it possible to catch a segfault - using try/catch loop? Thank you