* Giulio Paci <giuliop...@gmail.com>, 2013-04-09, 18:12:
X: libngram0: shlib-calls-exit usr/lib/libngram.so.0.0.0
Do I understand correctly that this comes from libfst, and would have
to be fixed there?
I have not found any direct exit reference in libngram source code.
So I checked libfst code and there are just a few calls:
Thanks for the detailed analysis!
1) One is in FailedNewHandler() in src/lib/compat.cc. As far as I can
tell this is only a convenience function to call exit and print an
error message, to be used with std::set_new_handler() in applications.
Yup, this fine; although I'm not sure how is it better than the default
new-handler. :)
2) Some are in SetFlags() in src/lib/flags.cc. This seems a convenience
function to be used at the begin of a program to parse flags, handle
errors and exit if needed (I am not 100% sure anyway). It is also
called by the deprecated similar convenience function InitFst().
This should be fine, too.
3) Another one is in LogMessage() in src/include/fst/log.h, when
invoked with FATAL type.
I think that's acceptable use of exit()...
4) TestProperties() in src/include/fst/test-properties.h, if
FLAGS_fst_verify_properties is set, LogMessage(FATAL) may be called.
5) If FLAGS_fst_error_fatal is set all FSTERROR() calls results in a
LogMessage(FATAL) call.
...but these two are worrisome.
1), 2), 4), 5) are not directly called in libngram.
3) is used several way in libngram instead.
I am not sure about how to deal with this issue. OpenFST exit calls
seem reasonable to me, while LOG(FATAL) calls in libngram seem not.
Each side could be blamed:
1) OpenFST offers an inflexible logging-and-error-mechanisms, which is
unsuitable for use in shared libraries;
2) OpenGrm-NGram uses this mechanisms.
If OpenFST offered a way to plug in your own logging handler, it
wouldn't be a problem at that OpenGrm-NGram uses LOG(FATAL). The
application could install a handler that would throw an exception, or
ignored the error, or exited with exit code more suitable for its needs.
But anyway, we can worry about it later. I can upload the package as-is
if you want.
--
Jakub Wilk
--
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130411212551.ga3...@jwilk.net