ABY icon indicating copy to clipboard operation
ABY copied to clipboard

error in function wait_for_fin()

Open why418 opened this issue 7 years ago • 1 comments
trafficstars

Hi. I am trying to implement an ABY application . And i found out the application is stuck in wait_for_fin() sometimes after execCircuit().

void channel::synchronize_end() {
	if(m_bSndAlive)
		signal_end();
	if(m_bRcvAlive)
		m_cRcver->flush_queue(m_bChannelID);
	if(m_bRcvAlive)
		wait_for_fin();   //<----The application is stuck here.
}


Hope you understand it. Thanks.

why418 avatar Nov 21 '18 11:11 why418

I am also observing ABY getting stuck during the setup phase.

I found this to be probably the same issue and looked into where exactly the program got stuck in the server process: The main thread gets stuck in in ABYSetup::WaitWorkerThreads(), abysetup.cpp, line 530, while several other threads seem to be waiting in ABYSetup::CPartyWorkerThread::ThreadMain, on line 551 m_evt.Wait();. One in SndThread::ThreadMain on line 92 send->Wait(). One in OTExcRec::start_receive, ot-ext-rec.cpp, line 62 rThreads[i]->Wait() Two waiting for messages on asio sockets in CSocket::Receive, socket.cpp, line 241, boost::asio::read(..) (from RcvThread::Main) One in OTReceiverThread::ThreadMain in channel::wait_for_fin, channel.cpp, line 120 m_eFin->Wait().

Client side it looks quite similar.

As additional information, I am reusing my ABYParty object using Reset() and it seems that the issue occurs never during the first run but one of the following. Also, the problems seems to occur more often when doing more resets, but that's just a general impression I have without having any actual data on this.. @why418 did you observe the problem occuring during the first ExecCircuit call you do or only after invoking ABYParty::Reset? Edit: I now also had it occur during the first and only run of ExecCircuit

Also, in some very rare cases, I encounter a segmentation fault in the client process when calling ExecCircuit but so far I haven't been able to catch that with the debugger so I cannot tell whether or not it is related or not.

(all this happens with boost 1.67 and regardless of whether I compile the whole thing (my application, boost and aby) with gcc-6.3 (system compiler) or gcc-8.2)

Addition: In the test program I wrote for #114 I can observe occasional freezes as well but the segfaulting mentioned above happens more often and occurs randomly on either client and server side. This often occurs in CEvent::Set, in thread.cpp, cv_notify_one(); called from RcvThread::remove_listener in rcvthread.cpp, line 45, listeners[channeldi].fin_event->Set(); for channelid of 0. In there I also tried destroying and freshly instantiating the ABYParty object instead of using Reset, which changed nothing.

lumip avatar Dec 15 '18 17:12 lumip