カテゴリ | 重要度 | ステータス | 解決状況 | 登録日時 | 最終更新 |
---|---|---|---|---|---|
![]() | 中 | 解決済み | 修正済み | 2010-02-24 04:12 | 2010-02-28 22:45 |
テスター | pingbak | 担当者 | couriersud | ソース | |
バージョン | 0.136u3 | 発生バージョン | 修正バージョン | 0.136u4 | |
修正コミット | プルリク | ||||
フラグ | デバッグビルド限定 | ||||
セット | |||||
セット詳細 | |||||
概 要 | オーバーロードしたoperator newとoperator delete動作が厳しすぎてMacOSでクラッシュする。 | ||||
詳 細 | This isn't hard to reproduce, at least on the Mac OS X platform. When compiled with MAME_DEBUG set, sdlmame will crash. The problem is that this is likely not specific to sdlmame, but to the design decision to overload operator new and operator delete globally and to abort if the deleted pointer is not found in the tracked set of pointers. Basically, this design needs to be more permissive -- it should not abort on a perceived allocation error. Complain about it, sure. Abort, not a good choice. The reason is that there are long standing bugs in every vendor's system libraries that wont be corrected. A good example of this is libGLUT (GL utilities library). Other examples abound, such as the common mistake of calling 'delete' instead of 'delete []' (which might be happening in this case, but can't tell for sure.) I've got some experience with writing debugging malloc and overloading operator new/delete; I was an early contributor to and tester of Gray Watson's "dmalloc" library. "dmalloc" is still used by many to find allocation problems. 'valgrind' on the Linux platform is also a good way to locate allocation issues. Customized new/delete that passes extra parameters for source file and line is reasonable because that would only affect mame source where it is used. Overloading the global versions is a maintenance headache. | ||||
再現手順 | |||||
追加情報 | Another good reason to rethink global operator new/delete: delete has different declarations on different versions of gcc, viz: operator delete(void *); vs. operator delete(void *) throw(); The declarations are not strictly the same. | ||||
添付ファイル |