On Wednesday, 22 May 2019 at 16:37:36 UTC, Lobachevsky wrote:
I have been experimenting with setjmp / longjmp under Windows
as a way to break out of an endless loop. With my experiments,
longjmp appears to silently exit the process, no stack trace,
nothing. Black emptiness.
I don't think
I have been experimenting with setjmp / longjmp under Windows as
a way to break out of an endless loop. With my experiments,
longjmp appears to silently exit the process, no stack trace,
nothing. Black emptiness.
I stared with the C program described in
https://docs.microsoft.com/en-us
On Thursday, 20 September 2018 at 12:11:55 UTC, SrMordred wrote:
Ok, after a better look at the sources I finally got it:
setjmp is a macro.
the true function signature is "int _setjmp(jmp_buf, void*)"
the void* is the current function address which in mingw
sources are capture by
Ok, after a better look at the sources I finally got it:
setjmp is a macro.
the true function signature is "int _setjmp(jmp_buf, void*)"
the void* is the current function address which in mingw sources
are capture by "__builtin_frame_address(0)".
And I did´t look yet to see if Dlang have an
Note: setjmp/longjmp should only be used in "@system +
@nogc + nothrow / -betterC" code.
g++ and clang give me sizeof = 256. dmc give me 64. I tried all
this sizes and other, but still crashes.
any windows machines so had to use these references
(and could not test anything):
- WinSDK10: goo.gl/m9DjZt
- MARS: goo.gl/Qoc6g2
Code above does not yet cover the Mars case, but the i386 sizes
should be the same.
Please Note: setjmp/longjmp should only be used in "@system +
@nogc + no
.
I find the alternatives of setjmp/longjmp and sigaction, but
none are avaliable on windows afaik.
setjmp/longjmp are available on windows (image loaders using
libpng, lua, quake3, and lots of old C code make use of them):
https://msdn.microsoft.com/en-us/library/xe7acxfb.aspx?f=255=-2147217396
On Tuesday, 18 September 2018 at 20:01:48 UTC, SrMordred wrote:
longjmp is crashing so may be related to the struct declaration.
Well just found a thread of the same problem, just that in my
case with 64x crashes too.
https://forum.dlang.org/post/mmxwhdypncaeikknl...@forum.dlang.org
longjmp is crashing so may be related to the struct declaration.
On Tuesday, 18 September 2018 at 03:09:18 UTC, Mike Parker wrote:
On Tuesday, 18 September 2018 at 00:24:23 UTC, SrMordred wrote:
Yes, i'm using signal(SIGSEGV, sigfn_t func), it catches
correctly, but end the execution after.
I find the alternatives of setjmp/longjmp and sigaction
On Tuesday, 18 September 2018 at 00:24:23 UTC, SrMordred wrote:
Yes, i'm using signal(SIGSEGV, sigfn_t func), it catches
correctly, but end the execution after.
I find the alternatives of setjmp/longjmp and sigaction, but
none are avaliable on windows afaik.
setjmp/longjmp are available
)
To catch the signal
With a handler signature of:
enum void function(int) nothrow @nogc @system SIG_ERR;
[...]
Yes, i'm using signal(SIGSEGV, sigfn_t func), it catches
correctly, but end the execution after.
I find the alternatives of setjmp/longjmp and sigaction, but
none are avaliable
function(int) nothrow @nogc @system SIG_ERR;
[...]
Yes, i'm using signal(SIGSEGV, sigfn_t func), it catches
correctly, but end the execution after.
I find the alternatives of setjmp/longjmp and sigaction, but none
are avaliable on windows afaik.
On Monday, 17 September 2018 at 23:44:41 UTC, SrMordred wrote:
Its possible to use setjmp/longjmp on windows?
Or, to be straight to my problem: its possible to continue
execution after a SIGSEGV(or any other failure/signal) with
betterC and windows?
You can use core.stdc.signal
nothrow @nogc
Its possible to use setjmp/longjmp on windows?
Or, to be straight to my problem: its possible to continue
execution after a SIGSEGV(or any other failure/signal) with
betterC and windows?
On 27/04/2015 10:41, ketmar wrote:
snip
i believe this has something to do with exception frames. but it needs
further investigation.
What is an exception frame, exactly?
Moreover, are these frames applicable even in sections of code where no throwing or
catching of exceptions takes place?
are unpredictable.
tldr; don't use setjmp/longjmp in the language with exceptions, unless
you can describe it's runtime internals and exception handling down to
assembler code when you're awaken at night completely drunk. ;-)
signature.asc
Description: PGP signature
On Sun, 26 Apr 2015 21:45:41 +0100, Stewart Gordon wrote:
On 26/04/2015 06:56, ketmar wrote:
snip
you shouldn't use setjmp/longjmp in D. use exceptions instead.
something like this:
snip
True in the general case. Still, there must be some reason that trying
it in D causes an AV (even
.
estoutentando manupular the setjmp / longjmp buffers , but the
error , I
use windows 7 and the dmd 2067 , will be whose manipulate the
buffers
save and return ? Excuse my english sucks.
you shouldn't use setjmp/longjmp in D. use exceptions instead.
something
like this:
instead of setjmp:
try
On Sat, 25 Apr 2015 23:25:13 +, Cassio Butrico wrote:
Hello everyone , first congratulations for the wonderful forum , I wish
someone could help me , I am writing a small basic interpreter in D and
I am with some difficulties.
estoutentando manupular the setjmp / longjmp buffers
On 26/04/2015 06:56, ketmar wrote:
snip
you shouldn't use setjmp/longjmp in D. use exceptions instead. something
like this:
snip
True in the general case. Still, there must be some reason that trying it in D causes an
AV (even if I disable the GC). I remain curious about what that reason
I'm just building a small interpreter with a script and wanted to
handle errors diverting the flow and returning .
I am grateful for having responded my question , thank you.
Hello everyone , first congratulations for the wonderful forum ,
I wish someone could help me , I am writing a small basic
interpreter in D and I am with some difficulties.
estoutentando manupular the setjmp / longjmp buffers , but the
error , I use windows 7 and the dmd 2067 , will be whose
23 matches
Mail list logo