Hi there,

*THE PROBLEM*
I'm trying to build abiword on Solaris 7 and split second
after the splash screen appears I get a Bus Error.  A backtrace
shows that it bombed in iconv_close() that was being called
from XAP_EncodingManager::~XAP_EncodingManager().

*THE REASON*
The code that is calling iconv_close is assuming that the
conversion descriptors are non-zero when valid.  I don't
know how iconv behaves on Linux, but on Solaris 7 iconv_open(3)
states that it will return -1 on a failure.

*THE SOLUTION*
Check for non -1 instead of non-zero.  There are four lines
of code that need to be changed.  The attached patch takes
care of it.  I also had to cast the descriptor as an int
because iconv_t resolves to a pointer and c++ doesn't like
it when one compares pointers to ints.

Applying this patch gets rid of the Bus Error.

--
David F. Newman
[EMAIL PROTECTED]

*** abi-0.7.12/src/af/xap/xp/xap_EncodingManager.cpp    Mon Nov 27 20:14:03 2000
--- abi-0.7.12/src/af/xap/xp/xap_EncodingManager.cpp.new        Wed Jan 10 15:49:26 
2001
***************
*** 39,54 ****
  
  XAP_EncodingManager::~XAP_EncodingManager()
  {
!   if(iconv_handle_N2U)
      iconv_close(iconv_handle_N2U);
  
!   if(iconv_handle_U2N)
      iconv_close(iconv_handle_U2N);
  
!   if(iconv_handle_U2Win)
      iconv_close(iconv_handle_U2Win);
    
!   if(iconv_handle_Win2U)
      iconv_close(iconv_handle_Win2U);
  }
  
--- 39,54 ----
  
  XAP_EncodingManager::~XAP_EncodingManager()
  {
!   if((int)iconv_handle_N2U != -1)
      iconv_close(iconv_handle_N2U);
  
!   if((int)iconv_handle_U2N != -1)
      iconv_close(iconv_handle_U2N);
  
!   if((int)iconv_handle_U2Win != -1)
      iconv_close(iconv_handle_U2Win);
    
!   if((int)iconv_handle_Win2U != -1)
      iconv_close(iconv_handle_Win2U);
  }
  

Reply via email to