Date: Thu, 9 Jan 2003 10:51:13 -0800 (PST) From: Julian Elischer <julian@elischer.org> To: Pawel Jakub Dawidek <P.Dawidek@prioris.mini.pw.edu.pl> Cc: freebsd-hackers@freebsd.org Subject: Re: Exceptions via setjmp/longjmp in kernel. Message-ID: <Pine.BSF.4.21.0301091050310.34227-100000@InterJet.elischer.org> In-Reply-To: <20030109143059.GC47263@prioris.mini.pw.edu.pl>
index | next in thread | previous in thread | raw e-mail
how do you ensure that the thread doesn't own any locks when it does the
longjmp?
On Thu, 9 Jan 2003, Pawel Jakub Dawidek wrote:
> Hello hackers...
>
> I got strange problem when trying to implement something like exceptions
> with setjmp()/longjmp() functions.
>
> [...]
> int ret;
> jmpbuf buf;
> [...]
> ret = setjmp(buf);
> KASSERT(ret != 1, ("I never return 1 with longjmp()."));
> [...]
> longjmp(buf, value_diffrent_than_1);
> [...]
>
> And setjmp() returns only 0 or 1 (when longjmp() is called), but never
> returns value that I've put in longjmp() call.
>
> There could be some other problems in using setjmp()/longjmp()
> in kernel? I'm paying attention on memory leaks and locks that are
> done before longjmp().
>
> --
> Pawel Jakub Dawidek
> UNIX Systems Administrator
> http://garage.freebsd.pl
> Am I Evil? Yes, I Am.
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0301091050310.34227-100000>
