NanoSim / Porto

The Porto multi-scale framework
GNU General Public License v3.0
3 stars 3 forks source link

Use Case 1. Coupling of REMARC and Ansys FLUENT gives SEG FAULT #7

Closed sradl1981 closed 7 years ago

sradl1981 commented 7 years ago

seems MongoDB storage causes a problem: sradl@Corellia:~/NanoSim/soft5/porto/examples> valgrind dft-prepare dft/Fe2O3/ dft/thermo.dat ==22420== Memcheck, a memory error detector ==22420== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==22420== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==22420== Command: dft-prepare dft/Fe2O3/ dft/thermo.dat ==22420== ==22420== Conditional jump or move depends on uninitialised value(s) ==22420== at 0x4018298: index (in /lib64/ld-2.22.so) ==22420== by 0x400752D: expand_dynamic_string_token (in /lib64/ld-2.22.so) ==22420== by 0x4008129: _dl_map_object (in /lib64/ld-2.22.so) ==22420== by 0x40013E4: map_doit (in /lib64/ld-2.22.so) ==22420== by 0x400EB73: _dl_catch_error (in /lib64/ld-2.22.so) ==22420== by 0x4000ABE: do_preload (in /lib64/ld-2.22.so) ==22420== by 0x4000EC0: handle_ld_preload (in /lib64/ld-2.22.so) ==22420== by 0x40034F0: dl_main (in /lib64/ld-2.22.so) ==22420== by 0x4016394: _dl_sysdep_start (in /lib64/ld-2.22.so) ==22420== by 0x4004A99: _dl_start (in /lib64/ld-2.22.so) ==22420== by 0x40011F7: ??? (in /lib64/ld-2.22.so) ==22420== by 0x2: ??? ==22420== ==22420== Invalid read of size 8 ==22420== at 0xB3CDA2A: _mongoc_client_new_from_uri (in /usr/lib64/libmongoc-1.0.so.0.0.0) ==22420== by 0xB3CDAE9: mongoc_client_new (in /usr/lib64/libmongoc-1.0.so.0.0.0) ==22420== by 0xACBC932: soft::MongoStrategy::Private::Private(QString const&, QString const&) (mongostrategy.cpp:39) ==22420== by 0xACBB5B6: soft::MongoStrategy::MongoStrategy(char const, char const) (mongostrategy.cpp:70) ==22420== by 0xACBC350: soft::MongoStrategy::create(char const, char const) (mongostrategy.cpp:157) ==22420== by 0x50A52EE: soft::StorageFactory::create(char const, char const, char const) const (storagefactory.cpp:59) ==22420== by 0x50A2A78: soft::createStrategy(char const, char const, char const) (soft.cpp:185) ==22420== by 0x50A5026: soft::Storage::Private::Private(char const, char const, char const) (storage.cpp:12) ==22420== by 0x50A4A30: soft::Storage::Storage(char const, char const, char const) (storage.cpp:31) ==22420== by 0x406DED: main (main.cpp:61) ==22420== Address 0xa0 is not stack'd, malloc'd or (recently) free'd ==22420== ==22420== ==22420== Process terminating with default action of signal 11 (SIGSEGV) ==22420== Access not within mapped region at address 0xA0 ==22420== at 0xB3CDA2A: _mongoc_client_new_from_uri (in /usr/lib64/libmongoc-1.0.so.0.0.0) ==22420== by 0xB3CDAE9: mongoc_client_new (in /usr/lib64/libmongoc-1.0.so.0.0.0) ==22420== by 0xACBC932: soft::MongoStrategy::Private::Private(QString const&, QString const&) (mongostrategy.cpp:39) ==22420== by 0xACBB5B6: soft::MongoStrategy::MongoStrategy(char const, char const) (mongostrategy.cpp:70) ==22420== by 0xACBC350: soft::MongoStrategy::create(char const, char const) (mongostrategy.cpp:157) ==22420== by 0x50A52EE: soft::StorageFactory::create(char const, char const, char const) const (storagefactory.cpp:59) ==22420== by 0x50A2A78: soft::createStrategy(char const, char const, char const) (soft.cpp:185) ==22420== by 0x50A5026: soft::Storage::Private::Private(char const, char const, char const) (storage.cpp:12) ==22420== by 0x50A4A30: soft::Storage::Storage(char const, char const, char const) (storage.cpp:31) ==22420== by 0x406DED: main (main.cpp:61) ==22420== If you believe this happened as a result of a stack ==22420== overflow in your program's main thread (unlikely but ==22420== possible), you can try to increase the size of the ==22420== main thread stack using the --main-stacksize= flag. ==22420== The main thread stack size used in this run was 8388608. ==22420== ==22420== HEAP SUMMARY: ==22420== in use at exit: 142,069 bytes in 334 blocks ==22420== total heap usage: 3,507 allocs, 3,173 frees, 523,389 bytes allocated ==22420== ==22420== LEAK SUMMARY: ==22420== definitely lost: 376 bytes in 1 blocks ==22420== indirectly lost: 5,184 bytes in 18 blocks ==22420== possibly lost: 0 bytes in 0 blocks ==22420== still reachable: 136,509 bytes in 315 blocks ==22420== of which reachable via heuristic: ==22420== stdstring : 370 bytes in 10 blocks ==22420== suppressed: 0 bytes in 0 blocks ==22420== Rerun with --leak-check=full to see details of leaked memory

sradl1981 commented 7 years ago

The problem is the mongoDB backend. The segfault occurs here (in main.cpp of dft-prepare): soft::Storage storage("mongo2", "mongodb://localhost", "db=porto;coll=demo");

My mongoDB configuration is (after issuing mongo in the terminal):

MongoDB shell version v3.4.3 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.2.9 WARNING: shell and server versions do not match Server has startup warnings: 2017-09-30T13:04:23.156+0200 I CONTROL [initandlisten] 2017-09-30T13:04:23.156+0200 I CONTROL [initandlisten] WARNING: /sys/kernel/mm/ansparent_hugepage/enabled is 'always'. 2017-09-30T13:04:23.156+0200 I CONTROL [initandlisten] We suggest settinit to 'never' 2017-09-30T13:04:23.156+0200 I CONTROL [initandlisten]

sradl1981 commented 7 years ago

LD_LIBRARY_PATH contains: /usr/local/soft5/lib64:/usr/local/soft5/lib64/soft5/storage:/usr/local/soft5/lib64/soft5/plugins

Softbase is set to /usr/local/soft5

sradl1981 commented 7 years ago

input from Thomas: Is it possible for you to try to install version 1.2.1 from https://github.com/mongodb/mongo-c-driver (you need to supply the flag to create a share object)

sradl1981 commented 7 years ago

Problem solved: the version of libmongoc-1.0.so.0 is not the problem, there is simply an ugly and undocumented interference with the mongo-c installation that is shipped with soft5 (binaries are placed into $HOME/NanoSim/build-soft5/usr/lib64/build-soft5/usr/lib64/