Hi guys,
lately my application is going in segmentation fault and last log I
see is the one in subject,
I'm using Wt  3.1.8.

The core back trace is the following:

#0  0x00007f808e7cda75 in *__GI_raise (sig=<value optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f808e7d15c0 in *__GI_abort () at abort.c:92
#2  0x00007f808e7c6941 in *__GI___assert_fail
(assertion=0x7f80906ff9fa "!pthread_mutex_destroy(&m)", file=<value
optimized out>, line=45,
    function=0x7f8090732940 "boost::mutex::~mutex()") at assert.c:81
#3  0x00007f80906b294b in ~mutex (this=0x19b4470, __in_chrg=<value
optimized out>) at /usr/include/boost/thread/pthread/mutex.hpp:45
#4  ~SyncLocks (this=0x19b4470, __in_chrg=<value optimized out>) at
/root/Installed/wt-3.1.8/src/web/WebSession.h:229
#5  ~WebSession (this=0x19b4470, __in_chrg=<value optimized out>) at
/root/Installed/wt-3.1.8/src/web/WebSession.C:175
#6  0x00007f809067a902 in checked_delete<Wt::WebSession> (this=<value
optimized out>) at /usr/include/boost/checked_delete.hpp:34
#7  boost::detail::sp_counted_impl_p<Wt::WebSession>::dispose
(this=<value optimized out>) at
/usr/include/boost/smart_ptr/detail/sp_counted_impl.hpp:78
#8  0x00007f80906b03f2 in boost::detail::sp_counted_base::release
(this=0x7f808413e3e0, __in_chrg=<value optimized out>)
    at /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145
#9  ~shared_count (this=0x7f808413e3e0, __in_chrg=<value optimized
out>) at /usr/include/boost/smart_ptr/detail/shared_count.hpp:217
#10 ~shared_ptr (this=0x7f808413e3e0, __in_chrg=<value optimized out>)
at /usr/include/boost/smart_ptr/shared_ptr.hpp:169
#11 ~Handler (this=0x7f808413e3e0, __in_chrg=<value optimized out>) at
/root/Installed/wt-3.1.8/src/web/WebSession.C:660
#12 0x00007f80904b6378 in ~UpdateLockImpl (this=<value optimized out>,
__in_chrg=<value optimized out>) at
/root/Installed/wt-3.1.8/src/Wt/WApplication.C:1229
#13 ~UpdateLock (this=<value optimized out>, __in_chrg=<value
optimized out>) at /root/Installed/wt-3.1.8/src/Wt/WApplication.C:1285
#14 0x00007f8090a3222c in plots::WtTerminal::swapModel
(this=0x7f8078024a20, aDataModelBuffer=0x7f8084012010)
    at /home/fbasile/EssaRadioSuite/src/Libraries/Plots/wtterminal.cpp:231


This is strange since since in my application I actualy hold a lock,
this is the code of that plots::WtTerminal::swapModel(.....)


void WtTerminal::swapModel(Wt::WStandardItemModel* aDataModelBuffer) {
  Wt::SyncLock<boost::recursive_mutex::scoped_lock>
myIsValidLock(theIsValidMutex);
  if(!theIsValid) {
    delete aDataModelBuffer;
    return;
  }

  Wt::WApplication::UpdateLock myLock(theApplication);
  if (!myLock) {
    delete aDataModelBuffer;
    std::cout << "WtTerminal::swapModel: Lock failed, session is being
closed" << std::endl;
    return;
  }

  std::swap(theDataModel, aDataModelBuffer);

  theChart->setModel(theDataModel);
  theChart->setXSeriesColumn(0);    // set the column that holds the X data
  theChart->setType(Wt::Chart::ScatterPlot);   // set type to ScatterPlot
  for(int myLineCounter = 1; myLineCounter <
theDataModel->columnCount(); ++myLineCounter) {
    Wt::Chart::WDataSeries myData(myLineCounter, Wt::Chart::LineSeries);
    theChart->addSeries(myData);
  }
  delete aDataModelBuffer;
  theChart->refresh();
  theApplication->triggerUpdate();       //Line 231
}

As you can see if I fail to get the UpdateLock with the

   Wt::WApplication::UpdateLock myLock(theApplication);

the execution doesn't reach the Line 231.

The application is crashing while destroying the myLockinstance.

How is this possible that the session is destroyed while an instance
of Wt::WApplication::UpdateLock
exists (note the presence of  Wt::SyncLock at the beginning of the thread) ?

Let me know if you need further info.

Gaetano




-- 
cpp-today.blogspot.com

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to