← Back to team overview

kicad-developers team mailing list archive

Has something changed in the track drag code?

 

Recently I noticed (sporadic) crashes when using the
drag-track-keep-slope function. SIGSEG and SIGILL. The nasty stuff.

I trapped a core dump of an occurrance. gdb says:

Program terminated with signal SIGILL, Illegal instruction.
#0  0x00000000046bef42 in ?? ()
(gdb) bt
#0  0x00000000046bef42 in ?? ()
#1  0x00000000006ed801 in PCB_EDIT_FRAME::Start_DragTrackSegmentAndKeepSlope (this=0x2c42d60, track=0x3716520, DC=0x7ffffc225f30) at /home/lomarcan/cvswork/kicad-bzr/pcbnew/move_or_drag_track.cpp:726
#2  0x00000000006a4a71 in PCB_EDIT_FRAME::Process_Special_Functions ( this=0x2c42d60, event=...) at /home/lomarcan/cvswork/kicad-bzr/pcbnew/edit.cpp:1134

The statements seems to be

if( ( track->end == NULL ) || ( track->end->Type() == PCB_TRACE_T) )
TrackToEndPoint = track->GetTrace( GetBoard()->m_Track, NULL, FLG_END );

I fear a corruption of track->end... scavenging the core gives for
track->end:

$6 = {<BOARD_ITEM> = {<EDA_ITEM> = {<KIGFX::VIEW_ITEM> = {
        _vptr.VIEW_ITEM = 0x459c9ef, m_view = 0x45dae60, m_visible = 232, 
        m_groups = 0x0, m_groupsSize = 0, m_layers = {<std::_Base_bitset<2ul>> = {
            _M_w = {0, 0}}, <No data fields>}}, m_StructType = EOT, m_Status = 0, 
      Pnext = 0x4747ea8, Pback = 0x0, m_List = 0x0, m_Parent = 0x0, 
      m_TimeStamp = 1391772801, m_forceVisible = false, m_Flags = 0, 
      m_Image = 0x600000008}, m_Layer = -64853952, static ZeroOffset = {x = 0, 
      y = 0}}, 
  m_TracksConnected = {<std::_Vector_base<TRACK*, std::allocator<TRACK*> >> = {
      _M_impl = {<std::allocator<TRACK*>> = {<__gnu_cxx::new_allocator<TRACK*>> = {<No data fields>}, <No data fields>}, _M_start = 0xf232afd8, _M_finish = 0x45cb3e8, 
        _M_end_of_storage = 0x0}}, <No data fields>}, 
  m_PadsConnected = {<std::_Vector_base<D_PAD*, std::allocator<D_PAD*> >> = {
      _M_impl = {<std::allocator<D_PAD*>> = {<__gnu_cxx::new_allocator<D_PAD*>> = {<No data fields>}, <No data fields>}, _M_start = 0x0, _M_finish = 0x0, 
        _M_end_of_storage = 0x0}}, <No data fields>}, m_NetCode = 0, m_Subnet = 0, 
  m_ZoneSubnet = 56674392}

The object itself doesn't seem too broken to do a misjump on the vtbl... however the m_StructType at EOT seems suspicious.

I have no idea of what is happened... suggestions? In the meanwhile I'll try to reproduce it live.

-- 
Lorenzo Marcantonio
Logos Srl