Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidkip
    Junior Member
    • Dec 2009
    • 6

    #1

    BFAST malloc error under OS X

    Hi

    I have been using BFAST successfully for ABI alignment to hg18 for a while now. I have fresh installs of versions 0.6.1c, 0.6.3c and the latest 0.6.4e. Each version is make by

    sh autogen.sh
    ./configure
    make


    Depending which I point PATH to I find that the first two work fine under Mac OS 10.5.8 on a lowly Duocore/4Gb machine, but the most recent version falls over when making a reference index from an exons files.

    So

    bfast index -f hg18all.fa -A 1 -n 2 -m 1111111111111111111111 -w 14 -t -i 1 -x exonFile.txt -T /tmp/

    ... runs fine for the first two versions, but with 0.6.4e gives a malloc error (terminal output pasted below). Interestingly, the 0.6.4e version does run successfully on my Snow Leopard laptop, suggesting some sensitivity to the background OS.

    Best regards

    David

    =========


    dk$ bfast index -f $hg18dir/hg18all.fa -A 1 -n 2 -m 1111111111111111111111 -w 14 -t -i 1 -x $exondir/pan73regions.txt -T /tmp/
    ************************************************************
    Checking input parameters supplied by the user ...
    Validating fastaFileName /Users/dk/Desktop/pan/data/hg18Genome/hg18all.fa.
    Validating exonsFileName /Users/dk/Desktop/pan/documentation/pan73regions.txt.
    Validating tmpDir path /tmp/.
    Input arguments look good!
    ************************************************************
    ************************************************************
    Printing Program Parameters:
    programMode: [ExecuteProgram]
    fastaFileName: /Users/dk/Desktop/pan/data/hg18Genome/hg18all.fa
    space: [Color Space]
    mask: 1111111111111111111111
    depth: 0
    hashWidth: 14
    indexNumber: 1
    repeatMasker: [Not Using]
    startContig: 0
    startPos: 0
    endContig: 2147483647
    endPos: 2147483647
    exonsFileName: /Users/dk/Desktop/pan/documentation/pan73regions.txt
    numThreads: 2
    tmpDir: /tmp/
    timing: [Using]
    ************************************************************
    Reading in exons from /Users/dk/Desktop/pan/documentation/pan73regions.txt.
    Read in 73 exons.
    ************************************************************
    Reading in reference genome from /Users/dk/Desktop/pan/data/hg18Genome/hg18all.fa.cs.brg.
    In total read 24 contigs for a total of 3080419480 bases
    ************************************************************
    Creating the index...
    ************************************************************
    Warning: startContig was less than zero.
    Defaulting to contig=1 and position=1.
    ************************************************************
    ************************************************************
    Warning: endContig was greater than the number of contigs in the reference genome.
    Defaulting to reference genome's end contig=24 and position=57772954.
    ************************************************************
    Currently on [contig,pos]:
    [------24,---57772954]
    Sorting by thread...
    Merging sorts from threads...
    Out of 1 required merges, currently on:
    1
    Merge complete.
    Sorted.
    bfast(20212,0xa00e8720) malloc: *** mmap(size=1073741824) failed (error code=12)
    *** error: can't allocate region
    *** set a breakpoint in malloc_error_break to debug
    ************************************************************
    In function "RGIndexCreateHash": Fatal Error[MallocMemory]. Variable/Value: index->starts.
    Message: Could not allocate memory.
    ***** Exiting due to errors *****
    **********************************************************
    **
  • nilshomer
    Nils Homer
    • Nov 2008
    • 1283

    #2
    Looks like you ran out of memory, how much do you have in the failing and successful machines respectively?

    Comment

    • davidkip
      Junior Member
      • Dec 2009
      • 6

      #3
      4Gb in failed machine, 8Gb in successful one. The index (when made) is reported as being 1.09Gb in size (~86Mb file). Watching the memory usage shows BFAST using around 1.3Gb of memory (and there still being some free) at the time of crash.

      The exons file covers ~ 14.5Mb of the human genome.

      Curiously, the 0.6.3c version on the 4Gb machine works fine with no memory issues. Indeed, I've been able to make some very large indexes in this environment (eg all of hg18, split into 16 subindexes).

      Comment

      • nilshomer
        Nils Homer
        • Nov 2008
        • 1283

        #4
        There is no difference in the indexing portion between the versions, so I am at a loss.

        Comment

        • davidkip
          Junior Member
          • Dec 2009
          • 6

          #5
          Is fasta2brg identical as well (as the dependent earlier step)?

          Anything I can do to help debug this?

          Comment

          • davidkip
            Junior Member
            • Dec 2009
            • 6

            #6
            Update:

            Following on from your comment that the indexing is identical in the different versions, I made an index under an earlier version and then used that as the input to the rest of the workflow (now switched to the more update BFAST).

            Result: bfast match falls over with a malloc error as well.

            This sounds like a general compilation difference between the two versions?

            After doing

            sh autogen.sg && ./configure

            on freshly unpacked tarballs of each version, I did a file difference to see the difference between the makefiles (see below). Apart from a few lines where the version numbers change, a removal of the solid2fastq.pl script in the current release, there are two main differences:

            91c91
            < CFLAGS = -Wall -g -O2 -pthread
            ---
            > CFLAGS = -Wall -g -O2 -pthread -m64 -D_FILE_OFFSET_BITS=64
            110c110
            < LIBS = -lz -lm -lbz2
            ---
            > LIBS = -lbz2 -lz -lz -lm


            Does this give any clues as to what is going on?

            All the best

            David

            ===============



            $ diff /Users/dk/Desktop/ngs/bfast-0.6.4e/Makefile /Users/dk/Desktop/ngs/bfast-0.6.3c/Makefile
            83,87c83,87
            < ACLOCAL = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.4e/config/missing --run aclocal-1.10
            < AMTAR = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.4e/config/missing --run tar
            < AUTOCONF = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.4e/config/missing --run autoconf
            < AUTOHEADER = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.4e/config/missing --run autoheader
            < AUTOMAKE = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.4e/config/missing --run automake-1.10
            ---
            > ACLOCAL = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.3c/config/missing --run aclocal-1.10
            > AMTAR = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.3c/config/missing --run tar
            > AUTOCONF = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.3c/config/missing --run autoconf
            > AUTOHEADER = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.3c/config/missing --run autoheader
            > AUTOMAKE = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.3c/config/missing --run automake-1.10
            91c91
            < CFLAGS = -Wall -g -O2 -pthread
            ---
            > CFLAGS = -Wall -g -O2 -pthread -m64 -D_FILE_OFFSET_BITS=64
            110c110
            < LIBS = -lz -lm -lbz2
            ---
            > LIBS = -lbz2 -lz -lz -lm
            112c112
            < MAKEINFO = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.4e/config/missing --run makeinfo
            ---
            > MAKEINFO = ${SHELL} /Users/dk/Desktop/ngs/bfast-0.6.3c/config/missing --run makeinfo
            118c118
            < PACKAGE_STRING = bfast 0.6.4e
            ---
            > PACKAGE_STRING = bfast 0.6.3c
            120c120
            < PACKAGE_VERSION = 0.6.4e
            ---
            > PACKAGE_VERSION = 0.6.3c
            125,129c125,129
            < VERSION = 0.6.4e
            < abs_builddir = /Users/dk/Desktop/ngs/bfast-0.6.4e
            < abs_srcdir = /Users/dk/Desktop/ngs/bfast-0.6.4e
            < abs_top_builddir = /Users/dk/Desktop/ngs/bfast-0.6.4e
            < abs_top_srcdir = /Users/dk/Desktop/ngs/bfast-0.6.4e
            ---
            > VERSION = 0.6.3c
            > abs_builddir = /Users/dk/Desktop/ngs/bfast-0.6.3c
            > abs_srcdir = /Users/dk/Desktop/ngs/bfast-0.6.3c
            > abs_top_builddir = /Users/dk/Desktop/ngs/bfast-0.6.3c
            > abs_top_srcdir = /Users/dk/Desktop/ngs/bfast-0.6.3c
            152c152
            < install_sh = $(SHELL) /Users/dk/Desktop/ngs/bfast-0.6.4e/config/install-sh
            ---
            > install_sh = $(SHELL) /Users/dk/Desktop/ngs/bfast-0.6.3c/config/install-sh
            173a174
            > scripts/solid2fastq.pl \




            Comment

            • nilshomer
              Nils Homer
              • Nov 2008
              • 1283

              #7
              Try setting the CFLAGS back to "CFLAGS = -Wall -g -O2 -pthread -m64 -D_FILE_OFFSET_BITS=64" and see what happens.

              Comment

              • davidkip
                Junior Member
                • Dec 2009
                • 6

                #8
                OK, I've tried that now.

                Fresh unpack of each tarball, ./configure in each, then edit the Makefile for the new version to have the addition -m64 etc tag.

                No success, but I think I see why from the compilation output. It looks like the flag isn't passed to gcc just by altering this Makefile [I am a complete newbie w.r.t. C compilation BTW]. So the output for the older (working) version is:


                $ make
                make all-recursive
                Making all in bfast
                gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -pthread -m64 -D_FILE_OFFSET_BITS=64 -MT AlignedEnd.o -MD -MP -MF .deps/AlignedEnd.Tpo -c -o AlignedEnd.o AlignedEnd.c
                mv -f .deps/AlignedEnd.Tpo .deps/AlignedEnd.Po
                gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -pthread -m64 -D_FILE_OFFSET_BITS=64 -MT AlignedEntry.o -MD -MP -MF .deps/AlignedEntry.Tpo -c -o AlignedEntry.o AlignedEntry.c

                ...etc.

                The output for the new version after editing the Makefile is

                $ make
                make all-recursive
                Making all in bfast
                gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -pthread -MT AlignedEnd.o -MD -MP -MF .deps/AlignedEnd.Tpo -c -o AlignedEnd.o AlignedEnd.c
                mv -f .deps/AlignedEnd.Tpo .deps/AlignedEnd.Po
                gcc -DHAVE_CONFIG_H -I. -I.. -Wall -g -O2 -pthread -MT AlignedEntry.o -MD -MP -MF .deps/AlignedEntry.Tpo -c -o AlignedEntry.o AlignedEntry.c

                ...etc.

                Does that help?

                Comment

                • nilshomer
                  Nils Homer
                  • Nov 2008
                  • 1283

                  #9
                  In configure.ac, set "CFLAGS = -Wall -g -O2 -pthread -m64 -D_FILE_OFFSET_BITS=64". The run "sh autogen && ./configure".

                  Comment

                  • davidkip
                    Junior Member
                    • Dec 2009
                    • 6

                    #10
                    Success!

                    In the config.ac file for older versions there is this line:


                    extended_CFLAGS="-m64 -D_FILE_OFFSET_BITS=64";

                    but in the latest version it is commented out to this:

                    extended_CFLAGS="";# "-m64 -D_FILE_OFFSET_BITS=64";


                    Changing it to the earlier version of this line results in the m64 flags being passed to gcc, and the eventual build of the current release now works perfectly. Sorted!

                    Thanks for your help Nils.

                    Comment

                    • seeker
                      Member
                      • Jan 2011
                      • 26

                      #11
                      I am having a similar error running bfast match. It will go through one index (of 10 indexes) fine and then give the same malloc error followed by a message saying that it could not allocate enough memory on the second index.

                      I edited the config.ac to:

                      extended_CFLAGS="-m64 -D_FILE_OFFSET_BITS=64";

                      which got me through the first couple indexes and then the same error. I then edited:

                      CFLAGS = -Wall -g -O2 -pthread -m64 -D_FILE_OFFSET_BITS=64

                      Which got me through the first four but then gave an error. Interestingly, if I leave out -i 1-10 (or whatever) it goes through the full list of indexes fine.


                      ps - sorry if there are any misspelled commands, my workstation running the analysis isn't currently connected to the web, so I'm copying by eye!

                      Comment

                      • seeker
                        Member
                        • Jan 2011
                        • 26

                        #12
                        actually, it failed again with my real data..(above was with a small test file). any suggestions here would be great.

                        Comment

                        • nilshomer
                          Nils Homer
                          • Nov 2008
                          • 1283

                          #13
                          Originally posted by seeker View Post
                          actually, it failed again with my real data..(above was with a small test file). any suggestions here would be great.
                          I would need a way to reproduce:
                          Download Blat-like Fast Accurate Search Tool for free. BFAST facilitates the fast and accurate mapping of short reads to reference sequences, where mapping billions of short reads with variants is of utmost importance.


                          I would be happy to help in that case.

                          Comment

                          • seeker
                            Member
                            • Jan 2011
                            • 26

                            #14
                            It looks like I was doing something stupid by telling it to use more threads than made sense. Reducing that to the number of cores on my processor fixed the problem.

                            Comment

                            Latest Articles

                            Collapse

                            • SEQadmin2
                              Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                              by SEQadmin2


                              Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                              The systematic characterization of the human proteome has
                              ...
                              07-20-2026, 11:48 AM
                            • SEQadmin2
                              Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                              by SEQadmin2



                              Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                              ...
                              07-09-2026, 11:10 AM
                            • SEQadmin2
                              Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                              by SEQadmin2



                              Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                              There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                              07-08-2026, 05:17 AM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by SEQadmin2, 07-24-2026, 12:17 PM
                            0 responses
                            10 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 07-23-2026, 11:41 AM
                            0 responses
                            11 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 07-20-2026, 11:10 AM
                            0 responses
                            23 views
                            0 reactions
                            Last Post SEQadmin2  
                            Started by SEQadmin2, 07-13-2026, 10:26 AM
                            0 responses
                            37 views
                            0 reactions
                            Last Post SEQadmin2  
                            Working...