Hello everyone,

I've built a bowtie2 parser for mapping reads back to contigs and while my Python parser works perfectly and even produces the files it's supposed too I get error files from Galaxy (and I've used 2>/dev/null at the end of the command). Even when I used Galaxy's job command line after the tool is finished the tool works but inside galaxy I get the following error:

*** Error in `python': double free or corruption (!prev): 0x0000000002debfc0 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7d1fd)[0x7faab1c5d1fd]
/lib64/libc.so.6(fclose+0x155)[0x7faab1c4bae5]
/home/galaxy_coverall/galaxy/eggs/pysam-0.4.2_kanwei_b10f6e722e9a-py2.7-linux-x86_64-ucs4.egg/csamtools.so(bam_index_load_literal+0x37)[0x7faaa43c2ad7]
/home/galaxy_coverall/galaxy/eggs/pysam-0.4.2_kanwei_b10f6e722e9a-py2.7-linux-x86_64-ucs4.egg/csamtools.so(+0x6e7f8)[0x7faaa43ae7f8]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7faab292a073]
/lib64/libpython2.7.so.1.0(PyEval_CallObjectWithKeywords+0x47)[0x7faab29bbfd7]
/home/galaxy_coverall/galaxy/eggs/pysam-0.4.2_kanwei_b10f6e722e9a-py2.7-linux-x86_64-ucs4.egg/csamtools.so(+0x52a04)[0x7faaa4392a04]
/lib64/libpython2.7.so.1.0(+0x9fe13)[0x7faab297fe13]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7faab292a073]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x1d4c)[0x7faab29be32c]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7faab29c218d]
/lib64/libpython2.7.so.1.0(+0x6f17d)[0x7faab294f17d]
/lib64/libpython2.7.so.1.0(PyObject_Call+0x43)[0x7faab292a073]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0xde7)[0x7faab29bd3c7]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4350)[0x7faab29c0930]
/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x4350)[0x7faab29c0930]
/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x7ed)[0x7faab29c218d]
/lib64/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x7faab29c2292]
/lib64/libpython2.7.so.1.0(+0xfb6cf)[0x7faab29db6cf]
/lib64/libpython2.7.so.1.0(PyRun_FileExFlags+0x7e)[0x7faab29dc88e]
/lib64/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0xe9)[0x7faab29ddb19]
/lib64/libpython2.7.so.1.0(Py_Main+0xc9f)[0x7faab29eeb1f]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7faab1c01af5]
python[0x400721]
======= Memory map: ========
00400000-00401000 r-xp 00000000 fd:00 134966341                          /usr/bin/python2.7
00600000-00601000 r--p 00000000 fd:00 134966341                          /usr/bin/python2.7
00601000-00602000 rw-p 00001000 fd:00 134966341                          /usr/bin/python2.7
011a1000-064ce000 rw-p 00000000 00:00 0                                  [heap]
7faaa15c8000-7faaa15dd000 r-xp 00000000 fd:00 205646465                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7faaa15dd000-7faaa17dc000 ---p 00015000 fd:00 205646465                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7faaa17dc000-7faaa17dd000 r--p 00014000 fd:00 205646465                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7faaa17dd000-7faaa17de000 rw-p 00015000 fd:00 205646465                  /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7faaa17e0000-7faaa1807000 r-xp 00000000 fd:00 201394264                  /usr/lib64/libexpat.so.1.6.0
7faaa1807000-7faaa1a07000 ---p 00027000 fd:00 201394264                  /usr/lib64/libexpat.so.1.6.0
7faaa1a07000-7faaa1a09000 r--p 00027000 fd:00 201394264                  /usr/lib64/libexpat.so.1.6.0
7faaa1a09000-7faaa1a0a000 rw-p 00029000 fd:00 201394264                  /usr/lib64/libexpat.so.1.6.0
7faaa1a10000-7faaa1a1b000 r-xp 00000000 fd:00 134861759                  /usr/lib64/python2.7/lib-dynload/pyexpat.so
7faaa1a1b000-7faaa1c1a000 ---p 0000b000 fd:00 134861759                  /usr/lib64/python2.7/lib-dynload/pyexpat.so
7faaa1c1a000-7faaa1c1b000 r--p 0000a000 fd:00 134861759                  /usr/lib64/python2.7/lib-dynload/pyexpat.so
7faaa1c1b000-7faaa1c1d000 rw-p 0000b000 fd:00 134861759                  /usr/lib64/python2.7/lib-dynload/pyexpat.so
7faaa1c20000-7faaa1c22000 r-xp 00000000 fd:02 423758729                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/diffhelpers.so
7faaa1c22000-7faaa1d21000 ---p 00002000 fd:02 423758729                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/diffhelpers.so
7faaa1d21000-7faaa1d22000 rw-p 00001000 fd:02 423758729                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/diffhelpers.so
7faaa1d28000-7faaa1d32000 r-xp 00000000 fd:02 423758731                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/parsers.so
7faaa1d32000-7faaa1e32000 ---p 0000a000 fd:02 423758731                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/parsers.so
7faaa1e32000-7faaa1e33000 rw-p 0000a000 fd:02 423758731                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/parsers.so
7faaa1e38000-7faaa1e3a000 r-xp 00000000 fd:02 423758730                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/mpatch.so
7faaa1e3a000-7faaa1f39000 ---p 00002000 fd:02 423758730                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/mpatch.so
7faaa1f39000-7faaa1f3a000 rw-p 00001000 fd:02 423758730                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/mpatch.so
7faaa1f40000-7faaa1f43000 r-xp 00000000 fd:02 423758728                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/bdiff.so
7faaa1f43000-7faaa2042000 ---p 00003000 fd:02 423758728                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/bdiff.so
7faaa2042000-7faaa2043000 rw-p 00002000 fd:02 423758728                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/bdiff.so
7faaa2048000-7faaa204a000 r-xp 00000000 fd:02 423758727                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/base85.so
7faaa204a000-7faaa2149000 ---p 00002000 fd:02 423758727                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/base85.so
7faaa2149000-7faaa214a000 rw-p 00001000 fd:02 423758727                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/base85.so
7faaa2150000-7faaa2154000 r-xp 00000000 fd:00 134861771                  /usr/lib64/python2.7/lib-dynload/termios.so
7faaa2154000-7faaa2353000 ---p 00004000 fd:00 134861771                  /usr/lib64/python2.7/lib-dynload/termios.so
7faaa2353000-7faaa2354000 r--p 00003000 fd:00 134861771                  /usr/lib64/python2.7/lib-dynload/termios.so
7faaa2354000-7faaa2356000 rw-p 00004000 fd:00 134861771                  /usr/lib64/python2.7/lib-dynload/termios.so
7faaa2358000-7faaa235a000 r-xp 00000000 fd:02 423758732                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/osutil.so
7faaa235a000-7faaa245a000 ---p 00002000 fd:02 423758732                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/osutil.so
7faaa245a000-7faaa245b000 rw-p 00002000 fd:02 423758732                  /home/galaxy_coverall/galaxy/eggs/mercurial-3.2.4-py2.7-linux-x86_64-ucs4.egg/mercurial/osutil.so
7faaa2460000-7faaa2466000 r-xp 00000000 fd:00 137235630                  /usr/lib64/python2.7/lib-dynload/_multiprocessing.so
7faaa2466000-7faaa2665000 ---p 00006000 fd:00 137235630                  /usr/lib64/python2.7/lib-dynload/_multiprocessing.so
7faaa2665000-7faaa2666000 r--p 00005000 fd:00 137235630                  /usr/lib64/python2.7/lib-dynload/_multiprocessing.so
7faaa2666000-7faaa2667000 rw-p 00006000 fd:00 137235630                  /usr/lib64/python2.7/lib-dynload/_multiprocessing.so
7faaa2668000-7faaa267f000 r-xp 00000000 fd:02 9071725518                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bigwig_file.so
7faaa267f000-7faaa277f000 ---p 00017000 fd:02 9071725518                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bigwig_file.so
7faaa277f000-7faaa2781000 rw-p 00017000 fd:02 9071725518                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bigwig_file.so
7faaa2781000-7faaa2782000 rw-p 00000000 00:00 0 
7faaa2788000-7faaa2796000 r-xp 00000000 fd:02 9071725516                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/cirtree_file.so
7faaa2796000-7faaa2895000 ---p 0000e000 fd:02 9071725516                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/cirtree_file.so
7faaa2895000-7faaa2897000 rw-p 0000d000 fd:02 9071725516                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/cirtree_file.so
7faaa2898000-7faaa28a0000 r-xp 00000000 fd:02 9071725515                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bpt_file.so
7faaa28a0000-7faaa29a0000 ---p 00008000 fd:02 9071725515                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bpt_file.so
7faaa29a0000-7faaa29a1000 rw-p 00008000 fd:02 9071725515                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bpt_file.so
7faaa29a8000-7faaa29d3000 r-xp 00000000 fd:02 9071725517                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bbi_file.so
7faaa29d3000-7faaa2ad3000 ---p 0002b000 fd:02 9071725517                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bbi_file.so
7faaa2ad3000-7faaa2ad6000 rw-p 0002b000 fd:02 9071725517                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bbi_file.so
7faaa2ad6000-7faaa2ad7000 rw-p 00000000 00:00 0 
7faaa2ad8000-7faaa2ae6000 r-xp 00000000 fd:02 9071725519                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bigbed_file.so
7faaa2ae6000-7faaa2be6000 ---p 0000e000 fd:02 9071725519                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bigbed_file.so
7faaa2be6000-7faaa2be8000 rw-p 0000e000 fd:02 9071725519                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bbi/bigbed_file.so
7faaa2be8000-7faaa2be9000 rw-p 00000000 00:00 0 
7faaa2bf0000-7faaa2bf7000 r-xp 00000000 fd:00 201393931                  /usr/lib64/librt-2.17.so
7faaa2bf7000-7faaa2df6000 ---p 00007000 fd:00 201393931                  /usr/lib64/librt-2.17.so
7faaa2df6000-7faaa2df7000 r--p 00006000 fd:00 201393931                  /usr/lib64/librt-2.17.so
7faaa2df7000-7faaa2df8000 rw-p 00007000 fd:00 201393931                  /usr/lib64/librt-2.17.so
7faaa2df8000-7faaa2dfa000 r-xp 00000000 fd:02 9072320053                 /home/galaxy_coverall/galaxy/eggs/MarkupSafe-0.12-py2.7-linux-x86_64-ucs4.egg/markupsafe/_speedups.so
7faaa2dfa000-7faaa2ef9000 ---p 00002000 fd:02 9072320053                 /home/galaxy_coverall/galaxy/eggs/MarkupSafe-0.12-py2.7-linux-x86_64-ucs4.egg/markupsafe/_speedups.so
7faaa2ef9000-7faaa2efa000 rw-p 00001000 fd:02 9072320053                 /home/galaxy_coverall/galaxy/eggs/MarkupSafe-0.12-py2.7-linux-x86_64-ucs4.egg/markupsafe/_speedups.so
7faaa2f00000-7faaa2f0a000 r-xp 00000000 fd:02 423762146                  /home/galaxy_coverall/.python-eggs/pycrypto-2.5-py2.7-linux-x86_64-ucs4.egg-tmp/Crypto/Cipher/Blowfish.so
7faaa2f0a000-7faaa3009000 ---p 0000a000 fd:02 423762146                  /home/galaxy_coverall/.python-eggs/pycrypto-2.5-py2.7-linux-x86_64-ucs4.egg-tmp/Crypto/Cipher/Blowfish.so
7faaa3009000-7faaa300a000 rw-p 00009000 fd:02 423762146                  /home/galaxy_coverall/.python-eggs/pycrypto-2.5-py2.7-linux-x86_64-ucs4.egg-tmp/Crypto/Cipher/Blowfish.so
7faaa3010000-7faaa3013000 r-xp 00000000 fd:02 4675969741                 /home/galaxy_coverall/galaxy/eggs/Cheetah-2.2.2-py2.7-linux-x86_64-ucs4.egg/Cheetah/_namemapper.so
7faaa3013000-7faaa3112000 ---p 00003000 fd:02 4675969741                 /home/galaxy_coverall/galaxy/eggs/Cheetah-2.2.2-py2.7-linux-x86_64-ucs4.egg/Cheetah/_namemapper.so
7faaa3112000-7faaa3113000 rw-p 00002000 fd:02 4675969741                 /home/galaxy_coverall/galaxy/eggs/Cheetah-2.2.2-py2.7-linux-x86_64-ucs4.egg/Cheetah/_namemapper.so
7faaa3118000-7faaa3139000 r-xp 00000000 fd:02 423824891                  /home/galaxy_coverall/.python-eggs/python_lzo-1.08_2.03_static-py2.7-linux-x86_64-ucs4.egg-tmp/lzo.so
7faaa3139000-7faaa3239000 ---p 00021000 fd:02 423824891                  /home/galaxy_coverall/.python-eggs/python_lzo-1.08_2.03_static-py2.7-linux-x86_64-ucs4.egg-tmp/lzo.so
7faaa3239000-7faaa323a000 rw-p 00021000 fd:02 423824891                  /home/galaxy_coverall/.python-eggs/python_lzo-1.08_2.03_static-py2.7-linux-x86_64-ucs4.egg-tmp/lzo.so
7faaa3240000-7faaa3248000 r-xp 00000000 fd:02 13260234458                /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/misc/_seekbzip2.so
7faaa3248000-7faaa3348000 ---p 00008000 fd:02 13260234458                /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/misc/_seekbzip2.so
7faaa3348000-7faaa3349000 rw-p 00008000 fd:02 13260234458                /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/misc/_seekbzip2.so
7faaa3350000-7faaa3354000 r-xp 00000000 fd:02 9071725431                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/align/_core.so
7faaa3354000-7faaa3453000 ---p 00004000 fd:02 9071725431                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/align/_core.so
7faaa3453000-7faaa3454000 rw-p 00003000 fd:02 9071725431                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/align/_core.so
7faaa3458000-7faaa3467000 r-xp 00000000 fd:02 4675969882                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bitset.so
7faaa3467000-7faaa3567000 ---p 0000f000 fd:02 4675969882                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bitset.so
7faaa3567000-7faaa3569000 rw-p 0000f000 fd:02 4675969882                 /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/bitset.so
7faaa3570000-7faaa3584000 r-xp 00000000 fd:02 390174777                  /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/intervals/intersection.so
7faaa3584000-7faaa3683000 ---p 00014000 fd:02 390174777                  /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/intervals/intersection.so
7faaa3683000-7faaa3686000 rw-p 00013000 fd:02 390174777                  /home/galaxy_coverall/galaxy/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/bx/intervals/intersection.so
7faaa3688000-7faaa36ce000 r-xp 00000000 fd:02 423758022                  /home/galaxy_coverall/galaxy/eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/random/mtrand.so
7faaa36ce000-7faaa37cd000 ---p 00046000 fd:02 423758022                  /home/galaxy_coverall/galaxy/eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/random/mtrand.so
7faaa37cd000-7faaa3802000 rw-p 00045000 fd:02 423758022                  /home/galaxy_coverall/galaxy/eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/random/mtrand.so
7faaa3802000-7faaa3803000 rw-p 00000000 00:00 0 
7faaa3808000-7faaa3811000 r-xp 00000000 fd:02 423758008                  /home/galaxy_coverall/galaxy/eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/fft/fftpack_lite.so
7faaa3811000-7faaa3910000 ---p 00009000 fd:02 423758008                  /home/galaxy_coverall/galaxy/eggs/numpy-1.6.0-py2.7-linux-x86_64-ucs4.egg/numpy/fft/fftpack_lite.so
7fa
..
              /usr/lib64/libcom_err.so.2.1
7faaa82c3000-7faaa84c2000 ---p 00003000 fd:00 201394128                  /usr/lib64/libcom_err.so.2.1
7faaa84c2000-7faaa84c3000 r--p 00002000 fd:00 201394128                  /usr/lib64/libcom_err.so.2.1
7faaa84c3000-7faaa84c4000 rw-p 00003000 fd:00 201394128                  /usr/lib64/libcom_err.so.2.1
7faaa84c8000-7faaa859b000 r-xp 00000000 fd:00 202456210                  /usr/lib64/libkrb5.so.3.3
7faaa859b000-7faaa879b000 ---p 000d3000 fd:00 202456210                  /usr/lib64/libkrb5.so.3.3
7faaa879b000-7faaa87a8000 r--p 000d3000 fd:00 202456210                  /usr/lib64/libkrb5.so.3.3
7faaa87a8000-7faaa87ab000 rw-p 000e0000 fd:00 202456210                  /usr/lib64/libkrb5.so.3.3
7faaa87b0000-7faaa87f9000 r-xp 00000000 fd:00 202456196                  /usr/lib64/libgssapi_krb5.so.2.2
7faaa87f9000-7faaa89f9000 ---p 00049000 fd:00 202456196                  /usr/lib64/libgssapi_krb5.so.2.2
7faaa89f9000-7faaa89fa000 r--p 00049000 fd:00 202456196                  /usr/lib64/libgssapi_krb5.so.2.2
7faaa89fa000-7faaa89fc000 rw-p 0004a000 fd:00 202456196                  /usr/lib64/libgssapi_krb5.so.2.2
7faaa8a00000-7faaa8bbd000 r-xp 00000000 fd:00 206095466                  /usr/lib64/libcrypto.so.1.0.1e
7faaa8bbd000-7faaa8dbd000 ---p 001bd000 fd:00 206095466                  /usr/lib64/libcrypto.so.1.0.1e
7faaa8dbd000-7faaa8dd7000 r--p 001bd000 fd:00 206095466                  /usr/lib64/libcrypto.so.1.0.1e
7faaa8dd7000-7faaa8de3000 rw-p 001d7000 fd:00 206095466                  /usr/lib64/libcrypto.so.1.0.1e
7faaa8de3000-7faaa8de7000 rw-p 00000000 00:00 0 
7faaa8de8000-7faaa8e4b000 r-xp 00000000 fd:00 206095468                  /usr/lib64/libssl.so.1.0.1e
7faaa8e4b000-7faaa904a000 ---p 00063000 fd:00 206095468                  /usr/lib64/libssl.so.1.0.1e
7faaa904a000-7faaa904e000 r--p 00062000 fd:00 206095468                  /usr/lib64/libssl.so.1.0.1e
7faaa904e000-7faaa9055000 rw-p 00066000 fd:00 206095468                  /usr/lib64/libssl.so.1.0.1e
7faaa9058000-7faaa9060000 r-xp 00000000 fd:00 137235634                  /usr/lib64/python2.7/lib-dynload/_ssl.so
7faaa9060000-7faaa925f000 ---p 00008000 fd:00 137235634                  /usr/lib64/python2.7/lib-dynload/_ssl.so
7faaa925f000-7faaa9260000 r--p 00007000 fd:00 137235634                  /usr/lib64/python2.7/lib-dynload/_ssl.so
7faaa9260000-7faaa9261000 rw-p 00008000 fd:00 137235634                  /usr/lib64/python2.7/lib-dynload/_ssl.so
7faaa9268000-7faaa926b000 r-xp 00000000 fd:00 137235621                  /usr/lib64/python2.7/lib-dynload/_functoolsmodule.so
7faaa926b000-7faaa946a000 ---p 00003000 fd:00 137235621                  /usr/lib64/python2.7/lib-dynload/_functoolsmodule.so
7faaa946a000-7faaa946b000 r--p 00002000 fd:00 137235621                  /usr/lib64/python2.7/lib-dynload/_functoolsmodule.so
7faaa946b000-7faaa946c000 rw-p 00003000 fd:00 137235621                  /usr/lib64/python2.7/lib-dynload/_functoolsmodule.so
7faaa9470000-7faaa947f000 r-xp 00000000 fd:00 137235632                  /usr/lib64/python2.7/lib-dynload/_socketmodule.so
7faaa947f000-7faaa967e000 ---p 0000f000 fd:00 137235632                  /usr/lib64/python2.7/lib-dynload/_socketmodule.so
7faaa967e000-7faaa967f000 r--p 0000e000 fd:00 137235632                  /usr/lib64/python2.7/lib-dynload/_socketmodule.so
7faaa967f000-7faaa9684000 rw-p 0000f000 fd:00 137235632                  /usr/lib64/python2.7/lib-dynload/_socketmodule.so
7faaa9686000-7faaa96c7000 rw-p 00000000 00:00 0 
7faaa9788000-7faaa979d000 r-xp 00000000 fd:00 205643504                  /usr/lib64/libz.so.1.2.7
7faaa979d000-7faaa999c000 ---p 00015000 fd:00 205643504                  /usr/lib64/libz.so.1.2.7
7faaa999c000-7faaa999d000 r--p 00014000 fd:00 205643504                  /usr/lib64/libz.so.1.2.7
7faaa999d000-7faaa999e000 rw-p 00015000 fd:00 205643504                  /usr/lib64/libz.so.1.2.7
7faaa99b8000-7faaa99bc000 r-xp 00000000 fd:00 134861781                  /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7faaa99bc000-7faaa9bbb000 ---p 00004000 fd:00 134861781                  /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7faaa9bbb000-7faaa9bbc000 r--p 00003000 fd:00 134861781                  /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7faaa9bbc000-7faaa9bbe000 rw-p 00004000 fd:00 134861781                  /usr/lib64/python2.7/lib-dynload/zlibmodule.so
7faaa9bc0000-7faaa9bdc000 r-xp 00000000 fd:00 137235625                  /usr/lib64/python2.7/lib-dynload/_io.so
7faaa9bdc000-7faaa9ddb000 ---p 0001c000 fd:00 137235625                  /usr/lib64/python2.7/lib-dynload/_io.so
7faaa9ddb000-7faaa9ddc000 r--p 0001b000 fd:00 137235625                  /usr/lib64/python2.7/lib-dynload/_io.so
7faaa9ddc000-7faaa9de6000 rw-p 0001c000 fd:00 137235625                  /usr/lib64/python2.7/lib-dynload/_io.so
7faaa9de8000-7faaa9dea000 r-xp 00000000 fd:00 134861735                  /usr/lib64/python2.7/lib-dynload/grpmodule.so
7faaa9dea000-7faaa9fe9000 ---p 00002000 fd:00 134861735                  /usr/lib64/python2.7/lib-dynload/grpmodule.so
7faaa9fe9000-7faaa9fea000 r--p 00001000 fd:00 134861735                  /usr/lib64/python2.7/lib-dynload/grpmodule.so
7faaa9fea000-7faaa9feb000 rw-p 00002000 fd:00 134861735                  /usr/lib64/python2.7/lib-dynload/grpmodule.so
7faaa9fef000-7faaaa030000 rw-p 00000000 00:00 0 
7faaaa030000-7faaaa035000 r-xp 00000000 fd:00 134861768                  /usr/lib64/python2.7/lib-dynload/stropmodule.so
7faaaa035000-7faaaa234000 ---p 00005000 fd:00 134861768                  /usr/lib64/python2.7/lib-dynload/stropmodule.so
7faaaa234000-7faaaa235000 r--p 00004000 fd:00 134861768                  /usr/lib64/python2.7/lib-dynload/stropmodule.so
7faaaa235000-7faaaa237000 rw-p 00005000 fd:00 134861768                  /usr/lib64/python2.7/lib-dynload/stropmodule.so
7faaaa238000-7faaaa23b000 r-xp 00000000 fd:00 137235623                  /usr/lib64/python2.7/lib-dynload/_heapq.so
7faaaa23b000-7faaaa43a000 ---p 00003000 fd:00 137235623                  /usr/lib64/python2.7/lib-dynload/_heapq.so
7faaaa43a000-7faaaa43b000 r--p 00002000 fd:00 137235623                  /usr/lib64/python2.7/lib-dynload/_heapq.so
7faaaa43b000-7faaaa43d000 rw-p 00003000 fd:00 137235623                  /usr/lib64/python2.7/lib-dynload/_heapq.so
7faaaa440000-7faaaa44a000 r-xp 00000000 fd:00 134861739                  /usr/lib64/python2.7/lib-dynload/itertoolsmodule.so
7faaaa44a000-7faaaa649000 ---p 0000a000 fd:00 134861739                  /usr/lib64/python2.7/lib-dynload/itertoolsmodule.so
7faaaa649000-7faaaa64a000 r--p 00009000 fd:00 134861739                  /usr/lib64/python2.7/lib-dynload/itertoolsmodule.so
7faaaa64a000-7faaaa64f000 rw-p 0000a000 fd:00 134861739                  /usr/lib64/python2.7/lib-dynload/itertoolsmodule.so
7faaaa650000-7faaaa658000 r-xp 00000000 fd:00 134861755                  /usr/lib64/python2.7/lib-dynload/operator.so
7faaaa658000-7faaaa858000 ---p 00008000 fd:00 134861755                  /usr/lib64/python2.7/lib-dynload/operator.so
7faaaa858000-7faaaa859000 r--p 00008000 fd:00 134861755                  /usr/lib64/python2.7/lib-dynload/operator.so
7faaaa859000-7faaaa85b000 rw-p 00009000 fd:00 134861755                  /usr/lib64/python2.7/lib-dynload/operator.so
7faaaa860000-7faaaa866000 r-xp 00000000 fd:00 134861692                  /usr/lib64/python2.7/lib-dynload/_collectionsmodule.so
7faaaa866000-7faaaaa65000 ---p 00006000 fd:00 134861692                  /usr/lib64/python2.7/lib-dynload/_collectionsmodule.so
7faaaaa65000-7faaaaa66000 r--p 00005000 fd:00 134861692                  /usr/lib64/python2.7/lib-dynload/_collectionsmodule.so
7faaaaa66000-7faaaaa68000 rw-p 00006000 fd:00 134861692                  /usr/lib64/python2.7/lib-dynload/_collectionsmodule.so
7faaaaa68000-7faaaaa6c000 r-xp 00000000 fd:00 134861772                  /usr/lib64/python2.7/lib-dynload/timemodule.so
7faaaaa6c000-7faaaac6b000 ---p 00004000 fd:00 134861772                  /usr/lib64/python2.7/lib-dynload/timemodule.so
7faaaac6b000-7faaaac6c000 r--p 00003000 fd:00 134861772                  /usr/lib64/python2.7/lib-dynload/timemodule.so
7faaaac6c000-7faaaac6e000 rw-p 00004000 fd:00 134861772                  /usr/lib64/python2.7/lib-dynload/timemodule.so
7faaaac70000-7faaaac75000 r-xp 00000000 fd:00 137235638                  /usr/lib64/python2.7/lib-dynload/binascii.so
7faaaac75000-7faaaae74000 ---p 00005000 fd:00 137235638                  /usr/lib64/python2.7/lib-dynload/binascii.so
7faaaae74000-7faaaae75000 r--p 00004000 fd:00 137235638                  /usr/lib64/python2.7/lib-dynload/binascii.so
7faaaae75000-7faaaae76000 rw-p 00005000 fd:00 137235638                  /usr/lib64/python2.7/lib-dynload/binascii.so
7faaaae78000-7faaaae80000 r-xp 00000000 fd:00 137235626                  /usr/lib64/python2.7/lib-dynload/_json.so
7faaaae80000-7faaab07f000 ---p 00008000 fd:00 137235626                  /usr/lib64/python2.7/lib-dynload/_json.so
7faaab07f000-7faaab080000 r--p 00007000 fd:00 137235626                  /usr/lib64/python2.7/lib-dynload/_json.so
7faaab080000-7faaab081000 rw-p 00008000 fd:00 137235626                  /usr/lib64/python2.7/lib-dynload/_json.so
7faaab088000-7faaab08f000 r-xp 00000000 fd:00 137235635                  /usr/lib64/python2.7/lib-dynload/_struct.so
7faaab08f000-7faaab28e000 ---p 00007000 fd:00 137235635                  /usr/lib64/python2.7/lib-dynload/_struct.so
7faaab28e000-7faaab28f000 r--p 00006000 fd:00 137235635                  /usr/lib64/python2.7/lib-dynload/_struct.so
7faaab28f000-7faaab291000 rw-p 00007000 fd:00 137235635                  /usr/lib64/python2.7/lib-dynload/_struct.so
7faaab298000-7faaab29c000 r-xp 00000000 fd:00 137235641                  /usr/lib64/python2.7/lib-dynload/cStringIO.so
7faaab29c000-7faaab49b000 ---p 00004000 fd:00 137235641                  /usr/lib64/python2.7/lib-dynload/cStringIO.so
7faaab49b000-7faaab49c000 r--p 00003000 fd:00 137235641                  /usr/lib64/python2.7/lib-dynload/cStringIO.so
7faaab49c000-7faaab49e000 rw-p 00004000 fd:00 137235641                  /usr/lib64/python2.7/lib-dynload/cStringIO.so
7faaab4a0000-7faaab4b2000 r-xp 00000000 fd:00 137235640                  /usr/lib64/python2.7/lib-dynload/cPickle.so
7faaab4b2000-7faaab6b2000 ---p 00012000 fd:00 137235640                  /usr/lib64/python2.7/lib-dynload/cPickle.so
7faaab6b2000-7faaab6b3000 r--p 00012000 fd:00 137235640                  /usr/lib64/python2.7/lib-dynload/cPickle.so
7faaab6b3000-7faaab6b4000 rw-p 00013000 fd:00 137235640                  /usr/lib64/python2.7/lib-dynload/cPickle.so
7faaab6b8000-7faab1bdf000 r--p 00000000 fd:00 201393959                  /usr/lib/locale/locale-archive
7faab1be0000-7faab1d96000 r-xp 00000000 fd:00 201393901                  /usr/lib64/libc-2.17.so
7faab1d96000-7faab1f96000 ---p 001b6000 fd:00 201393901                  /usr/lib64/libc-2.17.so
7faab1f96000-7faab1f9a000 r--p 001b6000 fd:00 201393901                  /usr/lib64/libc-2.17.so
7faab1f9a000-7faab1f9c000 rw-p 001ba000 fd:00 201393901                  /usr/lib64/libc-2.17.so
7faab1f9c000-7faab1fa1000 rw-p 00000000 00:00 0 
7faab1fa8000-7faab20a9000 r-xp 00000000 fd:00 201393909                  /usr/lib64/libm-2.17.so
7faab20a9000-7faab22a8000 ---p 00101000 fd:00 201393909                  /usr/lib64/libm-2.17.so
7faab22a8000-7faab22a9000 r--p 00100000 fd:00 201393909                  /usr/lib64/libm-2.17.so
7faab22a9000-7faab22aa000 rw-p 00101000 fd:00 201393909                  /usr/lib64/libm-2.17.so
7faab22b0000-7faab22b2000 r-xp 00000000 fd:00 201393935                  /usr/lib64/libutil-2.17.so
7faab22b2000-7faab24b1000 ---p 00002000 fd:00 201393935                  /usr/lib64/libutil-2.17.so
7faab24b1000-7faab24b2000 r--p 00001000 fd:00 201393935                  /usr/lib64/libutil-2.17.so
7faab24b2000-7faab24b3000 rw-p 00002000 fd:00 201393935                  /usr/lib64/libutil-2.17.so
7faab24b8000-7faab24bb000 r-xp 00000000 fd:00 201393907                  /usr/lib64/libdl-2.17.so
7faab24bb000-7faab26ba000 ---p 00003000 fd:00 201393907                  /usr/lib64/libdl-2.17.so
7faab26ba000-7faab26bb000 r--p 00002000 fd:00 201393907                  /usr/lib64/libdl-2.17.so
7faab26bb000-7faab26bc000 rw-p 00003000 fd:00 201393907                  /usr/lib64/libdl-2.17.so
7faab26c0000-7faab26d6000 r-xp 00000000 fd:00 201393927                  /usr/lib64/libpthread-2.17.so
7faab26d6000-7faab28d6000 ---p 00016000 fd:00 201393927                  /usr/lib64/libpthread-2.17.so
7faab28d6000-7faab28d7000 r--p 00016000 fd:00 201393927                  /usr/lib64/libpthread-2.17.so
7faab28d7000-7faab28d8000 rw-p 00017000 fd:00 201393927                  /usr/lib64/libpthread-2.17.so
7faab28d8000-7faab28dc000 rw-p 00000000 00:00 0 
7faab28e0000-7faab2a58000 r-xp 00000000 fd:00 206021639                  /usr/lib64/libpython2.7.so.1.0
7faab2a58000-7faab2c58000 ---p 00178000 fd:00 206021639                  /usr/lib64/libpython2.7.so.1.0
7faab2c58000-7faab2c59000 r--p 00178000 fd:00 206021639                  /usr/lib64/libpython2.7.so.1.0
7faab2c59000-7faab2c97000 rw-p 00179000 fd:00 206021639                  /usr/lib64/libpython2.7.so.1.0
7faab2c97000-7faab2ca6000 rw-p 00000000 00:00 0 
7faab2ca8000-7faab2cc9000 r-xp 00000000 fd:00 201393894                  /usr/lib64/ld-2.17.so
7faab2ccd000-7faab2e12000 rw-p 00000000 00:00 0 
7faab2e41000-7faab2ec9000 rw-p 00000000 00:00 0 
7faab2ec9000-7faab2eca000 r--p 00021000 fd:00 201393894                  /usr/lib64/ld-2.17.so
7faab2eca000-7faab2ecb000 rw-p 00022000 fd:00 201393894                  /usr/lib64/ld-2.17.so
7faab2ecb000-7faab2ecd000 rw-p 00000000 00:00 0 
7faab2ecd000-7faab2ecf000 rw-p 00000000 00:00 0 
7ffc473a7000-7ffc473c9000 rw-p 00000000 00:00 0                          [stack]
7ffc473e0000-7ffc473e2000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/galaxy_30.sh: line 21: 38559 Aborted                 (core dumped) python "/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/set_metadata_CkVy0K.py" "/home/galaxy_coverall/galaxy/database/tmp/tmpKjfqUF" "/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/galaxy.json" "/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_in_HistoryDatasetAssociation_49_0OTW3F,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_kwds_HistoryDatasetAssociation_49_HjgVuR,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_out_HistoryDatasetAssociation_49_on8AdF,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_results_HistoryDatasetAssociation_49_CnZVLx,/home/galaxy_coverall/galaxy/database/files2/001/dataset_1739.dat,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_override_HistoryDatasetAssociation_49_KSfIN1" "/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_in_HistoryDatasetAssociation_50_hwtfVm,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_kwds_HistoryDatasetAssociation_50_h1vk_m,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_out_HistoryDatasetAssociation_50_nT4xXj,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_results_HistoryDatasetAssociation_50_KaNi5o,/home/galaxy_coverall/galaxy/database/files2/001/dataset_1740.dat,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_override_HistoryDatasetAssociation_50_CHPwpR" "/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_in_HistoryDatasetAssociation_51_qFch9V,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_kwds_HistoryDatasetAssociation_51__ijkKo,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_out_HistoryDatasetAssociation_51_zvlnQn,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_results_HistoryDatasetAssociation_51_UhLJnu,/home/galaxy_coverall/galaxy/database/files2/001/dataset_1741.dat,/home/galaxy_coverall/galaxy/database/job_working_directory2/000/30/metadata_override_HistoryDatasetAssociation_51_4t9S_g" 5242880
 
My parser does the following:
1) Creates a sam file from an already indexed contig file
2) Calls samtools to create the appropriate bam file
3) Calls samtools again to create the appropriate sorted bam file

I've commented the steps one by one and the problem starts at the mapping (even though the scripts does continue to work and produces the files it's supposed too in the 'database/files/' directory)

Has anyone encountered something like that before?

Kind regards,
Makis Ladoukakis