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

Lewis Hyatt lhyatt@princeton.edu
Thu Oct 4 23:33:00 GMT 2007


> $ 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/



More information about the Cygwin mailing list