infer icon indicating copy to clipboard operation
infer copied to clipboard

not support Apple M1 ?

Open sydowma opened this issue 3 years ago • 13 comments

Please make sure your issue is not addressed in the FAQ.

Please include the following information:

  • [x] 1.0.0.
  • [x] macOS 11.2
  • [x] infer -- javac Hello.java
  • [ ] The full output in a paste, for instance a gist.
  • [ ] If possible, a minimal example to reproduce your problem (for instance, some code where infer reports incorrectly, together with the way you run infer to reproduce the incorrect report).

output

MAC OS X: Failed pinning to cpu 0, trying 0/2
MAC OS X: Failed pinning to cpu 0, trying 0/2
MAC OS X: Failed pinning to cpu 0, trying 0/2
MAC OS X: Failed pinning to cpu 0, trying 0/2
MAC OS X: Failed pinning to cpu 0, trying 0/2
.....

sydowma avatar Mar 13 '21 07:03 sydowma

We just upgraded to OCaml 4.12.0, which supports the M1's architecture. Does building from master resolve the issue?

Your logs seem to be this message from the parmap library, and indeed there seems to be an infinite loop if pinning fails for cpu 0 so maybe that library needs to add M1 support too.

jvillard avatar Jun 07 '21 11:06 jvillard

@jvillard I ran into a problem that I think is related to Apple M1 as well. When I am trying to build Infer (using build-infer.sh) I encounters with the following (and the build fails):

[2262/3757] Building C object projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o
FAILED: projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o 
/Library/Developer/CommandLineTools/usr/bin/clang -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Domp_EXPORTS -I/var/folders/rn/sjvwnyfd72vbr786pf8c1msh0000gn/T/clang-setup.jVEkFI/build/projects/openmp/runtime/src -I/Users/harmim/Projects/infer/facebook-clang-plugins/clang/src/download/llvm-project/openmp/runtime/src -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/libxml2 -I/var/folders/rn/sjvwnyfd72vbr786pf8c1msh0000gn/T/clang-setup.jVEkFI/build/include -I/Users/harmim/Projects/infer/facebook-clang-plugins/clang/src/download/llvm-project/llvm/include -I/Users/harmim/Projects/infer/facebook-clang-plugins/clang/src/download/llvm-project/openmp/runtime/src/i18n -I/Users/harmim/Projects/infer/facebook-clang-plugins/clang/src/download/llvm-project/openmp/runtime/src/include -I/Users/harmim/Projects/infer/facebook-clang-plugins/clang/src/download/llvm-project/openmp/runtime/src/thirdparty/ittnotify -g -O2 -fPIC -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -Wall -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-extra -Wno-pedantic -O3 -DNDEBUG -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -fPIC   -D _GNU_SOURCE -D _REENTRANT -x assembler-with-cpp -MD -MT projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o -MF projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o.d -o projects/openmp/runtime/src/CMakeFiles/omp.dir/z_Linux_asm.S.o -c /Users/harmim/Projects/infer/facebook-clang-plugins/clang/src/download/llvm-project/openmp/runtime/src/z_Linux_asm.S
/Users/harmim/Projects/infer/facebook-clang-plugins/clang/src/download/llvm-project/openmp/runtime/src/z_Linux_asm.S:1752:5: error: unknown directive
    .size __kmp_unnamed_critical_addr,8
    ^

I have found, e.g., here https://github.com/briansmith/ring/issues/1163, https://github.com/denoland/deno/issues/8346 that this kind of error may be related to Apple M1.

harmim avatar Aug 18 '21 12:08 harmim

are there any plans for releasing a binary for M1?

wAuner avatar Oct 26 '21 09:10 wAuner

@harmim Can you verify if this is still a problem?

martintrojer avatar Apr 19 '22 10:04 martintrojer

@martintrojer Unfortunately, I don't build Infer on Apple M1 any more. Maybe someone else can verify it?

harmim avatar Apr 19 '22 17:04 harmim

@harmim @martintrojer I installed infer on my M1 mac from source on main branch, and it works fine.

# Hello.java
class Hello {
  int test() {
    String s = null;
    return s.length();
  }
}

Output

$ infer run -- javac Hello.java

Capturing in javac mode...
Found 1 source file to analyze in /Users/tsonglew/infer-out
1/1 [################################################################################] 100% 48.59ms

Hello.java:4: error: Null Dereference
  object `s` last assigned on line 3 could be null and is dereferenced at line 4.
  2.     int test() {
  3.       String s = null;
  4. >     return s.length();
  5.     }
  6.   }


Found 1 issue
          Issue Type(ISSUED_TYPE_ID): #
  Null Dereference(NULL_DEREFERENCE): 1

tsonglew avatar May 11 '22 02:05 tsonglew

This is also working for me with Java, any chance of a release from master so that we don't have to compile clang?

M-Whitaker avatar May 11 '22 10:05 M-Whitaker

@tsonglew Can you please share the binary?

mhashim6 avatar Oct 30 '22 14:10 mhashim6

@tsonglew Can you please share the binary?

infer.zip

here it is

tsonglew avatar Oct 31 '22 01:10 tsonglew

@tsonglew, Thanks! I ended up building from source.

mhashim6 avatar Nov 07 '22 16:11 mhashim6

If anyone is interested, we'll be maintaining current and upcoming infer binaries for Apple Silicon on Instabug/infer.

mhashim6 avatar Nov 08 '22 12:11 mhashim6

If anyone is interested, we'll be maintaining current and upcoming infer binaries for Apple Silicon on Instabug/infer.

@mhashim6 Hello,I use this release infer-osx-v1.1.0.tar.xz,bug it return an error dyld[25730]: Library not loaded: @rpath/libgmp.10.dylibem/RenderNodes/LOTStrokeRenderer.m Referenced from: <44DF3598-DAC5-3E2D-B840-4E731D6D4FF3> /opt/infer-osx-v1.1.0/lib/wrappers/clang Reason: tried: '/opt/infer-osx-v1.1.0/lib/libso/libgmp.10.dylib' (no such file), '/opt/infer-osx-v1.1.0/lib/libso/libgmp.10.dylib' (no such file), '/usr/local/lib/libgmp.10.dylib' (no such file), '/usr/lib/libgmp.10.dylib' (no such file, not in dyld cache)bgmp.10.dylib' (no such file) I alse build infer with this repository main branch,but alse get error Error message: clang-15: error: unknown argument: '-ivfsstatcache' Infer needs a working compilation command to run. Is there any idea for me? Thank you.

pastel001 avatar Apr 03 '23 19:04 pastel001