Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segfault in alignment module #1

Open
pdoris opened this issue Feb 5, 2024 · 7 comments
Open

segfault in alignment module #1

pdoris opened this issue Feb 5, 2024 · 7 comments

Comments

@pdoris
Copy link

pdoris commented Feb 5, 2024

My command is

python3 Mando.py -p /work2/06127/pdoris/frontera/Mandalorion/Mandalorion/ -g UCSC2GRCr8.sorted.gtf -G GRCr8.fasta -f Consensus_reads.fofn -M A


Mandalorion - Isoform identification and quantification
Version - v4.3.0 - That's no moon. It's an isoform


Module A - Alignment           

checking input fasta/q files
combining 18 input fasta/q files

this produces a very big combined fasta file. 35541118333 Feb 5 16:39 Combined.fasta

sh: line 1: 36889 Segmentation fault /work2/06127/pdoris/frontera/Mandalorion/Mandalorion/minimap2/minimap2 -G 400k --secondary=no -ax splice:hq --cs=long -uf -t 8 GRCr8.fasta /work2/06127/pdoris/frontera/Mandalorion/Mandalorion///tmp//Combined.fasta > /work2/06127/pdoris/frontera/Mandalorion/Mandalorion///tmp//mm2Alignments.sam

@christopher-vollmers
Copy link
Owner

Hi,

That error suggests that you are running out of RAM running minimap2. Can I ask how much RAM you have on the machine you are using? RAM usage of minimap2 (as I understand it) depends on the genome reference size so it's pretty much fixed and most often >30GB.

@pdoris
Copy link
Author

pdoris commented Feb 9, 2024

Thanks, increased memory, problem solved....until I reach the P module.

Looks like a spawn error....Mac OS 14.2 py 3.9.18, also tried with pyenv 3.8.18, some result


Mandalorion - Isoform identification and quantification
Version - v4.3.0 - That's no moon. It's an isoform


Module P - .sam to .clean.sorted.psl conversion           

converting sam output to psl format

Traceback (most recent call last):0000
File "", line 1, in
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 125, in _main
prepare(preparation_data)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 265, in run_path
Traceback (most recent call last):0000
File "", line 1, in
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 125, in _main
prepare(preparation_data)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 265, in run_path
Traceback (most recent call last):0000
File "", line 1, in
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 125, in _main
prepare(preparation_data)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
return _run_module_code(code, init_globals, run_name,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 97, in _run_module_code
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 97, in _run_module_code
return _run_module_code(code, init_globals, run_name,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 87, in _run_code
_run_code(code, mod_globals, init_globals,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/pdoris/Mandalorion/emtrey.py", line 202, in
exec(code, run_globals)
File "/Users/pdoris/Mandalorion/emtrey.py", line 202, in
_run_code(code, mod_globals, init_globals,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 87, in _run_code
main()
File "/Users/pdoris/Mandalorion/emtrey.py", line 199, in main
main()
File "/Users/pdoris/Mandalorion/emtrey.py", line 199, in main
exec(code, run_globals)
File "/Users/pdoris/Mandalorion/emtrey.py", line 202, in
delegatingPslConversion(inFile,batch)
File "/Users/pdoris/Mandalorion/emtrey.py", line 185, in delegatingPslConversion
main()
File "/Users/pdoris/Mandalorion/emtrey.py", line 199, in main
processSamBatch(reads,chromosomes)
File "/Users/pdoris/Mandalorion/emtrey.py", line 156, in processSamBatch
delegatingPslConversion(inFile,batch)
pool = mp.Pool(processes=threads)
File "/Users/pdoris/Mandalorion/emtrey.py", line 185, in delegatingPslConversion
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 119, in Pool
delegatingPslConversion(inFile,batch)
File "/Users/pdoris/Mandalorion/emtrey.py", line 185, in delegatingPslConversion
processSamBatch(reads,chromosomes)
File "/Users/pdoris/Mandalorion/emtrey.py", line 156, in processSamBatch
pool = mp.Pool(processes=threads)
processSamBatch(reads,chromosomes)
File "/Users/pdoris/Mandalorion/emtrey.py", line 156, in processSamBatch
pool = mp.Pool(processes=threads)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 119, in Pool
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 212, in init
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 212, in init
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 212, in init
self._repopulate_pool()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 326, in _repopulate_pool_static
self._repopulate_pool()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 303, in _repopulate_pool
w.start()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/process.py", line 121, in start
self._repopulate_pool()
return self._repopulate_pool_static(self._ctx, self.Process,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 326, in _repopulate_pool_static
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 303, in _repopulate_pool
w.start()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/process.py", line 121, in start
return self._repopulate_pool_static(self._ctx, self.Process,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 326, in _repopulate_pool_static
w.start()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)000
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
self._popen = self._Popen(self)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init
return Popen(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init
self._popen = self._Popen(self)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)00000
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init
super().init(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init
super().init(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch
self._launch(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main
prep_data = spawn.get_preparation_data(process_obj._name)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data
self._launch(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch
raise RuntimeError('''
RuntimeError:
_check_not_importing_main()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.
raise RuntimeError('''

RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.
prep_data = spawn.get_preparation_data(process_obj._name)

File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Traceback (most recent call last):
File "", line 1, in
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 125, in _main
prepare(preparation_data)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/pdoris/Mandalorion/emtrey.py", line 202, in
main()
File "/Users/pdoris/Mandalorion/emtrey.py", line 199, in main
delegatingPslConversion(inFile,batch)
File "/Users/pdoris/Mandalorion/emtrey.py", line 185, in delegatingPslConversion
processSamBatch(reads,chromosomes)
File "/Users/pdoris/Mandalorion/emtrey.py", line 156, in processSamBatch
pool = mp.Pool(processes=threads)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 212, in init
self._repopulate_pool()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 303, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/pool.py", line 326, in _repopulate_pool_static
w.start()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in init
super().init(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_fork.py", line 19, in init
self._launch(process_obj)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch
prep_data = spawn.get_preparation_data(process_obj._name)
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "/Users/pdoris/.pyenv/versions/3.8.18/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main
raise RuntimeError('''

@christopher-vollmers
Copy link
Owner

That's an error I haven't seen before...
What operating system are you using to run this?

It's definitely a multiprocessing error in emtrey.py and I'm researching the error now.

I'm asking because a lot of pages mention this error to be a Windows thing which I have much less experience with...

I'll see whether I can reproduce and fix this somehow. I have some ideas.

@pdoris
Copy link
Author

pdoris commented Feb 9, 2024 via email

@christopher-vollmers
Copy link
Owner

It's a spawn vs fork issue for sure. We aren't testing this on MacOS so there might be other spots this will break as well...
My guess is this will run fine on a Linux machine.

I'll need a few days to figure out how to force fork over spawn in macOS and then find a Mac to test this on.

But there is a lot more multiprocessing happening later in Mandalorion and all of that will break probably as well.

A quick thing to try is to make python3.7 your default python3 and try to run Mandalorion that way for now.

@pdoris
Copy link
Author

pdoris commented Feb 9, 2024 via email

@pdoris
Copy link
Author

pdoris commented Feb 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants