libnano / primer3-py

Simple oligo analysis and primer design
https://libnano.github.io/primer3-py
GNU General Public License v2.0
169 stars 44 forks source link

memory errors when using a mispriming_lib #14

Closed psudmant closed 8 years ago

psudmant commented 8 years ago

I'm having quite a bit of trouble getting the mispriming_lib to work. I keep getting pointer errors.

* glibc detected * python: free(): invalid pointer: 0x00002aaaabd01ed8 ***

Here's a minimal example that reproduces the problem

import primer3

if __name__=="__main__":

    seq="CCAGTACCAGCCTCAACAGCTGCAGACAGACCGAATGCAGTAGACCAGCTGTCTGATCAAAGTCAAAAGGGTTTCTCTTTTCCTCCTGATCTCCCAGTTTTTTAGTAGCTAATGAGAAAGTTAACAGTTGACCTGCCGGCTTTAAAGGGAGAAGGCAAGGCTAGTGTGAAGCAGAGGTGTTACTTTTTACCATACTCCCGGTAGTGCTACAGGTGATAAGGGGAGAAAGGGAGGGCGAGAAACAGTTTTTGAAGTCAATCCCAAAGAGCCCGAGTTACACAGAATAGCCACTAGGAGATGATGGCAGGGGTACCAATGGGACTTCACTTTTGTATGGGGATTTTTATTTTTTGCTCTTTTTTTATAGTATCAGGGAAGCAAACTGCCTTTTCCAAGTTAGAAAATGCTATGTGAATCTAGTTGAACCAGGGAATACGGAGTGAGCAATATGTAGCTTGAATTACGCGTAAAAGTAGATTTAAAAAGAAAAGAAAAGAAAACAAGACAGAAAAGCGCTGGTTGTCCTTCGTTGCAGTAACGGCAGGCCTGCAGAACTTTGTTGAGGCAGGAGGTAGTGTGTTTGTGCTATCTCAGAAGATGGGCATCGAACAATCAGTTTCGGGGTGTGACGGCGGGGACGGTGGTGGACAGGTACCAAAGCTATTTTCTCATCTGTCCTGTGGACGAGTGGGGTTGTGGAGCCATTGATACTGCACCAGCCGCTCAGACAATCAACAGCACACACTGTTCAAGAAAGAGTCCATCACTTGTACTCGTGGGAGGAGCTTGTCCCATTATAACTCCTCTCCCCATTCCCTGTCACTTGGGGATGATTTCATCTGCGGGTCAGGCTTTCACCACACCACTTGTCTTTCTATTTATTACATAGACTAGAGGATTATGGGTAAAGGCAGGCAGAAGTTGCAGATGCTCGCCCCTTCGGGACTGTCTGAAGGACCTTTCTTTTCCTCCTGCCCCACCCCTCCCCCTTTAAAATAATTTGACACGTTTTTCGTATCTATTTCAGAGTCCTATTTAAAACTATTTATTAGTGACTACAGTACCTAAGACAGCAAGGTTCTTGACATTACAGTTCTCCGACAGTTGATGATCTTGTACTTTATAATGTGCCTTAATAATAATCCTATTTAAGATATTTATTTTTAAGTTTTACTATGCTGCACTCTAAAGGAAGGAACTTTAGAAGTGACACTGTAAAATTATGTATTCATCTCATGGCATAAGTTATTCAGTAGGTCTAGATGTAGCATATTAAATATTAACCTATTCAACTAAAGACGTTGGCTTTGGATTTATTTAAATTCATATGTGCACTGTTCGGGTGGGTACTCTTGCCTAAACATATTTGAGTTTATTTTAGTCTTGAGTTGTTTTACTTTTTTTTTTTTTTTAAACAAGCTACATCGCTGGTTCTGTGCTTCCTCAATTGCTTTCCCCCTGTGGATCTCATGTACCGGGGACTCATGGCATCCCCGCTTTCCTCGTGTAGTGTATGTAGTTTTAAAAGACGGCTTTATATTTTTCCTTCTGAAAGTGAGATACTTGCAATTTTTACTCTTAAACTAAAATGAATACTATTTTACACTGTATTGGACTTTTATACTTGAAGAACTTCCTACAATGGATAATTTTTATGGACTCTCTCCATTGTCACTGGATTTAAGTATTCCTGTGCCGGGCAGTGGTCCGCAAAGGAGGGCGTGGCTCTCCTGTGCAAATTATTTATTTGTTGTGTATTTCGCTTTATAATGTTTCAGATCTTCTCATCTATTCAC"

    seq_args = {"SEQUENCE_ID":"ID_0",
                "SEQUENCE_TEMPLATE":seq}

    global_args = {
        'PRIMER_OPT_SIZE': 20,
        'PRIMER_PICK_INTERNAL_OLIGO': 1,
        'PRIMER_INTERNAL_MAX_SELF_END': 8,
        'PRIMER_MIN_SIZE': 18,
        'PRIMER_MAX_SIZE': 25,
        'PRIMER_OPT_TM': 60.0,
        'PRIMER_MIN_TM': 57.0,
        'PRIMER_MAX_TM': 63.0,
        'PRIMER_MIN_GC': 20.0,
        'PRIMER_MAX_GC': 80.0,
        'PRIMER_MAX_POLY_X': 100,
        'PRIMER_INTERNAL_MAX_POLY_X': 100,
        'PRIMER_SALT_MONOVALENT': 50.0,
        'PRIMER_DNA_CONC': 50.0,
        'PRIMER_MAX_NS_ACCEPTED': 0,
        'PRIMER_MAX_SELF_ANY': 12,
        'PRIMER_MAX_SELF_END': 8,
        'PRIMER_PAIR_MAX_COMPL_ANY': 12,
        'PRIMER_PAIR_MAX_COMPL_END': 8,
        'PRIMER_PRODUCT_SIZE_RANGE': [[100,200]]
    }

    p3_ret = primer3.designPrimers(seq_args,
                                   global_args=global_args,
                                   misprime_lib={'CGAA': 'CGAACGAACGAACGAACGAACGAACGAACGAACGAACGAACGAACGAACGAACGAACGAACGAACGAAC'})

which returns

*** glibc detected *** python: free(): invalid pointer: 0x00002aaaabd01ed8 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x75e66)[0x2aaaab9e7e66]
/home/psudmant/anaconda/lib/python2.7/site-packages/primer3_py-0.4.2-py2.7-linux-x86_64.egg/primer3/primerdesign.so(destroy_seq_lib+0x45)[0x2aaab4972c05]
/home/psudmant/anaconda/lib/python2.7/site-packages/primer3_py-0.4.2-py2.7-linux-x86_64.egg/primer3/primerdesign.so(p3_destroy_global_settings+0x56)[0x2aaab4974356]
/home/psudmant/anaconda/lib/python2.7/site-packages/primer3_py-0.4.2-py2.7-linux-x86_64.egg/primer3/primerdesign.so(+0x7287)[0x2aaab4963287]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5a33)[0x2aaaaadc52a3]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x2aaaaadc6dbe]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x5b8a)[0x2aaaaadc53fa]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x88e)[0x2aaaaadc6dbe]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(PyEval_EvalCode+0x32)[0x2aaaaadc6ed2]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(PyRun_FileExFlags+0xb0)[0x2aaaaade6e10]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(PyRun_SimpleFileExFlags+0xef)[0x2aaaaade6fef]
/home/psudmant/anaconda/bin/../lib/libpython2.7.so.1.0(Py_Main+0xca4)[0x2aaaaadfc8f4]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x2aaaab990d5d]
python[0x400649]
======= Memory map: ========
...

any help would be very much appreciated

benpruitt commented 8 years ago

Thanks for bringing this to our attention @psudmant. I believe the changes in the latest commit (referenced above ^) should correct this issue. Can you pull down this latest commit and let me know if it fixes things for you as well?

psudmant commented 8 years ago

Works perfectly! Thanks much!