dsw / oink-stack Goto Github PK
View Code? Open in Web Editor NEWOink is a collaboration of C++ static analysis tools.
Home Page: http://danielwilkerson.com/oink/index.html
Oink is a collaboration of C++ static analysis tools.
Home Page: http://danielwilkerson.com/oink/index.html
Receive a segfault when running elkhound/elkhound elkhound/examples/crash1.gr on Mac OS X. Have built the tools using Apple LLVM version 8.0.0 (clang-800.0.38). Debegging segfault reveals the cause to be dereferencing a null pointer when calling LocString::<< operator (loc.str is NULL). From the comments in ast/locstr.h I see that the loc.str is permitted to be NULL:
// experimenting with allowing 'str' to be null, which is convenient
// when the string table isn't available
In that case, the << operators should deal gracefully with str==NULL.
Are there samples for using Cqual++ with openSSL ? Apache ? Others ?
Is there a chance of getting a compiled binary posted on github as a release? I got a segfault in Expression::hasUnparenthesizedGT
; and after the things I did force compilation that may very well be my own fault.
g++ -c -o agramlex.yy.o agramlex.yy.cc -g -Wall -Wno-deprecated -D__UNIX__ -DNDEBUG -D__LINUX__ -I../smbase
In file included from ../smbase/sm_flexlexer.h:28,
from agramlex.yy.cc:247:
/usr/local/include/FlexLexer.h:130: error: expected unqualified-id before numeric constant
agramlex.yy.cc: In member function ‘virtual int GrammarLexer::yylex()’:
agramlex.yy.cc:640: error: ‘yy_current_buffer’ was not declared in this scope
agramlex.yy.cc:1087: error: ‘yy_current_buffer’ was not declared in this scope
agramlex.yy.cc:1110: error: ‘yy_current_buffer’ was not declared in this scope
my g++ is: 4.4.0
flex 2.5.4
bison 2.3
When running the ./configure
script at the top level, the script died when it went into the smbase
directory with the following error:
Can't locate sm_config.pm in @INC (you may need to install the sm_config module) (@INC contains: /usr/lib/perl5/site_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.26.1 /usr/lib/perl5/vendor_perl/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.26.1 /usr/lib/perl5/5.26.1/x86_64-linux-thread-multi /usr/lib/perl5/5.26.1 /usr/lib/perl5/site_perl) at ./configure.pl line 6.
configure failed at ./configure.pl line 128.
For some reason, the smbase/configure.pl:6 require sm_config;
line was not able to find the sm_config.pm
file in the current directory. My guess is I need to update some config setting to make the @INC
path see the local directory? (I freely admit that I don't know what I am doing).
I was able to get the entire configure script to work by changing the line in smbase/configure.pl:6 to do "./sm_config.pm";
, but that may be undesired. I've never worked with perl before, so I am not sure if the do
statement is bad practice or not.
Hello,
I get this error in a STL header:
In state 296, I expected one of these tokens:
(, ), [, ], ->, ., +, -, ++, --, &, *, .*, ->*, /, %, <<, >>, <, <=, >, >=, ==, !=, ^, |, &&, ||, ?, :, =, *=, /=, %=, +=, -=, &=, ^=, |=, <<=, >>=, ,, ..., ;, }, __attribute__, <?, >?,
/usr/include/c++/4.6/bits/stl_algobase.h:731:32: Parse error (state 296) at <name>: __niter
I've reduced the input with delta to this:
namespace std __attribute__ ((__visibility__ ("default"))) {
template<class _Sp, class _Tp> struct __traitor {};
template<typename _Tp> struct __is_integer {};
template<typename _Tp> struct __is_floating {};
template<typename _Tp> struct __is_pointer {};
template<typename _Tp> struct __is_arithmetic : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> > {};
template<typename _Tp> struct __is_scalar : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> > {};
}
namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) {
template<bool, typename> struct __enable_if {};
}
namespace std __attribute__ ((__visibility__ ("default"))) {
template<typename _OutputIterator, typename _Size, typename _Tp> inline typename __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value) {
for (__decltype(__n + 0) __niter = __n; __niter > 0; --__niter, ++__first)
*__first = __value;
}
I'm using gcc 4.6.3 and oink master with the lattice config on an clean Ubuntu 12.04. The header comes from the libstdc++6-4.6-dev package.
Edit: Ubuntu 12.04 instead of 14.04
When compiling oink on Mac OS X using Apple LLVM version 8.0.0 (clang-800.0.38) the following warning is seen:
gcc -c -o regions.o -I.. -iquote -DNMEMDEBUG -DSIZEOF_VOIDP=4 -Wall -g -O2 regions.c
In file included from regions.c:288:
../libregion/pages.c:270:3: warning: implicit declaration of function 'set_region_range' is invalid in C99 [-Wimplicit-function-declaration]
set_region_range(newp, (char *)newp + request_bytes, FREEPAGE);
^
In working with the latest code, both packaging for Gentoo and testing the analysis tools on an actual work task, I had a couple of things to report and a question. See here for the package build setup, basically some bash functions to run the package build commands and install things (the latter part is all manual). http://www.gentoogeek.org/portage-overlay/dev-util/oink-stack/
Issue 1)
Building as a Gentoo package using "./configure perform" everything builds fine with a current toolchain (gcc-4.5.2 plus the tools below) but the regression tests fail with an assert error:
x86_64-pc-linux-gnu-g++ -o triv/aSEb.gr.exe -DGRAMMAR_NAME=\"triv/aSEb.bin\" -g -Wall -Wno-deprecated -D__UNIX__ -DUSE_ENDSOURCELOC=1 -O2 -DNDEBUG -D__LINUX__ -I. -I../smbase -I../ast -Ic -fno-strict-aliasing triv/aSEb.gr.gen.o c/cc_lang.o c/parssppt.o c/lexer1.o c/lexer1yy.o c/lexer2.o trivmain.cc trivlex.o libelkhound.a -g -Wall -Werror ../ast/libast.a ../smbase/libsmbase.a rm triv/aSEb.gr.gen.o make[2]: Leaving directory `/var/tmp/portage/dev-util/oink-stack-9999/work/oink-stack-9999/elkhound' ------------ [1] triv/aSEb.gr.exe triv/aSEb.in1 ------------ Exception thrown: Assertion failed: !isStatic(base), file ../smbase/srcloc.h line 369 Assertion failed: !isStatic(base), file ../smbase/srcloc.h line 369 [1] A regression test command failed: triv/aSEb.gr.exe triv/aSEb.in1 make[1]: *** [check] Error 2 make[1]: Leaving directory `/var/tmp/portage/dev-util/oink-stack-9999/work/oink-stack-9999/elkhound' make: *** [check-rec] Error 1
System uname: Linux-2.6.36.3-rt-x86_64-AMD
sys-libs/glibc: 2.11.3
sys-devel/binutils: 2.21
sys-devel/gcc: 3.4.6-r2, 4.4.4-r2, 4.5.2
sys-devel/libtool: 2.4-r1
sys-devel/make: 3.81-r2
The same assert error is induced when scanning a particular source file with qual.
Issue 2)
Your docs say platform requires gcc 3.4, so I tried 3.4.6 since that's the only 3.4.x version in the Gentoo package tree. So, in building the platform stuff with gcc-3.4.6 there is a missing symbol error from an older gcc libc++:
$ make cd libc_glibc-2.3.5 && make all make[1]: Entering directory `oink-stack-9999/platform-model/libc_glibc-2.3.5' cd src && make all make[2]: Entering directory `oink-stack-9999/platform-model/libc_glibc-2.3.5/src' -- aio.c gcc aio.c -> aio.o cpp aio.c -> aio.oink.i oinkx aio.oink.i -> aio.odir oink/oink: /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by oink-stack-9999/oink/oink) oink/oink: /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.6/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by oink-stack-9999/oink/oink) make[2]: *** [aio.odir] Error 1 rm aio.oink.i make[2]: Leaving directory `oink-stack-9999/platform-model/libc_glibc-2.3.5/src' make[1]: *** [all] Error 2 make[1]: Leaving directory `oink-stack-9999/platform-model/libc_glibc-2.3.5'
It turns out those symbols are only found in dbg_util.o as shown below:
$ readelf -s ../oink/oink | grep 'GLIBCXX_3\.4\.9' | c++filt | grep _ZN 50: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSo9_M_insertIPKvEERSoT@GLIBCXX_3.4.9 (6) $ nm -A *.o | grep "_ZNSo9_M_insertIPKvEERSoT" dbg_util.o: U _ZNSo9_M_insertIPKvEERSoT_
So my question is...
Did you have any plans to update the above source file so it does not depend on such a narrow version of the C++ library implementation? If so, that should make it possible to package it (relatively) normally, otherwise it seems like I'd need to build it in a chroot with a very specific toolchain just so I can use it (and I would not have an easy way to package it to use the platform-model). Although shared libs/executables are preferred, I would at least be able to package it without the platform stuff.
Thanks in advance again
I tried to compile a (big, c++) project, and got that PARSING error in a standard C++ header:
In state 1138, I expected one of these tokens:
try, {,
/usr/include/c++/4.6/x86_64-linux-gnu/bits/c++config.h:154:1: Parse error (state 1138) at {
I think there is some inconsistencies between the #define in ast and elkhound
Commit 3d1b8bc introduces conflicting changes in definition and usage of yylex macro in ./elkhound/grampar.tab.cc
$ ./configure
Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at ./configure.pl line 109.
It seems to be a problem with recent Perl versions. kentcdodds/cloc#1
I've just did a conversion of https://github.com/dsw/oink-stack/blob/master/elsa/cc.gr to an EBNF
that can be used to generate a nice navigable railroad diagram and it can be viewd here https://mingodad.github.io/cpp-grammars/elsa-cc.gr.ebnf.xhtml , the EBNF
is here https://github.com/mingodad/cpp-grammars/blob/main/elsa-cc.gr.ebnf .
Thee you'll find EBNF
and railroad diagrams for other C++
grammars.
When compiling on Mac OS X using Apple LLVM version 8.0.0 (clang-800.0.38) the following error is seen
gcc -c -o regions.o -I.. -iquote -DNMEMDEBUG -DSIZEOF_VOIDP=4 -Wall -g -O2 regions.c
In file included from regions.c:288:
../libregion/pages.c:272:56: error: use of undeclared identifier 'zeroregion'; did you mean 'newregion'?
set_region_range(newp, (char *)newp + request_bytes, FREEPAGE);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.