This is the mail archive of the cygwin mailing list for the Cygwin 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]

Re: 1.5.24-2: zero-length write() and ioctl() on fd -1 cause crashes


$ cat ex.cpp
#include <stdexcept>
int main() {
 try {
  throw new std::exception();
 } catch (const std::exception& ex) {
  return 1;
 }
 return 0;
}

You are throwing a pointer and trying to catch a reference, so the exception never gets caught at all, which causes the program to abort. You should should do


throw std::exception();

instead.

-Lewis


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


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