Menu

#4 Segmentation fault from build_libint

closed
nobody
None
2014-05-29
2011-04-29
No

summary

A fresh build with gcc 4.5.2 from Macports, configured by
../libint4/configure CXXFLAGS='-std=c++0x' --with-eri-max-am=7 --enable-g12=0 --with-g12-max-am=7
failed with segmentation fault at

DirectedGraph::print_def(): a RR making GenIntegralSet: < l(0) k(1) | TwoPRep | i(0) k(1) > ^ { {0} }
DirectedGraph::print_def(): a RR making GenIntegralSet: < k(0) k(1) | TwoPRep | k(0) k(1) > ^ { {0} }
building GenIntegralSet: < s(0) s(1) | T1_g12 | s(0) s(1) > ^ { {0} }
building GenIntegralSet: < s(0) s(1) | T2_g12 | s(0) s(1) > ^ { {0} }
/bin/sh: line 1: 81067 Segmentation fault /Users/shiozaki/packages/libint4_obj/src/lib/libint/../../../src/bin/libint/build_libint
make[3]: *** [tmp/libint/libint2_params.h] Error 139
make[2]: *** [default] Error 1
make[1]: *** [default] Error 1
make: *** [default] Error 1

Note

There is a comment in src/bin/libint/dg.cc stating that remove_trivial_arithmetics() seems to be broken when working with [Ti,G12]. See far below.

Debugging info

I compiled again with debugging option (--enable-debug and CXXFLAGS="-g -std=c++0x"), it also failed at the same place. Attaching build_libint to debugger gives:

{shiozaki@pro libint4_obj}$ gdb /Users/shiozaki/packages/libint4_obj/src/lib/libint/../../../src/bin/libint/build_libint



(gdb) where

#0 0x00000001000185ce in shared_ptr (this=0x7fff5fbfdce0) at shared_ptr.hpp:169

#1 0x000000010004cbb6 in libint2::DGArc::dest (this=0x100) at dgarc.h:24

#2 0x00000001000426a5 in libint2::DirectedGraph::remove_trivial_arithmetics (this=0x102e93710) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:653

#3 0x0000000100041856 in libint2::DirectedGraph::optimize_rr_out (this=0x102e93710, context=@0x7fff5fbfeb30) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:470

#4 0x0000000100012378 in libint2::GenerateCode (dg=@0x7fff5fbfeb60, context=@0x7fff5fbfeb30, cparams=@0x7fff5fbfef90, strat=@0x7fff5fbfeb50, tactic=@0x7fff5fbfeb40, memman=@0x7fff5fbfeb20, decl_filenames=@0x7fff5fbfe9f0, def_filenames=@0x7fff5fbfe9a0, prefix=@0x7fff5fbfeaf0, label=@0x7fff5fbfeae0, have_parent=false) at buildtest.h:226

#5 0x0000000100016bfb in build_R12kG12_2b_2k (os=@0x100dae140, cparams=@0x7fff5fbfef90, iface=@0x7fff5fbfef70) at /Users/shiozaki/packages/libint4/src/bin/libint/build_libint.cc:804

#6 0x00000001000139bc in try_main (argc=1, argv=0x7fff5fbff230) at /Users/shiozaki/packages/libint4/src/bin/libint/build_libint.cc:273

#7 0x0000000100012be1 in main (argc=1, argv=0x7fff5fbff230) at /Users/shiozaki/packages/libint4/src/bin/libint/build_libint.cc:78


(gdb) list

164 // The object pointed to is deleted when the last shared_ptr pointing to it

165 // is destroyed or reset.

166 //

167

168 template<class T=""> class shared_ptr

169 {

170 private:

171

172 // Borland 5.5.1 specific workaround

173 typedef shared_ptr<T> this_type;


(gdb) up

#1 0x000000010004cbb6 in libint2::DGArc::dest (this=0x100) at dgarc.h:24

24 SafePtr<DGVertex> dest() const { return dest_; }


(gdb) list

19 public:

20 DGArc(const SafePtr<DGVertex>& orig, const SafePtr<DGVertex>& dest);

21 virtual ~DGArc() {}

22
23 SafePtr<DGVertex> orig() const { return orig_; }

24 SafePtr<DGVertex> dest() const { return dest_; }

25
26 /// Print out the arc

27 virtual void print(std::ostream& os) const =0;

28

(gdb) up

#2 0x00000001000426a5 in libint2::DirectedGraph::remove_trivial_arithmetics (this=0x102e93710) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:653

653 SafePtr<DGVertex> right = (*a)->dest();


(gdb) list

648 if (oper_cast) {

649

650 typedef DGVertex::ArcSetType::const_iterator aciter;

651 aciter a = oper_cast->first_exit_arc();

652 SafePtr<DGVertex> left = (*a)->dest(); ++a;

653 SafePtr<DGVertex> right = (*a)->dest();

654
655 // 1.0 * x = x

656 if (left->equiv(prefactors.N_i[1])) {

657 const bool success = remove_vertex_at((vptr),right);


(gdb) up

#3 0x0000000100041856 in libint2::DirectedGraph::optimize_rr_out (this=0x102e93710, context=@0x7fff5fbfeb30) at /Users/shiozaki/packages/libint4/src/bin/libint/dg.cc:470

470 remove_trivial_arithmetics();


(gdb) list

465 DirectedGraph::optimize_rr_out(const SafePtr<CodeContext>& context)

466 {

467 replace_rr_with_expr();

468 // TODO remove_trivial_arithmetics() seems to be broken when working with [Ti,G12], fix!

469 #if 1

470 remove_trivial_arithmetics();

471 #endif

472 handle_trivial_nodes(context);

473 remove_disconnected_vertices();

474 find_subtrees();

Discussion

  • Edward Valeev

    Edward Valeev - 2014-03-05
    • status: open --> closed
     
  • Edward Valeev

    Edward Valeev - 2014-03-05
     

Anonymous
Anonymous

Add attachments
Cancel