Opened 9 years ago

Closed 9 years ago

#1379 closed defect (duplicate)

[steamshovel] event switching segfault

Reported by: Patrick Berghaus Owned by: Hans Dembinski
Priority: normal Milestone:
Component: combo core Keywords: steamshovel
Cc:

Description (last modified by David Schultz)

Ok, here is one of the segfaults I talked about earlier. It happened when switching to another event:

System: Ubuntu 15.04
icerec version: trunk, Revision: 138186

#0  0x00007fafd89b3241 in ?? () from /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
#1  0x00007fafda4ed552 in boost::python::converter::shared_ptr_deleter::operator()(void const*) ()
   from /home/berghaus/i3/ports/lib/boost-1.38.0/libboost_python-mt.so
#2  0x00007fafd6387912 in SphereObject::~SphereObject() ()
   from /home/berghaus/icerec/build/lib/libshovelart.so
#3  0x00007fafd6390456 in SceneGroup::~SceneGroup() ()
   from /home/berghaus/icerec/build/lib/libshovelart.so
#4  0x00007fafd6390509 in SceneGroup::~SceneGroup() ()
   from /home/berghaus/icerec/build/lib/libshovelart.so
#5  0x00000000004ba8f2 in std::_Rb_tree<boost::shared_ptr<SceneGroup>, boost::shared_ptr<SceneGroup>, std::_Identity<boost::shared_ptr<SceneGroup> >, std::less<boost::shared_ptr<SceneGroup> >, std::allocator<boost::shared_ptr<SceneGroup> > >::_M_erase(std::_Rb_tree_node<boost::shared_ptr<SceneGroup> >*) ()
#6  0x00007fafd6391b39 in Scene::dropOutputs(boost::shared_ptr<Artist>) ()
   from /home/berghaus/icerec/build/lib/libshovelart.so
#7  0x00007fafd6392709 in Scene::dropSource(boost::shared_ptr<Artist>) ()
   from /home/berghaus/icerec/build/lib/libshovelart.so
#8  0x00007fafd6399d04 in Scenario::remove(boost::shared_ptr<Artist>) ()
   from /home/berghaus/icerec/build/lib/libshovelart.so
#9  0x00000000004c4292 in ScenarioWidget::removeSelection() ()
#10 0x00007fafd676d1ec in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#11 0x00007fafd7060626 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#12 0x00007fafd7060f8c in QAbstractButton::mousePressEvent(QMouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#13 0x00007fafd6cde947 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#14 0x00007fafd6c8a9bc in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#15 0x00007fafd6c9163f in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#16 0x00000000004ac938 in SteamshovelApp::notify(QObject*, QEvent*) ()
#17 0x00007fafd67581cd in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#18 0x00007fafd6c90c9f in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
---Type <return> to continue, or q <return> to quit---
#19 0x00007fafd6d0a9a2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#20 0x00007fafd6d0a24c in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#21 0x00007fafd6d32ba2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#22 0x00007fafccf3bc3d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#23 0x00007fafccf3bf20 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#24 0x00007fafccf3bfcc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#25 0x00007fafd678785e in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#26 0x00007fafd6d32c66 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#27 0x00007fafd6756d21 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#28 0x00007fafd6757085 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#29 0x00007fafd675cb09 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#30 0x00000000004751a5 in main ()

Change History (11)

comment:1 Changed 9 years ago by Hans Dembinski

  • Owner set to hdembinski
  • Status changed from new to assigned

comment:2 Changed 9 years ago by Hans Dembinski

Could you please provide a file path to test this as well?

comment:3 Changed 9 years ago by David Schultz

  • Component changed from icerec to icecube offline
  • Description modified (diff)
  • Summary changed from steamshovel event switching segfault to [steamshovel] event switching segfault

comment:4 Changed 9 years ago by Hans Dembinski

  • Status changed from assigned to accepted

comment:5 Changed 9 years ago by Hans Dembinski

Which versions of boost and python are you using?

comment:6 Changed 9 years ago by Patrick Berghaus

boost-1.38.0
Python 2.7.9 (default, Apr 2 2015, 15:33:21)

comment:7 Changed 9 years ago by Hans Dembinski

Ah, old boost, okay, I think I know how to fix this. Please stay tuned to test a patch for me, ok?

Alternatively, you could also try to switch to a newer boost version, like the one that's native for ubuntu 15.04.

comment:8 Changed 9 years ago by don la dieu

Assuming you have libboost-dev installed, you can use the following boost.cmake in your I3_SITE_CMAKE_DIR. This will allow you to use your system's boost libraries and still use the other I3_PORTS. (Note, that this file is the same as what is on trunk, but with lines 29 and 34 commented out).

#
#  $Id: boost.cmake 2269 2015-08-30 16:52:23Z nega $
#  
#  Copyright (C) 2007   Troy D. Straszheim  <troy@icecube.umd.edu>
#  and the IceCube Collaboration <http://www.icecube.wisc.edu>
#  
#  This file is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 3 of the License, or
#  (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>
#  

if(NOT SYSTEM_PACKAGES)
endif(NOT SYSTEM_PACKAGES)

colormsg("")
colormsg(HICYAN "Boost")
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
#if (SYSTEM_PACKAGES)
        find_package(Boost 1.46.0 COMPONENTS python system signals thread date_time serialization filesystem program_options regex iostreams)
        if (NOT Boost_FOUND)
            colormsg(RED ${Boost_ERROR_REASON})
        endif (NOT Boost_FOUND)
#endif (SYSTEM_PACKAGES)

if (Boost_VERSION EQUAL 105800)
    colormsg(HIRED 
"***
   *** Your Boost version is 1.58.0. This version is known to have issues with
   *** serialization. A fix is in the works. If you have questions, email
   *** software@icecube.wisc.edu, or join #software on slack.
   ***")
    message(FATAL_ERROR "Incompatible Boost version")
endif (Boost_VERSION EQUAL 105800)

if((NOT SYSTEM_PACKAGES) OR (NOT Boost_FOUND))
  set(BOOST_PORTSVERSION "1.38.0" CACHE PATH "The boost version.")
  set(BOOST_INCLUDEDIR ${I3_PORTS}/include/boost-${BOOST_PORTSVERSION})
  set(BOOST_LIBRARYDIR ${I3_PORTS}/lib/boost-${BOOST_PORTSVERSION})
  set(Boost_NO_SYSTEM_PATHS TRUE)
  find_package(Boost ${BOOST_PORTSVERSION} EXACT REQUIRED COMPONENTS python system signals thread date_time serialization filesystem program_options regex iostreams)
endif((NOT SYSTEM_PACKAGES) OR (NOT Boost_FOUND))

if(Boost_FOUND)
  set(BOOST_FOUND TRUE CACHE BOOL "Boost found successfully")
  set(BOOST_INCLUDE_DIR ${Boost_INCLUDE_DIR} CACHE PATH "Path to the boost include directories.")
  set(BOOST_LIBRARIES ${Boost_LIBRARIES} CACHE PATH "Boost libraries")
  if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/tool-patches/boost-${BOOST_PORTSVERSION})
    include_directories(${CMAKE_SOURCE_DIR}/cmake/tool-patches/boost-${BOOST_PORTSVERSION})
  else()
    include_directories(${CMAKE_SOURCE_DIR}/cmake/tool-patches/boost-new)
  endif()

  foreach(lib ${BOOST_LIBRARIES})
    if(NOT ${lib} STREQUAL "optimized" AND NOT ${lib} STREQUAL "debug")
      add_custom_command(TARGET install_tool_libs
        PRE_BUILD
        COMMAND mkdir -p ${CMAKE_INSTALL_PREFIX}/lib/tools
        COMMAND ${CMAKE_SOURCE_DIR}/cmake/install_shlib.py ${lib} ${CMAKE_INSTALL_PREFIX}/lib/tools) 
    endif(NOT ${lib} STREQUAL "optimized" AND NOT ${lib} STREQUAL "debug")
  endforeach(lib ${BOOST_LIBRARIES})
endif(Boost_FOUND)

comment:9 Changed 9 years ago by Hans Dembinski

I just updated a patch that might fix your problem. Could you please test it?

comment:10 Changed 9 years ago by Hans Dembinski

I worked all yesterday on this, but the way steamshovel handles memory is complicated (a deep problem inherited from Steve's design...). The best guess is that the problem goes away once you switch to a newer boost.

comment:11 Changed 9 years ago by Hans Dembinski

  • Resolution set to duplicate
  • Status changed from accepted to closed

discussion continues in #1392

Note: See TracTickets for help on using tickets.