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

idba segmentation fault #1303

Closed
4 of 5 tasks
lmrodriguezr opened this issue Mar 7, 2021 · 2 comments · Fixed by #1305
Closed
4 of 5 tasks

idba segmentation fault #1303

lmrodriguezr opened this issue Mar 7, 2021 · 2 comments · Fixed by #1305

Comments

@lmrodriguezr
Copy link
Contributor

lmrodriguezr commented Mar 7, 2021

  • Confirmed this is a problem with brew installing one, specific formula and not every time you run brew? If it's a general brew problem please file this issue at https://github.com/Homebrew/brew/issues/new.
  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed all issues and retried your prior step?
  • Ran brew gist-logs <formula> (where <formula> is the name of the formula that failed) and included the output link?
  • If brew gist-logs didn't work: ran brew config and brew doctor and included their output with your issue?

The bottle doesn't work

I'm trying to use idba from the brewsci/bio tap, but I'm getting segmentation faults that seem to be rooted in compilation.

First, I tried the simple route:

$> brew install idba
==> Installing idba from brewsci/bio
==> Downloading https://archive.org/download/brewsci/bottles-bio/idba-1.1.3_2.sierra.bottle.tar.gz
Already downloaded: /Users/miguel/Library/Caches/Homebrew/downloads/8a78e6dc32c4ee9a1a50cd702c488248524826c3664352d1457f9af02de38d29--idba-1.1.3_2.sierra.bottle.tar.gz
==> Pouring idba-1.1.3_2.sierra.bottle.tar.gz
Warning: brewsci/bio/idba dependency gmp was built with a different C++ standard
library (libc++ from clang). This may cause problems at runtime.
🍺  /usr/local/Cellar/idba/1.1.3_2: 36 files, 5.8MB
$> idba_ud 
dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/9/libgomp.1.dylib
  Referenced from: /usr/local/bin/idba_ud
  Reason: image not found
Abort trap: 6

Source installation doesn't work

Since I saw the warning about gmp, I tried the following:

  1. brew uninstall idba which worked fine
  2. brew reinstall -s gmp which seems to have worked fine as well (see log using -v)
  3. brew install idba which produced the exact same output as above
  4. brew install -s idba which generated the following output and never gave me back the prompt, so I had to kill it with Ctrl+C:
    ==> Installing idba from brewsci/bio
    ==> Downloading https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/hku-idba/lacto-genus.tar.gz
    Already downloaded: /Users/miguel/Library/Caches/Homebrew/downloads/0d76a9708baed3cf7d14e93853013aa81f9a77952c4387ea65054cf337aade6e--lacto-genus.tar.gz
    ==> Downloading https://github.com/loneknightpy/idba/archive/1.1.3.tar.gz
    Already downloaded: /Users/miguel/Library/Caches/Homebrew/downloads/03fd964aee8290422be93d479dc20a7126b0ff703747621a911bdd29808ae632--idba-1.1.3.tar.gz
    ==> aclocal
    ==> autoconf
    ==> automake --add-missing
    ==> ./configure --prefix=/usr/local/Cellar/idba/1.1.3_2
    ==> make
    ==> make check
    ^C
    One sec, cleaning up...
    
  5. In order to see what was the error, I did brew install -sv idba which produced this log with tail:
    /Library/Developer/CommandLineTools/usr/bin/make  check-TESTS
    PASS: compact_sequence_unittest
    PASS: bit_edges_unittest
    PASS: kmer_unittest
    PASS: atomic_integer_unittest
    PASS: vertex_status_unittest
    ../test-driver: line 109: 97633 Segmentation fault: 11  "$@" > $log_file 2>&1
    FAIL: histgram_unittest
    ../test-driver: line 109: 97639 Segmentation fault: 11  "$@" > $log_file 2>&1
    FAIL: managed_list_unittest
    PASS: sequence_unittest
    PASS: short_sequence_unittest
    ^C
    One sec, cleaning up...
    
    
    As you can see, I also had to kill it with with Ctrl+C.
  6. Just to make sure, I also ran brew test -v gmp which seems to be fine:
    git config --replace-all homebrew.devcmdrun true
    ==> Installing 'bundler' gem
    ==> Testing gmp
    /usr/bin/sandbox-exec -f /private/tmp/homebrew20210307-92812-jwa4k0.sb ruby -W1 -- /usr/local/Homebrew/Library/Homebrew/test.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/gmp.rb --verbose
    ==> /usr/bin/clang test.c -L/usr/local/Cellar/gmp/6.2.1/lib -lgmp -o test
    ==> ./test
    ==> /usr/bin/clang test.c /usr/local/Cellar/gmp/6.2.1/lib/libgmp.a -o test
    ==> ./test
    

gcc@9 doesn't work either

I saw that idba is listed in #1186, so I tried requiring gcc@9 by editing the formula locally to bump the revision and replace the gcc:

diff --git a/Formula/idba.rb b/Formula/idba.rb
index a90eabf..d39c964 100644
--- a/Formula/idba.rb
+++ b/Formula/idba.rb
@@ -4,7 +4,7 @@ class Idba < Formula
   homepage "https://i.cs.hku.hk/~alse/hkubrg/projects/idba/"
   url "https://github.com/loneknightpy/idba/archive/1.1.3.tar.gz"
   sha256 "6b1746a29884f4fa17b110d94d9ead677ab5557c084a93b16b6a043dbb148709"
-  revision 2
+  revision 3
   head "https://github.com/loneknightpy/idba.git"
 
   bottle do
@@ -16,7 +16,9 @@ class Idba < Formula
   depends_on "autoconf" => :build
   depends_on "automake" => :build
 
-  depends_on "gcc" if OS.mac? # needs openmp
+  on_macos do
+    depends_on "gcc@9" # needs openmp
+  end
 
   fails_with :clang # needs openmp
 

And reran brew install -sv idba but got the exact same result.

I'm fresh out of ideas here ☹️. Any help is greatly appreciated!

brew config

HOMEBREW_VERSION: 3.0.4-50-ga930e2b
ORIGIN: https://github.com/Homebrew/brew
HEAD: a930e2b36235d3c0b15f655752c76fadc35dc3fb
Last commit: 29 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: c5e98a5a9bbbbe4a635d293b47f44cac975e3863
Core tap last commit: 7 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vi
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: octa-core 64-bit icelake
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
macOS: 10.15.7-x86_64
CLT: 12.4.0.0.1.1610135815
Xcode: N/A
@sjackman
Copy link
Member

Thanks for the bug report, Luis. I'm not sure why it's failing to build from source on your system. That's working for me. I've opened PR #1305 with your suggested fix. Feel free to open a PR in the future if the fix looks right, even if you're not able to build it locally. It's best of course if it does build locally, but the local issue seems weird, you can use CI to help troubleshoot.

@sjackman
Copy link
Member

I've merged PR #1305, which resolves this issue!

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

Successfully merging a pull request may close this issue.

2 participants