COIN-OR::LEMON - Graph Library

Opened 2 years ago

#668 new defect

Crash in lgf_reader_writer_test

Reported by: Szabolcs Horvát Owned by: Alpar Juttner
Priority: major Milestone: LEMON 1.4 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

The lgf_reader_writer_test test crashes for my. I am using the latest development version. Here's a stack trace from AddressSanitizer?:

==61012==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffee35a9ce0 at pc 0x00010cb7d0fe bp 0x7ffee35a8e10 sp 0x7ffee35a8e08
READ of size 4 at 0x7ffee35a9ce0 thread T0
    #0 0x10cb7d0fd in lemon::SmartGraphBase::Arc::operator lemon::SmartGraphBase::Edge() const smart_graph.h:455
    #1 0x10cb7cb7d in lemon::_writer_bits::GraphArcLookUpConverter<lemon::SmartGraph>::operator()(lemon::SmartGraphBase::Arc const&) lgf_writer.h:252
    #2 0x10cb7c897 in lemon::_writer_bits::ValueStorage<lemon::SmartGraphBase::Arc, lemon::_writer_bits::GraphArcLookUpConverter<lemon::SmartGraph> >::get() lgf_writer.h:190
    #3 0x10cb86481 in lemon::GraphWriter<lemon::SmartGraph>::writeAttributes() lgf_writer.h:1549
    #4 0x10c6a0694 in lemon::GraphWriter<lemon::SmartGraph>::run() lgf_writer.h:1573
    #5 0x10c696a0e in checkGraphReaderWriter() lgf_reader_writer_test.cc:394
    #6 0x10c6c1600 in main lgf_reader_writer_test.cc:572
    #7 0x7fff5e6013d4 in start (libdyld.dylib:x86_64+0x163d4)

Address 0x7ffee35a9ce0 is located in stack of thread T0 at offset 2208 in frame
    #0 0x10c69422f in checkGraphReaderWriter() lgf_reader_writer_test.cc:352

  This frame has 71 object(s):
    [32, 368) 'graph' (line 354)
    [432, 436) 'n1' (line 355)
    [448, 452) 'n2' (line 356)
    [464, 468) 'n3' (line 357)
    [480, 484) 'e1' (line 359)
    [496, 500) 'agg.tmp'
    [512, 516) 'agg.tmp9'
    [528, 532) 'e2' (line 360)
    [544, 548) 'agg.tmp16'
    [560, 564) 'agg.tmp17'
    [576, 624) 'node_map' (line 362)
    [656, 704) 'edge_map' (line 367)
    [736, 784) 'arc_map' (line 371)
    [816, 820) 'ref.tmp' (line 372)
    [832, 836) 'agg.tmp61'
    [848, 852) 'ref.tmp73' (line 373)
    [864, 868) 'agg.tmp74'
    [880, 884) 'ref.tmp86' (line 374)
    [896, 900) 'agg.tmp87'
    [912, 916) 'ref.tmp99' (line 375)
    [928, 932) 'agg.tmp100'
    [944, 948) 'attr' (line 377)
    [960, 1224) 'os' (line 379)
    [1296, 1520) 'writer' (line 380)
    [1584, 1608) 'ref.tmp114' (line 382)
    [1648, 1672) 'ref.tmp120' (line 383)
    [1712, 1713) 'ref.tmp123' (line 383)
    [1728, 1752) 'ref.tmp130' (line 384)
    [1792, 1816) 'ref.tmp138' (line 385)
    [1856, 1857) 'ref.tmp141' (line 385)
    [1872, 1896) 'ref.tmp148' (line 386)
    [1936, 1960) 'ref.tmp156' (line 387)
    [2000, 2001) 'ref.tmp159' (line 387)
    [2016, 2040) 'ref.tmp166' (line 388)
    [2080, 2104) 'ref.tmp174' (line 389)
    [2144, 2168) 'ref.tmp182' (line 390)
    [2208, 2212) 'ref.tmp185' (line 390) <== Memory access at offset 2208 is inside this variable
    [2224, 2228) 'agg.tmp186'
    [2240, 2264) 'ref.tmp197' (line 391)
    [2304, 2328) 'ref.tmp205' (line 392)
    [2368, 2369) 'ref.tmp208' (line 392)
    [2384, 2736) 'exp_graph' (line 397)
    [2800, 2848) 'exp_node_map1' (line 398)
    [2880, 2928) 'exp_node_map2' (line 399)
    [2960, 3008) 'exp_edge_map1' (line 400)
    [3040, 3088) 'exp_edge_map2' (line 401)
    [3120, 3168) 'exp_arc_map1' (line 402)
    [3200, 3248) 'exp_arc_map2' (line 403)
    [3280, 3284) 'exp_n2' (line 404)
    [3296, 3300) 'exp_e1' (line 405)
    [3312, 3316) 'exp_a1' (line 406)
    [3328, 3332) 'exp_attr1' (line 407)
    [3344, 3348) 'exp_attr2' (line 408)
    [3360, 3632) 'is' (line 410)
    [3696, 3720) 'ref.tmp237' (line 410)
    [3760, 4280) 'reader' (line 411)
    [4416, 4440) 'ref.tmp248' (line 413)
    [4480, 4504) 'ref.tmp256' (line 414)
    [4544, 4545) 'ref.tmp259' (line 414)
    [4560, 4584) 'ref.tmp266' (line 415)
    [4624, 4648) 'ref.tmp274' (line 416)
    [4688, 4689) 'ref.tmp277' (line 416)
    [4704, 4728) 'ref.tmp284' (line 417)
    [4768, 4792) 'ref.tmp292' (line 418)
    [4832, 4833) 'ref.tmp295' (line 418)
    [4848, 4872) 'ref.tmp302' (line 419)
    [4912, 4936) 'ref.tmp310' (line 420)
    [4976, 5000) 'ref.tmp318' (line 421)
    [5040, 5064) 'ref.tmp326' (line 422)
    [5104, 5128) 'ref.tmp334' (line 423)
    [5168, 5169) 'ref.tmp337' (line 423)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-use-after-scope smart_graph.h:455 in lemon::SmartGraphBase::Arc::operator lemon::SmartGraphBase::Edge() const

Instructions to reproduce:

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS='-fno-omit-frame-pointer -fsanitize=address'
cmake --build . --target check

Change History (0)

Note: See TracTickets for help on using tickets.