From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Denis Vlasenko <vda@ilport.com.ua>
Subject: Re: Compiling C++ modules
Date: Thu, 27 Apr 2006 18:03:08 -0600 [thread overview]
Message-ID: <44515BBC.4070304@shaw.ca> (raw)
In-Reply-To: <66grR-2DK-27@gated-at.bofh.it>
Denis Vlasenko wrote:
>> Additionally, C++ guarantees that if an exception is thrown after
>> spin_lock() is called, then the spin_unlock() will also be called.
>> That's an interesting mechanism by itself.
>
> Life gets even more interesting when you hit another exception
> inside destructor(s) being executed due to first one.
> Say, spin_unlock() discovers that lock is already unlocked
> and does "throw BUG_double_unlock".
You're not allowed to throw exceptions from inside the stack unwinding
caused by another exception, terminate() gets called in this case. In
most cases this isn't too hard to avoid, you just have to ensure that
exceptions don't get thrown out of destructors. Your example isn't very
good, why would you throw an exception in that case? The caller isn't
going to be able to do anything useful with it since it's because of a
coding bug, some kind of assert or BUG() would be more logical.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2006-04-28 0:04 UTC|newest]
Thread overview: 106+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <65eLE-GJ-21@gated-at.bofh.it>
[not found] ` <65zwH-61W-51@gated-at.bofh.it>
[not found] ` <65zZH-6Bw-23@gated-at.bofh.it>
[not found] ` <66grR-2DK-27@gated-at.bofh.it>
2006-04-28 0:03 ` Robert Hancock [this message]
2006-05-02 18:21 Compiling C++ modules Al Boldi
2006-05-02 20:28 ` J.A. Magallon
2006-05-02 23:55 ` Peter Williams
2006-05-03 8:09 ` Steven Rostedt
-- strict thread matches above, loose matches on Subject: below --
2006-04-28 9:37 Khushil Dep
2006-04-24 19:16 Gary Poppitz
2006-04-24 19:27 ` Greg KH
2006-04-24 19:30 ` Al Viro
2006-04-24 19:40 ` linux-os (Dick Johnson)
2006-04-24 20:54 ` Geert Uytterhoeven
2006-04-24 19:42 ` Alexey Dobriyan
2006-04-24 20:30 ` Daniel Barkalow
2006-04-24 20:45 ` Alan Cox
2006-04-24 21:03 ` Avi Kivity
2006-04-24 21:23 ` Joshua Hudson
2006-04-24 21:29 ` Kyle Moffett
2006-04-24 21:50 ` marty fouts
2006-04-24 22:09 ` Martin Mares
2006-04-24 22:30 ` Willy Tarreau
2006-04-24 22:32 ` Joshua Hudson
2006-04-24 22:45 ` marty fouts
2006-04-25 15:32 ` Michael Buesch
2006-04-25 7:08 ` Avi Kivity
2006-04-25 10:23 ` James Courtier-Dutton
2006-04-25 15:59 ` Kyle Moffett
2006-04-25 16:46 ` Avi Kivity
2006-04-25 17:10 ` Dmitry Torokhov
2006-04-25 17:19 ` Avi Kivity
2006-04-25 17:28 ` Dmitry Torokhov
2006-04-25 17:53 ` Avi Kivity
2006-04-25 18:04 ` Dmitry Torokhov
2006-04-25 18:08 ` Valdis.Kletnieks
2006-04-25 18:26 ` Avi Kivity
2006-04-25 18:38 ` Avi Kivity
2006-04-25 18:52 ` Michael Poole
2006-04-25 19:13 ` Avi Kivity
2006-04-27 15:10 ` Denis Vlasenko
2006-04-27 20:15 ` Willy Tarreau
2006-04-27 21:08 ` Davi Arnaut
2006-04-28 9:33 ` Avi Kivity
2006-04-28 10:03 ` Avi Kivity
2006-04-28 11:27 ` Sergei Organov
2006-04-28 11:03 ` Martin Mares
2006-04-28 11:30 ` Avi Kivity
2006-04-28 15:56 ` Jan Engelhardt
2006-04-28 17:02 ` Avi Kivity
2006-04-28 17:38 ` linux-os (Dick Johnson)
2006-04-29 2:50 ` Christer Weinigel
2006-05-01 17:46 ` Dave Neuer
2006-05-01 20:21 ` Jan Engelhardt
2006-05-01 23:53 ` David Schwartz
2006-05-02 5:12 ` Willy Tarreau
2006-05-02 10:32 ` Avi Kivity
2006-05-02 11:15 ` Martin Mares
2006-05-02 11:26 ` Avi Kivity
2006-05-02 11:40 ` linux-os (Dick Johnson)
2006-05-02 12:42 ` David Woodhouse
2006-05-02 16:27 ` Christer Weinigel
2006-05-02 12:48 ` Martin Mares
2006-05-02 13:52 ` Avi Kivity
2006-05-02 14:13 ` Al Viro
2006-05-02 14:54 ` Avi Kivity
2006-05-02 16:16 ` Brian Beattie
2006-05-02 16:21 ` Avi Kivity
2006-05-02 13:21 ` Willy Tarreau
2006-05-02 14:41 ` Avi Kivity
2006-05-02 22:25 ` Diego Calleja
2006-05-02 13:34 ` Al Viro
2006-05-02 14:02 ` Avi Kivity
2006-05-02 14:34 ` Al Viro
2006-05-02 15:04 ` Avi Kivity
2006-05-02 15:15 ` Al Viro
2006-05-02 15:19 ` Avi Kivity
2006-05-02 15:27 ` Kyle Moffett
2006-05-02 15:30 ` Avi Kivity
2006-05-02 15:28 ` Al Viro
2006-05-02 15:51 ` Avi Kivity
2006-05-02 15:24 ` Kyle Moffett
2006-05-03 13:13 ` Mark Lord
2006-05-03 20:51 ` David Schwartz
2006-04-30 21:15 ` Eric W. Biederman
2006-04-25 17:54 ` linux-os (Dick Johnson)
2006-04-26 8:30 ` Jan Engelhardt
2006-04-26 11:36 ` linux-os (Dick Johnson)
2006-04-25 19:22 ` Kyle Moffett
2006-04-25 19:54 ` Michael Buesch
2006-04-25 20:24 ` Avi Kivity
2006-04-25 20:11 ` Bongani Hlope
2006-04-25 20:26 ` Avi Kivity
2006-04-25 21:02 ` Valdis.Kletnieks
2006-04-25 21:15 ` Avi Kivity
[not found] ` <71a0d6ff0604251646g4fc90b3dr30a03b8606360e7f@mail.gmail.com>
2006-04-26 4:39 ` Avi Kivity
2006-04-25 17:55 ` Geert Uytterhoeven
2006-04-24 21:58 ` Alan Cox
2006-04-25 7:20 ` Avi Kivity
2006-04-25 9:06 ` Matt Keenan
2006-04-25 20:29 ` Bongani Hlope
2006-04-25 20:37 ` Avi Kivity
2006-04-25 21:08 ` Bongani Hlope
2006-04-25 4:17 ` Martin J. Bligh
2006-04-25 5:30 ` Avi Kivity
2006-04-25 8:58 ` Sam Ravnborg
2006-04-25 7:56 ` Jakob Oestergaard
2006-04-25 9:03 ` Jan Engelhardt
2006-04-24 21:36 ` J.A. Magallon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44515BBC.4070304@shaw.ca \
--to=hancockr@shaw.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=vda@ilport.com.ua \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox