Segmentation fault: 11 on macOSm mojave 10.14.5

672 views
Skip to first unread message

Nicolas Gomez

unread,
Jul 31, 2019, 6:32:22 PM7/31/19
to majiq_voila
Hi majiq team,

I am trying to use Majiq Build v2.1-c3da3ce on a mac book pro and keep getting a "Segmentation fault: 11" error while on the "Parsing GFF3" step. The command I am using is:

majiq build /path/to/gencode.v31.primary_assembly.annotation.gff3 -c /path/to/configure_file -o /path/to/MAJIQ_output/ --logger /path/to/MAJIQ_output/


The Python process crashes after reaching around 700MB of memory... I have 32GB


What other information can I provide to help troubleshoot this issue?


Thanks,

Nico


Nicolas Gomez

unread,
Aug 3, 2019, 10:32:40 AM8/3/19
to majiq_voila
Update: I realized that supplying the compressed gff (.gff.gz) produces a completely different error copied below:

Traceback (most recent call last):

  File "/usr/local/bin/majiq", line 10, in <module>

    sys.exit(main())

  File "/usr/local/lib/python3.7/site-packages/majiq/run_majiq.py", line 204, in main

    args.func(args)

  File "majiq/src/build.pyx", line 520, in majiq.src.build.build

  File "/usr/local/lib/python3.7/site-packages/majiq/src/basic_pipeline.py", line 11, in pipeline_run

    return pipeline.run()

  File "majiq/src/build.pyx", line 530, in majiq.src.build.Builder.run

  File "majiq/src/build.pyx", line 538, in majiq.src.build.Builder.builder

  File "majiq/src/build.pyx", line 458, in majiq.src.build._core_build

  File "majiq/src/io.pyx", line 51, in majiq.src.io.read_gff

  File "/usr/local/lib/python3.7/site-packages/majiq/src/gff.py", line 48, in parse_gff3

    if line.startswith("#"):

TypeError: startswith first arg must be bytes or a tuple of bytes, not str



I have also attached the pip install log which *i think* shows a pretty uneventful installation.

Thank you,
Nico
pipinstalllog.txt

Nicolas Gomez

unread,
Aug 3, 2019, 12:20:13 PM8/3/19
to majiq_voila
Ok. Nevermind, this is a separate issue that I solved by specifying the gzip read mode to "str" by modifying the .../env/lib/python3.7/site-packages/majiq/src/gff.py file line 44:
with open_func(filename, mode="rt") as infile:

Now when I rerun majiq, I get the seg fault error that I originally posted about. I am certain that the gff.py file is successfully iterating through the supplied annotation file. So, I'm still quite lost. I have attached my config file as well
MAJIQ_Kate_configure

Jordi Vaquero

unread,
Aug 3, 2019, 1:47:57 PM8/3/19
to Nicolas Gomez, majiq_voila

Hi,

Please can you try running without the logger option?

 

Thanks

jordi

--
You received this message because you are subscribed to the Google Groups "majiq_voila" group.
To unsubscribe from this group and stop receiving emails from it, send an email to majiq_voila...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/majiq_voila/cbe1d227-a015-443f-a8b6-9bb633442c2e%40googlegroups.com.

Nicolas Gomez

unread,
Aug 8, 2019, 10:23:45 PM8/8/19
to majiq_voila
I'm attaching the crash report. Perhaps someone else is having a similar experience.

Nico

To unsubscribe from this group and stop receiving emails from it, send an email to majiq...@googlegroups.com.

Python_2019-08-08-222053_claude.crash

Nicolas Gomez

unread,
Aug 10, 2019, 1:07:39 PM8/10/19
to majiq_voila
I imported faulthandler in basic_pipeline.py, run_majiq.py, and gff.py as was suggested by this blog to learn more about the segfault. Ran majiq as follows:

python -Xfaulthandler /usr/local/lib/python3.7/site-packages/majiq/run_majiq.py build ...


Fatal Python error: Segmentation fault


Current thread 0x000000011846d5c0 (most recent call first):

  File "/usr/local/lib/python3.7/site-packages/majiq/src/basic_pipeline.py", line 12 in pipeline_run

  File "/usr/local/lib/python3.7/site-packages/majiq/run_majiq.py", line 205 in main

  File "/usr/local/lib/python3.7/site-packages/majiq/run_majiq.py", line 209 in <module>

Segmentation fault: 11


Although this doesn't tell me much, it did change the crash report (see attached) and it points to the pipeline_run function in basic_pipeline.py as a potential source. Unfortunately pipeline_run doesn't contain much in the way of seg fault red flags. :/w

Nico
Python_2019-08-10-125809_claude.crash

Jordi Vaquero

unread,
Aug 12, 2019, 9:46:23 PM8/12/19
to Nicolas Gomez, majiq_voila

Hello Nico,

Sorry for the delay, I have been out for some time. I will take a look at what you sent me and come back to you tomorrow

 

Jordi

To unsubscribe from this group and stop receiving emails from it, send an email to majiq_voila...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/majiq_voila/83761f64-527e-4ee1-9c49-8715344771db%40googlegroups.com.

Message has been deleted

Nicolas Gomez

unread,
Jan 8, 2020, 12:00:07 PM1/8/20
to majiq_voila
Hi Jordi,

I'm just copying my recent email to you here:

After about 3 months of on and off troubleshooting, I got Majiq to work on my Mac. Here are the things I did:

- recompiled GCC9.2 following this protocol: https://solarianprogrammer.com/2019/10/12/compiling-gcc-macos/
- I think this was the most important step
- uninstalled homebrew and all homebrew installed packages
- this included ALL other compilers and symbolic links
- uninstalled all non-OS-installed python versions and packages
- including 3.8
- reinstalled python3.7 and homebrew (to manage readline and some other dependencies)

Finally I updated my .bash_profile to use all of the above. Majiq and Voila compiled without error and build, psi, and delta psi functions worked without any problems. I did have to change line 419 in Voila's view_matrix.py file to allow LSV text copying function.

I hope this helps other MacOS users. Note: I did stupidly update to MacOS Catalina but I think following the Mojave GCC9 compilation protocol here is the only change you'd have to make to get this to work.

Cheers,
Nico


Paul Jewell

unread,
Jan 8, 2020, 1:12:42 PM1/8/20
to majiq_voila
Hi Nicholas, 

I (and likely some other worldwide visitors) appreciate your solution description. Thanks for coming back with the solution you found!

-Paul

iamnic...@gmail.com

unread,
Dec 21, 2021, 5:04:27 PM12/21/21
to majiq_voila
So i've run into this issue again. (That is, a seg fault sometime around the end of reading in the gff). This time I'm running macOS 12.2, Python 3.8.12 (set by pyenv 2.2.2), HTSlib 1.14, GCC 11.2.0. I was not however able to compile GCC for my system so I got it with homebrew.

I emailed Joseph Aicher directly who created a branch for debugging (.../majiq_academic.git@debug-nicog-segfault). He requested I rerun the build command with --debug and provide the output:

majiq build /Users/nicog/SequencingTools/genomes/human/Gencode/GRCh38/v31/gencode.v31.primary_assembly.annotation.gff3 -c /Volumes/Otto/Gomez2021/MAJIQ/config.txt -j 12 -o /Volumes/Otto/Gomez2021/MAJIQ/build --debug

/Users/nicog/.pyenv/versions/3.8.12/lib/python3.8/site-packages/rna_majiq/src/config.py:106: UserWarning: "readlen" parameter is deprecated and will not be used. MAJIQ now detects the maximum read length of each experiment automatically. 

  warnings.warn(

2021-12-21 16:37:41,795 (PID:15873) - INFO - Majiq Build v2.4.dev3+g427c4efe

2021-12-21 16:37:41,795 (PID:15873) - INFO - Command: /Users/nicog/.pyenv/versions/3.8.12/bin/majiq build /Users/nicog/SequencingTools/genomes/human/Gencode/GRCh38/v31/gencode.v31.primary_assembly.annotation.gff3 -c /Volumes/Otto/Gomez2021/MAJIQ/config.txt -j 12 -o /Volumes/Otto/Gomez2021/MAJIQ/build --debug

2021-12-21 16:37:41,795 (PID:15873) - INFO - Parsing GFF3

2021-12-21 16:37:41,795 (PID:15873) - DEBUG - begin processing GFF3 records

2021-12-21 16:38:49,453 (PID:15873) - DEBUG - end processing GFF3 records, extract transcript junctions

[1]    15873 segmentation fault  majiq build  -c /Volumes/Otto/Gomez2021/MAJIQ/config.txt -j 12 -o  --debug


+++++

Then Paul Jewell emailed me and requested that I run the workshop example:

majiq build /Users/nicog/Downloads/workshop_example/DB.gff3 -c /Users/nicog/Downloads/workshop_example/settings.ini -j 12 -o /Users/nicog/Downloads/workshop_example/build --debug

/Users/nicog/.pyenv/versions/3.8.12/lib/python3.8/site-packages/rna_majiq/src/config.py:106: UserWarning: "readlen" parameter is deprecated and will not be used. MAJIQ now detects the maximum read length of each experiment automatically. 

  warnings.warn(

2021-12-21 17:00:20,621 (PID:16712) - INFO - Majiq Build v2.4.dev3+g427c4efe

2021-12-21 17:00:20,621 (PID:16712) - INFO - Command: /Users/nicog/.pyenv/versions/3.8.12/bin/majiq build /Users/nicog/Downloads/workshop_example/DB.gff3 -c /Users/nicog/Downloads/workshop_example/settings.ini -j 12 -o /Users/nicog/Downloads/workshop_example/build --debug

2021-12-21 17:00:20,621 (PID:16712) - INFO - Parsing GFF3

2021-12-21 17:00:20,621 (PID:16712) - DEBUG - begin processing GFF3 records

2021-12-21 17:00:20,658 (PID:16712) - DEBUG - end processing GFF3 records, extract transcript junctions

[1]    16712 segmentation fault  majiq build /Users/nicog/Downloads/workshop_example/DB.gff3 -c  -j 12 -o


+++++

So the problem is likely NOT due to my gff or bam files. What should I try next?

Thanks!
Nico

Paul Jewell

unread,
Dec 21, 2021, 5:16:22 PM12/21/21
to majiq_voila
Hi Nico,

For the version of gcc and g++ you used from homebrew, I'm supposing this is a package that OSX provides? I've usually used gcc 8.x so that may be another thing to try.

Can you verify when you run:

$ gcc --version
and
$ g++ --version

That they are both the version you expect (9) and matching each other?

If not they may be installed in a non-standard location

You may need to specify the exact versions to use with something like (sometimes on OSX, basically the gcc is called "gcc" but actually symlinks to something else like clang, from what I recall):

export CC=/path/to/gcc-9
export CXX=/path/to/g++-9

In this case.

I have a hunch because the problem repeats itself with respect to the compiler installation / version, that it may be this same problem again.

Thanks!

iamnic...@gmail.com

unread,
Dec 21, 2021, 6:02:44 PM12/21/21
to majiq_voila
Hi Paul,
My .zshrc file specifies all CC, CXX, and CPP variables pointing to the correct GCC-11 versions of each.
(i.e. "export CXX=/usr/local/Cellar/gcc/11.2.0_3/bin/g++-11" etc...)

Additionally I specify all gcc-related aliases.
(i.e. "alias g++='/usr/local/Cellar/gcc/11.2.0_3/bin/g++-11' " etc...)

And when I check the versions in the shell:

>gcc --version

gcc-11 (Homebrew GCC 11.2.0_3) 11.2.0

Copyright (C) 2021 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

>g++ --version

g++-11 (Homebrew GCC 11.2.0_3) 11.2.0

Copyright (C) 2021 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

+++++

(this holds up for c++ and cpp as well)

So all of my compiler related variables appear to be properly defined.

I did get this working last year with GCC 9.2 although I don't see any reason why GCC 11 would give me any issues... If you really think it'd make a difference, I can try that too.

Nico


iamnic...@gmail.com

unread,
Dec 21, 2021, 7:05:09 PM12/21/21
to majiq_voila
Ok huge breakthrough. I was combing through the pip install logs for MAJIQ/Voila and kept seeing references to linked llvm libraries. I do have LLVM installed but figured specifying the gcc compiler would be all i needed to avoid mixed-compiler collisions. Unsure if that was the case, I went back to my .zshrc file and commented out all env variables containing llvm linked libraries and *ahem* voila, MAJIQ build worked. Specifically, i commented OUT the following lines:

1. export CPPFLAGS="-I/usr/local/opt/zlib/include,-I/usr/local/opt/icu4c/include,-I/usr/local/opt/openblas/include,-I/usr/local/opt/llvm/include,-I/usr/local/opt/bzip2/include"
2. export CFLAGS="-L/usr/local/opt/readline/lib -L/usr/local/opt/readline/lib -L/Users/nicog/.pyenv/versions/3.8.12/lib -L/usr/local/opt/zlib/lib,-L/usr/local/opt/icu4c/lib,-L/usr/local/opt/openblas/lib,-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib,-L/usr/local/opt/tcl-tk/lib"
3. export  LDFLAGS="-L/usr/local/opt/zlib/lib,-L/usr/local/opt/icu4c/lib,-L/usr/local/opt/openblas/lib,-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib,-L/usr/local/opt/tcl-tk/lib,-L/usr/local/opt/bzip2/lib"

Anyway, thank you very much for your help. I successfully ran the workshop files and am now running my own experiment. I suspect that I had inadvertently done the same thing back in 2019 when I mysteriously got MAJIQ to work then. Bottom line, nuke your bash/zsh env variables and start from scratch. My .zshrc looks like the wild wild west. no it looks more like "#the wild wild west".

All the best,

Joseph Aicher

unread,
Dec 21, 2021, 8:26:38 PM12/21/21
to iamnic...@gmail.com, majiq_voila
Amazing, thank you for the update! I am glad that you were able to get it working. Good luck with your analyses and please let us know if you have any other questions or feedback.

Best,
Joseph 

--
You received this message because you are subscribed to the Google Groups "majiq_voila" group.
To unsubscribe from this group and stop receiving emails from it, send an email to majiq_voila...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages