Closed UnixJunkie closed 9 years ago
same problem with 4.02.0
works with 4.00.1
In the clang command-line:
-analyzer-checker=external.OCaml
is the option that crashes clang
the full clang command-line:
"/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -main-file-name d0095.c -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.24 -v -resource-dir /usr/bin/../lib/clang/3.4 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.4/include -internal-externc-isystem /usr/lib/gcc/x86_64-linux-gnu/4.8/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/berenger/src/clangml-released -ferror-limit 19 -fmessage-length 125 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -load _build/clangml.dylib -analyze -analyzer-checker=external.OCaml -x c plugin/testsuite/d0095.c
-analyzer-checker=external.OCaml
Of course it is.. without that, there is none of our code being executed. I'll look into it later this week.
Here is an strace of the crash: https://gist.github.com/UnixJunkie/1fda849e8f8c0e1834ea
I'm not sure how this worked before. It might be broken on older versions, now. If it is, then both 0 and Val_unit need to be checked.
Also, a tip on how to debug this: 1) open clang/clang/api.ml, prepend "gdb"; "--args"; to the argument list (argv) where clang is called. Change "clang" to "/usr/bin/clang" (or whatever the full path of clang is). 2) run processor.native on some file 3) when gdb opens, enter "set follow-fork-mode on" 4) "run" (in gdb)
Thanks a lot for the fix, I am testing it right now.
thanks a lot for the info
2015-05-21 18:27:49.716 INFO : transformations end
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fcf780 (LWP 30044)]
0x00007ffff4893674 in camlClang__Invariants__fun_1611 ()
at clang/clang/invariants.ml:8
8 DenseIntMap.iter (fun idx ctyp ->
It still crashes, but later
when handling a request of type 'CacheFor Cache_ctyp' in plugin/ocaml/clangPlugin.ml
I am looking at this right now.
make prtp in memcad is all OK right now using master of clangml. If this is OK, I will tag, make a new release and close that bug.
https://gist.github.com/UnixJunkie/0960292213eb4612bf18