| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
April 22, 2014 Throw exception on segmentation fault in GNU/Linux | ||||
|---|---|---|---|---|
| ||||
What should I add in the D program in GNU/Linux to throw exception if I have segmentation fault error? I read somewhere that it's possible, but I don't know how to do it. | ||||
April 22, 2014 Re: Throw exception on segmentation fault in GNU/Linux | ||||
|---|---|---|---|---|
| ||||
Posted in reply to ilya-stromberg | You should write and register a signal handler. Implementation for x86-32 was posted here. | |||
April 22, 2014 Re: Throw exception on segmentation fault in GNU/Linux | ||||
|---|---|---|---|---|
| ||||
Posted in reply to ilya-stromberg | On Tuesday, 22 April 2014 at 09:58:45 UTC, ilya-stromberg wrote:
> What should I add in the D program in GNU/Linux to throw exception if I have segmentation fault error? I read somewhere that it's possible, but I don't know how to do it.
etc.linux.memoryerror
Just remember that it is more of hack than reliable production-ready solution ;)
| |||
April 22, 2014 Re: Throw exception on segmentation fault in GNU/Linux | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Dicebot | On Tuesday, 22 April 2014 at 14:49:58 UTC, Dicebot wrote:
> On Tuesday, 22 April 2014 at 09:58:45 UTC, ilya-stromberg wrote:
>> What should I add in the D program in GNU/Linux to throw exception if I have segmentation fault error? I read somewhere that it's possible, but I don't know how to do it.
>
> etc.linux.memoryerror
>
> Just remember that it is more of hack than reliable production-ready solution ;)
Thanks. How shall I use the module? Should I just import it or call any init function?
| |||
April 22, 2014 Re: Throw exception on segmentation fault in GNU/Linux | ||||
|---|---|---|---|---|
| ||||
Posted in reply to ilya-stromberg | On Tuesday, 22 April 2014 at 15:47:37 UTC, ilya-stromberg wrote:
> On Tuesday, 22 April 2014 at 14:49:58 UTC, Dicebot wrote:
>> On Tuesday, 22 April 2014 at 09:58:45 UTC, ilya-stromberg wrote:
>>> What should I add in the D program in GNU/Linux to throw exception if I have segmentation fault error? I read somewhere that it's possible, but I don't know how to do it.
>>
>> etc.linux.memoryerror
>>
>> Just remember that it is more of hack than reliable production-ready solution ;)
>
> Thanks. How shall I use the module? Should I just import it or call any init function?
AFAIR it is just matter of calling registerMemoryErrorHandler() and deregisterMemoryErrorHandler() - this module doesn't even have any other public functions / methods.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply