|Anonymous | Login||2019-12-09 08:45 MSK|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0026924||Community||[OCCT] OCCT:Coding||public||2015-11-24 23:42||2017-04-20 10:17|
|Status||closed||Resolution||no change required|
|Target Version||[OCCT] 7.2.0||Fixed in Version|
|Summary||0026924: Use of exit() in a shared library|
|Description||OCCT uses exit() in quite a few places; the general consensus is that using exit() in a shared library is a no-no because it prevents the application using OCCT from proper cleanup and notifying the user of what happened, etc. I realize it would be a large undertaking, but OCCT should return error codes, or use exceptions, etc. instead of using exit().|
|Tags||No tags attached.|
|Test case number|
The places where OCCT code calls exit() are:
- Draw_BasicCommands.cxx: abort of the program if its execution time is over the defined limit (considered as hang up). This is necessary in tests to avoid blocking the process if some test hangs.
- Draw_Window.cxx: exit if DRAW application cannot initialize.
- lex.ExprIntrp.c and lex.step.c: exit() is part of the standard code generated by Flex scanner, not actually called from anywhere -- another error function is used instead.
- OSD_File.cxx: exit() is inside piece of dead code, to be removed.
- OSD_signal.cxx: exit() is called from signal handler in case when jumping did not succeeded. This can be improved by resetting handler to default and re-raising signal, as described in (I am not sure if this makes any real difference):
- OSD_signal_WNT.cxx: exit() is called if the user selects to abort the program explicitly on the case of exception (special debug mode)
- Standard_ErrorHandler.cxx: exit() is called in situation when no landing point can be found to return from signal handler... This is used only when NO_CXX_EXCEPTION is defined, which is obsolete (used in the past for old compilers not supporting C++ exceptions) and should be removed.
Thus I believe that all actual uses of exit() are legitime and necessary, though some code around can be revised and cleaned up. If you have some particular complaints or know situation when exit() is called not in appropriate situation, please explain this.
please close the issue as no change required (see Andrey's comment).
|2015-11-24 23:42||Epy||New Issue|
|2015-11-24 23:42||Epy||Assigned To||=> kgv|
|2015-11-25 01:06||abv||Note Added: 0048541|
|2015-11-30 12:00||Roman Lygin||Relationship added||parent of 0026937|
|2016-01-06 16:30||abv||Target Version||=> 7.1.0|
|2016-11-03 17:13||abv||Target Version||7.1.0 => 7.2.0|
|2017-04-19 16:40||kgv||Note Added: 0065353|
|2017-04-19 16:40||kgv||Assigned To||kgv => bugmaster|
|2017-04-19 16:40||kgv||Status||new => feedback|
|2017-04-19 16:40||kgv||Resolution||open => no change required|
|2017-04-20 10:17||bugmaster||Status||feedback => closed|
|Copyright © 2000 - 2019 MantisBT Team|