This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

more non-useless destructors desired

  To prevent emitting typeinfo and vtable info in every translation unit, explicit destructors were added to some exceptions years ago - see r48700 and r48687.

However, there are a few more standard exceptions in <stdexcept> which are lacking these.
  (logic_errors): domain_error,  invalid_argument,  length_error,  out_of_range,
  (runtime_errors): range_error,  overflow_error, underflow_error

Is there some reason why these should not have explicit destructors too?  Is it too late to add them due to ABI issues?

  The reason this came up is that I recently had to debug an rather nasty bug due to some other rather nasty abuses in another project at work.  During the investigation, I saw that the typeinfo and vtables for some of these destructors were being resolved against an old libstdc++ runtime.

  Even though the symbols in the libstdc++ runtimes are versioned, the weak symbols emitted during compilation of the project are unversioned, so at runtime happened to resolve against the wrong one.

  It is my understanding that if these exception had explicit destructors, then the vtable and typeinfo would not be emitted in the project's code, but that the resulting symbols would be normal undefined versioned symbols (as I did observe for std::exception).



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]