RE: SIGSEGV issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





David Sayada writes:

 > For the moment I don't know. But can that be caused by an exception
 > I am not catching between try and catch?

It's possible, but I'd have to debug it to know for sure.

Please stop top-posting.

Andrew.


Hi Andrew,

I hope I am not top posting now :-)    
I think I have identified what can be the source of the problem. Please look
at the following scheme:

This is the infinite loop of one my threads:

        while (true)
        {
            try
            {
                selectEventLoop();
            }
            catch (Exception e)
            {
                Logger.logPrintln( e );
            }
        } // of select loop

And this is the way the selectEventLoop is implemented:

void selectEventLoop() throws Exception
    {
        int nNumSelected = 0;

        while ( nNumSelected == 0 )
        {
            signalSendChannels();

            //Logger.logPrintln( "XXXXXXXXX Before select" );
            nNumSelected = m_selector.select();
            //Logger.logPrintln( "XXXXXXXXX After select" );
        }

        Set readyKeys = m_selector.selectedKeys();
        Iterator iterator = readyKeys.iterator();

        while (iterator.hasNext())
        {
            SelectionKey key = (SelectionKey) iterator.next();
            iterator.remove();
            try
            {
		.......
            }
            catch (IOException ex)
            {
                Logger.logPrintln( ex );
                closeChannel( key );
            }
        } // of selected keys iterator
    }

May the parts of this function which are not under try and catch be
problematic? Should the exception thrown in this area not be caught by the
try and catch of the upper layer inside the infinite loop?

Best Regards,
David Sayada.







[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux