Re: [Flightgear-devel] RenderTexture bug
Mathias Fröhlich wrote: On Freitag 25 November 2005 04:28, Ampere K. Hardraade wrote: Ignore what I wrote in my last E-mail. I didn't realize I have errors when compiling. Whatever we end up here, I think that somebody with such hardware available should try to reproduce this with a small test program for two reasons: 1. Make sure that we do *not* have some kind of memory corruption within flightgear which is in the end responsible for that crash. 2. Have a simple testcase showing the problem. Just think if you would more /enjoy/ to work on a bug where you need to install plib/SimGear/Flightgear download the base package and then understand what is happening within that magitudes of code or if you would more likely take that problemreport with a simple 300 lines testcase where it is obvious to understand the problem... There is already a testcase besides the RenderTexture implementation. May be somebody can put together a testcase from that ... There is fgl_glxgears, it creates a pbuffer and render into it, simple code. Harald. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Request to the Mac folk
On 25 Nov 2005, at 00:33, David Luff wrote:Thanks, that's great! Would you prefer me to upload it to SourceForge for download from there, or to simply provide a link to your webspace?There's no problem with leaving it in my webspace, but you may as well add it to SF -that way you get SF's download stats and so on. No problem. I don't really know much about Mac versions. Am I right in thinking that Tiger is the latest one? Does one have to pay to upgrade from one version to another? Tiger is the latest, upgrading from any previous versions costs in the region of £90 / $110 I think. As I said, producing a panther build should be doable by someone with Panther, or if you get many complaints, I can set up a cross-build environment to target Panther myself; I'm just being lazy on the assumption flight sim users are probably early-ish adopters and already have Tiger...HHJames -- Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.9 compile problem
Vassilii Khachaturov wrote: SimGear really isn't designed to be a shared library anyway -- the various libsg*.a files just match the directory structure of the source code. As Alex pointed out, they have complicated dependency relationships that are going to be difficult to manage. Hmmm what about fgsd and Atlas? they link against the same codebase, don't they? why not lower the use of the VM by sharing it? Look at the layout. PLIB and Simgear are both a bunch of small libraries and you only link those that you really need for your application. If the creators really had the intention of havind a shared lib then I presume they would have put everything into a single library (libplib.so and libsg.so), Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] [BUG] [PATCH] (1/3) throwing stale exceptions and missing copy ctor/assignment
Index: ../../SimGear/source/simgear/environment/metar.cxx === RCS file: /var/cvs/SimGear-0.3/source/simgear/environment/metar.cxx,v retrieving revision 1.7 diff -b -u -p -r1.7 metar.cxx --- ../../SimGear/source/simgear/environment/metar.cxx 6 Oct 2005 09:45:36 - 1.7 +++ ../../SimGear/source/simgear/environment/metar.cxx 25 Nov 2005 13:15:36 - @@ -107,7 +107,9 @@ SGMetar::SGMetar(const string m, const scanType(); if (!scanId() || !scanDate()) { delete[] _data; - throw sg_io_exception(metar data bogus ( + _url + ')'); + static sg_io_exception E(metar data bogus ); + E.setLocation(_url); + throw E; } scanModifier(); @@ -133,7 +135,9 @@ SGMetar::SGMetar(const string m, const if (_grpcount 4) { delete[] _data; - throw sg_io_exception(metar data incomplete ( + _url + ')'); + static sg_io_exception E(metar data incomplete ); + E.setLocation(_url); + throw E; } _url = ; @@ -196,7 +200,9 @@ char *SGMetar::loadData(const char *id, sock-set_timeout(1); if (!sock-open(SG_IO_OUT)) { delete sock; - throw sg_io_exception(cannot connect to + host); + static sg_io_exception E(cannot connect to host ); + E.setLocation(host); + throw E; } string get = GET ; @@ -232,8 +238,11 @@ char *SGMetar::loadData(const char *id, char *b = buf; scanBoundary(b); - if (*b == '') - throw sg_io_exception(no metar data available from + _url); + if (*b == '') { + static sg_io_exception E(no metar data from the URL ); + E.setLocation(_url); + throw E; + } char *metar = new char[strlen(b) + 2]; // make room for \0 strcpy(metar, b); Index: ../../SimGear/source/simgear/props/condition.cxx === RCS file: /var/cvs/SimGear-0.3/source/simgear/props/condition.cxx,v retrieving revision 1.4 diff -b -u -p -r1.4 condition.cxx --- ../../SimGear/source/simgear/props/condition.cxx24 Sep 2003 17:19:23 - 1.4 +++ ../../SimGear/source/simgear/props/condition.cxx25 Nov 2005 13:15:38 - @@ -219,7 +219,8 @@ doComparison (const SGPropertyNode * lef break; } } - throw sg_exception(Unrecognized node type); + static sg_exception E(Unrecognized node type); + throw E; return 0; } Index: ../../SimGear/source/simgear/props/props.cxx === RCS file: /var/cvs/SimGear-0.3/source/simgear/props/props.cxx,v retrieving revision 1.18 diff -b -u -p -r1.18 props.cxx --- ../../SimGear/source/simgear/props/props.cxx23 Oct 2005 14:04:42 - 1.18 +++ ../../SimGear/source/simgear/props/props.cxx25 Nov 2005 13:15:41 - @@ -103,6 +103,7 @@ parse_name (const string path, int i) { string name = ; int max = path.size(); + static string E; if (path[i] == '.') { i++; @@ -112,8 +113,10 @@ parse_name (const string path, int i) } else { name = .; } -if (i max path[i] != '/') - throw string(Illegal character after + name); +if (i max path[i] != '/') { + E = Illegal character after + name; + throw E; +} } else if (isalpha(path[i]) || path[i] == '_') { @@ -129,15 +132,18 @@ parse_name (const string path, int i) } else if (path[i] == '[' || path[i] == '/') { break; } else { - throw string(name may contain only ._- and alphanumeric characters); + E = name may contain only ._- and alphanumeric characters; + throw E; } i++; } } else { -if (name.size() == 0) - throw string(name must begin with alpha or '_'); +if (name.size() == 0) { + E = name must begin with alpha or '_'; + throw E; +} } return name; @@ -170,7 +176,8 @@ parse_index (const string path, int i) } } - throw string(unterminated index (looking for ']')); + static string E(unterminated index (looking for ']')); + throw E; } @@ -291,8 +298,10 @@ find_node (SGPropertyNode * current, // .. means parent directory else if (components[position].name == ..) { SGPropertyNode * parent = current-getParent(); -if (parent == 0) - throw string(Attempt to move past root with '..'); +if (parent == 0) { + static string E(Attempt to move past root with '..'); + throw E; +} else return find_node(parent, components, position + 1, create); } Index: ../../SimGear/source/simgear/props/props_io.cxx === RCS file:
[Flightgear-devel] [BUG] [PATCH] (2/3) throwing stale exceptions and missing copy ctor/assignment
Index: ../../FlightGear/source/src/ATC/AIMgr.cxx === RCS file: /var/cvs/FlightGear-0.9/source/src/ATC/AIMgr.cxx,v retrieving revision 1.29 diff -b -u -p -r1.29 AIMgr.cxx --- ../../FlightGear/source/src/ATC/AIMgr.cxx 11 Nov 2005 13:45:35 - 1.29 +++ ../../FlightGear/source/src/ATC/AIMgr.cxx 25 Nov 2005 13:21:55 - @@ -82,7 +82,7 @@ void FGAIMgr::init() { planepath.c_str(), globals-get_props(), globals-get_sim_time_sec() ); - } catch(sg_exception e) { + } catch(sg_exception) { _loadedDefaultOK = false; } @@ -102,7 +102,7 @@ void FGAIMgr::init() { planepath.c_str(), globals-get_props(), globals-get_sim_time_sec() ); - } catch(sg_exception e) { + } catch(sg_exception) { _havePiperModel = false; } Index: ../../FlightGear/source/src/Environment/environment_ctrl.cxx === RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment_ctrl.cxx,v retrieving revision 1.40 diff -b -u -p -r1.40 environment_ctrl.cxx --- ../../FlightGear/source/src/Environment/environment_ctrl.cxx22 Nov 2005 17:02:31 - 1.40 +++ ../../FlightGear/source/src/Environment/environment_ctrl.cxx25 Nov 2005 13:21:57 - @@ -572,9 +572,11 @@ FGMetarEnvironmentCtrl::fetch_data( cons result.m = NULL; if (++_stale_count 10) { -_error_count = 1000; -throw sg_io_exception(More than 10 stale METAR messages in a row. + static sg_io_exception + Error(More than 10 stale METAR messages in a row. Check your system time!); +_error_count = 1000; + throw Error; } } else _stale_count = 0; Index: ../../FlightGear/source/src/Input/input.cxx === RCS file: /var/cvs/FlightGear-0.9/source/src/Input/input.cxx,v retrieving revision 1.72 diff -b -u -p -r1.72 input.cxx --- ../../FlightGear/source/src/Input/input.cxx 23 Nov 2005 12:48:09 - 1.72 +++ ../../FlightGear/source/src/Input/input.cxx 25 Nov 2005 13:22:07 - @@ -492,8 +492,10 @@ FGInput::_init_joystick () \\nUsing default: \ source ''); } else { -throw sg_throwable(string(No joystick configuration file with + static sg_throwable Error( + string(No joystick configuration file with namedefault/name entry found!)); + throw Error; } js_node = js_nodes-getChild(js, i, true); Index: ../../FlightGear/source/src/Main/fg_os_sdl.cxx === RCS file: /var/cvs/FlightGear-0.9/source/src/Main/fg_os_sdl.cxx,v retrieving revision 1.12 diff -b -u -p -r1.12 fg_os_sdl.cxx --- ../../FlightGear/source/src/Main/fg_os_sdl.cxx 6 Apr 2005 08:46:39 - 1.12 +++ ../../FlightGear/source/src/Main/fg_os_sdl.cxx 25 Nov 2005 13:22:09 - @@ -66,12 +66,14 @@ static void initCursors(); void fgOSOpenWindow(int w, int h, int bpp, bool alpha, bool stencil, bool fullscreen) { + static sg_throwable Error; int cbits = (bpp = 16) ? 5 : 8; int zbits = (bpp = 16) ? 16 : 24; -if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) == -1) -throw sg_throwable(string(Failed to initialize SDL: ) - + SDL_GetError()); +if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE) == -1) { + Error.setMessage(string(Failed to initialize SDL: ) + SDL_GetError()); +throw Error; + } atexit(SDL_Quit); SDL_WM_SetCaption(FlightGear, FlightGear); @@ -89,9 +91,11 @@ void fgOSOpenWindow(int w, int h, int bp if(fullscreen) { VidMask |= SDL_FULLSCREEN; } -if (SDL_SetVideoMode(w, h, 16, VidMask) == 0) -throw sg_throwable(string(Failed to set SDL video mode: ) - + SDL_GetError()); +if (SDL_SetVideoMode(w, h, 16, VidMask) == 0) { + Error.setMessage( + string(Failed to set SDL video mode: ) + SDL_GetError()); +throw Error; + } // This enables keycode translation (e.g. capital letters when // shift is pressed, as well as i18n input methods). Eventually, @@ -185,6 +189,7 @@ void fgOSExit(int code) void
[Flightgear-devel] [BUG] [PATCH] (3/3) throwing stale exceptions and missing copy ctor/assignment
This is just a pinpointing portion of the patch, as it doesn't fix anything -- since it's all in the JSBsim, and that one is about to be overridden with another upstream version. Please apply nevertheless so that we have it in the fgfs code, until that happens --- it's just comments change. Index: ../../FlightGear/source/src/FDM/JSBSim/FGFDMExec.cpp === RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/FGFDMExec.cpp,v retrieving revision 1.14 diff -b -u -p -r1.14 FGFDMExec.cpp --- ../../FlightGear/source/src/FDM/JSBSim/FGFDMExec.cpp11 Jun 2005 08:19:16 - 1.14 +++ ../../FlightGear/source/src/FDM/JSBSim/FGFDMExec.cpp25 Nov 2005 13:21:59 - @@ -159,7 +159,7 @@ FGFDMExec::FGFDMExec(FGPropertyManager* // to the property tree. try { Allocate(); - } catch ( string msg ) { + } catch ( string msg ) { // FIXME CATCH cout Caught error: msg endl; exit(1); } @@ -172,7 +172,7 @@ FGFDMExec::~FGFDMExec() try { DeAllocate(); checkTied( instance ); - } catch ( string msg ) { + } catch ( string msg ) { // FIXME CATCH cout Caught error: msg endl; } Index: ../../FlightGear/source/src/FDM/JSBSim/FGMatrix33.cpp === RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/FGMatrix33.cpp,v retrieving revision 1.6 diff -b -u -p -r1.6 FGMatrix33.cpp --- ../../FlightGear/source/src/FDM/JSBSim/FGMatrix33.cpp 15 Mar 2004 09:24:57 - 1.6 +++ ../../FlightGear/source/src/FDM/JSBSim/FGMatrix33.cpp 25 Nov 2005 13:22:00 - @@ -284,7 +284,7 @@ FGMatrix33 FGMatrix33::operator/(const d } else { MatrixException mE; mE.Message = Attempt to divide by zero in method FGMatrix33::operator/(const double scalar); -throw mE; +throw mE; // FIXME THROW } return Quot; } @@ -307,7 +307,7 @@ FGMatrix33 FGMatrix33::operator/=(const } else { MatrixException mE; mE.Message = Attempt to divide by zero in method FGMatrix33::operator/=(const double scalar); -throw mE; +throw mE;// FIXME THROW } return *this; } Index: ../../FlightGear/source/src/FDM/JSBSim/JSBSim.cxx === RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/JSBSim/JSBSim.cxx,v retrieving revision 1.37 diff -b -u -p -r1.37 JSBSim.cxx --- ../../FlightGear/source/src/FDM/JSBSim/JSBSim.cxx 10 Nov 2005 10:04:33 - 1.37 +++ ../../FlightGear/source/src/FDM/JSBSim/JSBSim.cxx 25 Nov 2005 13:22:07 - @@ -180,7 +180,7 @@ FGJSBsim::FGJSBsim( double dt ) } else { SG_LOG( SG_FLIGHT, SG_INFO, aero does not exist (you may have mis-typed the name).); - throw(-1); + throw(-1); // FIXME THROW (not a bug here, but review still --vassilii) } SG_LOG( SG_FLIGHT, SG_INFO, ); ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
This is to announce the 3-part patch I have just submitted to the list. It has been split as follows: 1. http://mail.flightgear.org/pipermail/flightgear-devel/2005-November/040968.html SimGear-level changes 2. http://mail.flightgear.org/pipermail/flightgear-devel/2005-November/040969.html FlightGear-level changes (except for the JSBSim code) 3. http://mail.flightgear.org/pipermail/flightgear-devel/2005-November/040970.html JSBSim code changes (no bug fixed there, they're only pinpointed with FIXME comments). What has been done in the patch: * whenever an exception object was created on a stack and then thrown (thus causing the dtor for that object to fire!), it was replaced with a STATIC exception object use in the same scope. I've reviewed all the cases for the potential MT problems this might create, and think that there's nothing dangerous, but I'd appreciate your review of the code from this aspect. * in some cases more specific sg exception types were used in place of the more generic one, e.g., sg_io_exception instead of sg_exception when the context of the error was an IO error * in some cases, the error message was made more specific * in a couple of cases, I fetched the IO error string via strerror, knowingly pulling in bogus data in case another thread does an IO call at the same moment. These are marked with a FIXME. * the exception classes were lacking the copy ctors and assignment operators, but the default ones for them were unusable as the string instance members are not suitable for byte-by-byte copying! See the PropsVisitor::setException for an example of a faulty use that is no longer broken because of this change. * minor style fix for exception rethrowing --- using throw; whenever a re-throw is made; sometimes optimizing away the exception symbol name in the catch handler at all * more specific catch handlers added in some places -- e.g., an sg_io_exception caught ahead of sg_exception Please review, test, comment and apply! Vassilii ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Vassilii Khachaturov schrieb: What has been done in the patch: * whenever an exception object was created on a stack and then thrown (thus causing the dtor for that object to fire!), it was replaced with a STATIC exception object use in the same scope. I've reviewed all the cases for the potential MT problems this might create, and think that there's nothing dangerous, but I'd appreciate your review of the code from this aspect. I wonder: what does actually happen when you create a static object in the middle of a method? Where does it get stored? When does it get released? Does it create a higher static memory footprint? (Does it's size matter?) I haven't really looked into the patches but what you describe sounds good to me. CU, Christian -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.0 (MingW32) iD8DBQFDhx5olhWtxOxWNFcRAkbDAJ9tujvOi2dABEG3XB6lhXU5odhungCgs02+ UoPMci4sxXF+/HIuS4gLxpc= =elz8 -END PGP SIGNATURE- ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Request to the Mac folk
As I said, producing a panther build should be doable by someone with Panther, or if you get many complaints, I can set up a cross-build environment to target Panther myself; I'm just being lazy on the assumption flight sim users are probably early-ish adopters and already have Tiger... HHJames I had made that assumption too when doing the FlightGear 0.9.9 release build for Mac. I figured if someone wanted a Panther build they would make a build and make it available. Cross-building is doable but it takes a bit of work. And I believe you would have to modifiy the FlightGear source as well (but not sure). Anyway soon after I released 0.9.9 posts started popping up in the forums about it not working. :) But what else can you expect when it's been downloaded 8817 times. I might make use of the Sourceforge.net compile farm to make on a more compatible target. -- Arthur/ - http://sourceforge.net/users/artooro/ - http://artooro.blogspot.com ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
I wonder: what does actually happen when you create a static object in the middle of a method? Same as if you create it in the beginning of the method :-) it gets initialized before it's first used, that's guaranteed; whether it's actually done before the function first runs or before the block first gets executed, is unspecified. Where does it get stored? In the static data section of the memory. When does it get released? Never. Static vars are just like extern vars, the only difference being that they are only accessed within the lexical scope that they're defined in (can be the whole file if defined outside a function, i.e., external static). Does it create a higher static memory footprint? (Does it's size matter?) Yes, but the 10 or so exceptions I've created with less than 50 string static objects overall don't matter that much, I hope (we're a several tens of megabytes binary image anyway already). I haven't really looked into the patches but what you describe sounds good to me. Thanks. Vassilii ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Re: [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
* Vassilii Khachaturov -- Friday 25 November 2005 15:11: * whenever an exception object was created on a stack and then thrown (thus causing the dtor for that object to fire!), it was replaced with a STATIC exception The whole thing looks like a solution desperately searching for a problem. The reasoning for this patch contradicts Stroustrup, who has several examples of what we are doing in The C++ programming language. Maybe it's only because I'm using an older copy (2nd ed.), but he writes (p. 602, r.15.2 Throwing an Exception): A throw-expression initializes a temporary object of the static type of the operand of throw and uses that temporary to initialize the appropriately-typed variable named in the handler. The throw expression cares for the thrown class to be available until it reached the handler. No need to spread ugly static variables everywhere. Our code looks right for me as it is. But then again, I'm a relative C++ newbie ... :-) m. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Re: [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
* Vassilii Khachaturov -- Friday 25 November 2005 15:11: * whenever an exception object was created on a stack and then thrown (thus causing the dtor for that object to fire!), it was replaced with a STATIC exception The whole thing looks like a solution desperately searching for a problem. The reasoning for this patch contradicts Stroustrup, who has several examples of what we are doing in The C++ programming language. Maybe it's only because I'm using an older copy (2nd ed.), but he writes (p. 602, r.15.2 Throwing an Exception): A throw-expression initializes a temporary object of the static type of the operand of throw and uses that temporary to initialize the appropriately-typed variable named in the handler. The throw expression cares for the thrown class to be available until it reached the handler. No need to spread ugly static variables everywhere. Our code looks right for me as it is. But then again, I'm a relative C++ newbie ... :-) AAARGH. If you had noticed me talking about the problem with JSB and others last 2 weeks, you'd have been able to prevent smth like 2 days of my work (patching and testing). :-) I didn't have a Stroustrup on hand, and several folks around did tell me this is a problem indeed. Thanks for the quote, better later than never. I wonder what compiler was JSB using in his string throwing example, can you please re-read that thread and see if you can find an alternative explanation? I'm sure that some (older) compilers do behave the ugly way I had described in my patch (this was definitely the case in the pre-ANSI-C++ days). If w/o this we're losing some platform (e.g., MSVC-based builds), maybe we should still apply it. (This is the problem of NOT being a C++ newbie --- you forget what's standard these days and what is coming from your habits to circumvent older quirks.) Nevertheless, a lot of things in the patch do make sense --- e.g., even in the light of what you quote, w/o proper copy semantics of the exception object, the things are broken. I can shred the conversion to static from the patch, but I'd like to hear more on whehter we do need the explicit static objects for some older compilers on other platforms. Vassilii ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] Re: [BUG] [PATCH] (announcement) throwingstale exceptions and missing copy ctor/assignment
I wonder what compiler was JSB using in his string throwing example, can you please re-read that thread and see if you can find an alternative explanation? Vassilii I use Borland C++, and the g++ compiler in the cygwin distribution. I also compile under a flavor of Linux, just to see what happens. I've been worried that try/catch/throw is something that is not supported similarly on different compilers. I've got other priorities right now, but please make use of our bug reporting mechanism at www.jsbsim.org. It's really the only way to be sure we don't lose track of stuff. Thanks, Jon ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Re: [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
* whenever an exception object was created on a stack and then thrown (thus causing the dtor for that object to fire!), it was replaced with a STATIC exception The whole thing looks like a solution desperately searching for a problem. The reasoning for this patch contradicts Stroustrup, who has several examples of what we are doing in The C++ programming language. Maybe it's only because I'm using an older copy (2nd ed.), but he writes (p. 602, r.15.2 Throwing an Exception): A throw-expression initializes a temporary object of the static type of the operand of throw and uses that temporary to initialize the appropriately-typed variable named in the handler. The throw expression cares for the thrown class to be available until it reached the handler. No need to spread ugly static variables everywhere. Our code looks right for me as it is. But I've created the following C++ snippet: -- CUT HERE -- #include exception #include iostream #include string using namespace std; struct E : exception { E() : _msg(DEFAULT) { cout E::E() endl; } E(const char* s) : _msg(s) { cout E::E(const char* s ) endl; } E(const E e) : _msg(e._msg + (clone)) { cout E::E(const E e._msg ) endl; } E operator=(const E e) { cout E::operator=( e._msg ) assigned over _msg endl; _msg = e._msg + (assigned); return *this; } virtual ~E() throw() { cout E::~E() _msg endl; } const char* what() const throw() { _msg.c_str(); } string _msg; }; void foo(int i) throw(exception) { cout foo entering endl; E unused(xUNUSED); switch (i) { case 0: break; case 1: throw E(x1); case 2: { E weird(x2); throw weird; } } cout foo exiting endl; } int main() { for (int i = 0; i 3; i++) { try { foo(i); } catch (E e) { cout Caught e.what() endl; } } return 0; } -- CUT HERE -- and gcc C++ compiler version 3.3.5 (Debian 1:3.3.5-13) has this to say when compiling it with default flags (fully confirming what you say -- you can throw either tmp variables, or automatic ones, created inside a frame to be unwound, and the objects won't be destroyed until caught): foo entering E::E(const char*xUNUSED) foo exiting E::~E() xUNUSED foo entering E::E(const char*xUNUSED) E::E(const char*x1) E::~E() xUNUSED Caught x1 E::~E() x1 foo entering E::E(const char*xUNUSED) E::E(const char*x2) E::E(const Ex2) E::~E() x2 E::~E() xUNUSED Caught x2(clone) E::~E() x2(clone) If anybody has access to a suspicious compiler that's critical for their platform's flightgear development, please do this test and check that 1) no exception is caught before its dtor is called 2) the amount of ctor calls equals the amount of dtor calls 3) no crash occurs Vassilii ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] Re: [BUG] [PATCH] (announcement) throwingstale exceptions and missing copy ctor/assignment
I use Borland C++, and the g++ compiler in the cygwin distribution. I also compile under a flavor of Linux, just to see what happens. I've been worried that try/catch/throw is something that is not supported similarly on different compilers. I've got other priorities right now, but please make use of our bug reporting mechanism at www.jsbsim.org. It's really the only way to be sure we don't lose track of stuff. Well, I want to make sure I know there's a bug before I report it :-) Either I need to remove the explicit conversion to static objects from my patch (most likely unless dictated by a specific compiler not adhering to the standard clause that Melchior has cited from the BS book), or I don't. For the JSBSim code it means that the only bug you might have, if your compiler is sane, is that MatrixException doesn't have copy ctor/default ctor/assignment (see the cloned x2 case in my snippet example run), thus its string member is copied bit-by-bit. Please run the snippet from the other mail on your compilers (esp. the borland one) and tell if it works. I'll file a bug on www.jsbsim.org as soon as I know what the problems are. Vassilii ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Request to the Mac folk
James Turner writes: On 25 Nov 2005, at 00:33, David Luff wrote: Thanks, that's great! Would you prefer me to upload it to SourceForge for download from there, or to simply provide a link to your webspace? There's no problem with leaving it in my webspace, but you may as well add it to SF -that way you get SF's download stats and so on. I've put a link to your webspace for now, since I can't log in to SF's web-based admin pages at the moment (but can ssh into the shell OK to update the webpages). When I finally manage to move it to SF I'll let you know. Once again, many thanks for taking the trouble to do this - it's much appreciated :-) Cheers - Dave ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] 0.9.8 references non-existentplacementtrans.hxx
Hi, On Freitag 25 November 2005 00:11, pmaclean wrote: Thank you for your reply. I am new to Flightgear so please bear with me. I am not sure how unref is applicable here. Sorry, I thought of reference counting in the scenegraph ... Also, I thought 0.9.8 was the latest release other than 0.9.9 which was released 8 days ago? The simgear site indicates that the latest csv is 0.3.9 and is paired with the 0.9.9 release of flightgear. Yes. But that simgear I have downloaded from ftp.de.flightgear.org to doublecheck includes that file. Greetings Mathias -- Mathias Fröhlich, email: [EMAIL PROTECTED] ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
Hello. I've tried to compile FG with this patches. But there is a problem to compile it because no errno is declared in those files. I don't know, how it is mentioned, I'm not up to the code. I don't know how to fix it cleanly. So please, can you post the correction? Thank you. BTW. Paste the patch into the body of email is not good idea. I have to edit it manualy, because tabs and some spaces were lost. I don't know how, maybe it is a feature of gmail. I'd prefer an attached file. Regards Ladislav. +++ ../../SimGear/source/simgear/xml/easyxml.cxx + ex.setMessage(strerror(errno)); // FIXME may be bogus with threads ^ +++ ../../SimGear/source/simgear/props/props_io.cxx + static sg_io_exception ex(, SimGear writeProperties()); + ex.setMessage(strerror(errno)); // FIXME may be bogus with threads ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
I've tried to compile FG with this patches. But there is a problem Dear Ladislaw, thank you very much for your help in testing this. to compile it because no errno is declared in those files. I don't know, how it is mentioned, I'm not up to the code. I don't know how to fix it cleanly. So please, can you post the correction? Thank you. Please back the changes out. I am about to post a shortened version, as per the comments by Melchior, without the MT problems issues, and without the errno at this time. It will not use any explicitly static exception objects, even in the case where the whole exception object could be made static w/o ever changing it (i.e., when there's no per-throw data change of the exception). (I'm preserving the errno and the fully static hunks aside, they're not lost). Since you are running on a different platform than I do (I have the errno there), I would like to ask you to run the exception checking snippet in this thread and report the results, while I'm doing the final testing of the shortened patch. BTW. Paste the patch into the body of email is not good idea. I have to edit it manualy, because tabs and some spaces were lost. I don't know how, maybe it is a feature of gmail. I'd prefer an attached file. The problem is that some list archives don't store the attachments. I'll now include URLs to a backup of the patches on my site instead of pointing to the mailing list archives, for people like you that prefer direct binary download of a patch over piping an email through to a patch(1) pipeline. Vassilii ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] RenderTexture bug
On November 25, 2005 01:35 am, Mathias Fröhlich wrote: I got the following errors when doing a make-install. What do I need to change? It looks like the RenderTexture stuff is not found at all. Did you get a compile error during RenderTexture compiles too? Greetings Mathias I think I have done something extremely stupid. :( I could use some instructions on how to use the TestRenderTexture.cpp file. Ampere ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Re: [BUG] [PATCH] (announcement) throwing stale exceptions and missing copy ctor/assignment
I have re-worked the patch into a shorter one. It has been split as follows: 1. http://mail.flightgear.org/pipermail/flightgear-devel/2005-November/040968.html SimGear-level changes Please see the attached simgear-except.diff for the new version of these, or http://www.tarunz.org/~vassilii/fg/simgear-except.diff 2. http://mail.flightgear.org/pipermail/flightgear-devel/2005-November/040969.html FlightGear-level changes (except for the JSBSim code) See the attached flightgear-except.diff for the new version of these, or http://www.tarunz.org/~vassilii/fg/flightgear-except.diff 3. http://mail.flightgear.org/pipermail/flightgear-devel/2005-November/040970.html JSBSim code changes (no bug fixed there, they're only pinpointed with FIXME comments). I haven't included any JSBSim-related changes now at this stage. What has been done in the patch: This item * whenever an exception object was created on a stack and then thrown thus causing the dtor for that object to fire!), it was replaced with a STATIC exception object use in the same scope. I've reviewed all the cases for the potential MT problems this might create, and think that there's nothing dangerous, but I'd appreciate your review of the code from this aspect. is N/A any longer, as per Melchior's quote of the BS C++ 2nd ed book The following things are still there * in some cases more specific sg exception types were used in place of the more generic one, e.g., sg_io_exception instead of sg_exception when the context of the error was an IO error * in some cases, the error message was made more specific except for this one * in a couple of cases, I fetched the IO error string via strerror, knowingly pulling in bogus data in case another thread does an IO call at the same moment. These are marked with a FIXME. The following are still in * the exception classes were lacking the copy ctors and assignment operators, but the default ones for them were unusable as the string instance members are not suitable for byte-by-byte copying! See the PropsVisitor::setException for an example of a faulty use that is no longer broken because of this change. * minor style fix for exception rethrowing --- using throw; whenever a re-throw is made; sometimes optimizing away the exception symbol name in the catch handler at all * more specific catch handlers added in some places -- e.g., an sg_io_exception caught ahead of sg_exception as is my request below Please review, test, comment and apply! (don't forget to revert the older larger patch if you've already started testing it). Also, please contribute your thoughts testing results for my snippet and on the exception handling portability issues with throwing local objects from within a frame that is about to be unwound due to the throw. Thank you, V. ? ../../SimGear/source/simgear.doxytags ? ../../SimGear/source/simgear/misc/swap_test ? ../../SimGear/source/simgear/xgl/.deps ? ../../SimGear/source/simgear/xgl/Makefile ? ../../SimGear/source/simgear/xgl/Makefile.in Index: ../../SimGear/source/Doxyfile === RCS file: /var/cvs/SimGear-0.3/source/Doxyfile,v retrieving revision 1.15 diff -b -u -p -r1.15 Doxyfile --- ../../SimGear/source/Doxyfile 5 Nov 2005 19:30:52 - 1.15 +++ ../../SimGear/source/Doxyfile 25 Nov 2005 21:11:15 - @@ -46,17 +46,17 @@ OUTPUT_LANGUAGE= English # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES -EXTRACT_ALL= NO +EXTRACT_ALL= YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. -EXTRACT_PRIVATE= NO +EXTRACT_PRIVATE= YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. @@ -111,7 +111,7 @@ STRIP_FROM_PATH= # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. -INTERNAL_DOCS = NO +INTERNAL_DOCS = YES # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a class diagram (in Html and LaTeX) for classes with base or @@ -498,7 +498,7 @@ TREEVIEW_WIDTH = 250 # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. -GENERATE_LATEX = YES +GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be @@ -558,7 +558,7 @@ LATEX_BATCHMODE= NO # The RTF output is optimised for Word 97 and may not
[Flightgear-devel] ATC and aerodynamics docs
Hi! Could you direct me to some good online documentation about ATC and aerodynamics of a helicopter? Szabi ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] ATC and aerodynamics docs
Szabolcs Berecz wrote: Hi! Could you direct me to some good online documentation about ATC and aerodynamics of a helicopter? Szabi ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d Here's what I have: http://www.dynamicflight.com/aerodynamics/ http://www.synchrolite.com/0941.html Josh ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Gear animation tutorial
I just made up a tutorial about making gear retraction animations run smoothly with complicated landing gears. It's still missing the final animation code, but I thought I'd throw it up to see what everybody thinks. It's got lots of in-line images, so be warned. I'm considering changing this to in-line thumbnails hotlinked to the full sized images. Please give feedback. http://jrbabcock.home.comcast.net/gear-tutorial/gear-tutorial.html Josh ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] ATC and aerodynamics docs
Szabolcs Berecz writes: Could you direct me to some good online documentation about ATC and aerodynamics of a helicopter? I've sent a (probably too large) private email containing: NACA Technical Note 4357 - Lift and Profile-Drag Characteristics of an NACA 0012 Airfoil As Derived From Measured Helicopter-Rotor Hovering Performance. NACA report 824 - I think this is the big lift-drag overview of NACA airfoil sections. I think combining the data from this with that from TN4357 should give some ideas for what happens in hover versus movement in non-turbulent air. NASA Contracter Report 177476 - Minimum-Complexity Helicopter Simulation Math Model - this is the paper that *everyone* writing about helicopter simulation cites, even though it's from July 1987. I haven't gone through the code, it's in Fortran or somesuch, but just a cursory skim gae me some good things to think about. Dan ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] ATC and aerodynamics docs
Szabolcs Berecz writes: Could you direct me to some good online documentation about ATC and aerodynamics of a helicopter? Okay, I said I was going to email them privately, but then I looked at a 32MB email in my outbound queue and realized that that was beyond bad form. See: http://www.flutterby.com/danlyke/helicoptersimnotes/MinimumComplexityHelicopterSimulationMathModel.pdf http://www.flutterby.com/danlyke/helicoptersimnotes/naca-report-824.pdf http://www.flutterby.com/danlyke/helicoptersimnotes/naca-tn-4357.pdf ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] ATC and aerodynamics docs
Szabolcs Berecz writes: Could you direct me to some good online documentation about ATC and aerodynamics of a helicopter? Okay, I said I was going to email them privately, but then I looked at a 32MB email in my outbound queue and realized that that was beyond bad form. See: http://www.flutterby.com/danlyke/helicoptersimnotes/MinimumComplexityHelicopterS imulationMathModel.pdf http://www.flutterby.com/danlyke/helicoptersimnotes/naca-report-824.pdf http://www.flutterby.com/danlyke/helicoptersimnotes/naca-tn-4357.pdf Robert Heffley (co-author of the Minimum Complexity ... document) has his papers online (including that one): http://robertheffley.com/pages/lib.htm You can also search the NACA technical report server here: http://naca.larc.nasa.gov The papers are online there, too. Jon ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] ATC and aerodynamics docs
On 26/11/05, Dan Lyke [EMAIL PROTECTED] wrote: http://www.flutterby.com/danlyke/helicoptersimnotes/MinimumComplexityHelicopterSimulationMathModel.pdf http://www.flutterby.com/danlyke/helicoptersimnotes/naca-report-824.pdf http://www.flutterby.com/danlyke/helicoptersimnotes/naca-tn-4357.pdf Thanks, I have downloaded all. Szabi ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d