Comments (10)
It would help if you could provide more information:
What compiler are you using? (and what version?) If you're using clang, are you using the Apple variant or plain Clang installed e.g. via brew?
GCC 5 installed via brew works with address sanitization (I know because I run it in Travis CI, https://travis-ci.org/google/fruit), but other compilers I've tried on OS X don't work with sanitization enabled (it might be a Fruit issue or a compiler issue, not sure).
Unfortunately I don't have a Mac so I'm unable to debug this. If you could run one of the failing tests in a debugger and see where it fails it would be very helpful for me in debugging this.
from fruit.
Oh, and also if you run ctest with the --output-on-failure
flag, it would tell us what error the tests are failing with.
For an in-source build you should run ctest --output-on-failure
from the tests/
directory. For an out-of-source build (say, in a directory called build/
), you should run it from the build/tests/
directory.
from fruit.
Running "Apple LLVM 7.3.0". Not sure which clang version that equates...
from fruit.
I tried to glance quickly at the code, in our codebase, it reports the error on HybridVector - a "out-of-container", on "std::vector::push_back"(_slow_path), but I can't figure out how the code can do that ...
from fruit.
Could you please run crest as advised in the previous comment and post the resul
from fruit.
^result?
from fruit.
Will try tomorrow.
from fruit.
Actually I ran the tests in Travis CI and the error there was that AppleClang 7.3.0 doesn't support -fsanitize=undefined
at all: https://travis-ci.org/google/fruit/jobs/133207796
I've now removed the INSTRUMENT_WITH_SANITIZERS CMake option in master and changed the postsubmit scripts to pass the desired sanitization in CXXFLAGS, you should probably do the same and pass -fsanitize=address
(which is supported by AppleClang) but leaving out the -fsanitize=undefined
(which isn't, and was probably causing the failures you saw).
See 982f470
Note that you don't need to update Fruit, just use the latest released version and pass the flag mentioned above in CXXFLAGS instead of using INSTRUMENT_WITH_SANITIZERS.
@vendethiel:
in one of your comments you mention a runtime error in your codebase. If you're unable to find any bug in your code using sanitization, feel free to file a bug for that, ideally providing sample code with which I can reproduce the issue.
I can then check if the sample code is doing sth wrong or if you're hitting a bug in Fruit.
from fruit.
Hi,
Seems to be related to this: google/sanitizers#362
It works if I recompile fruit itself with sanitizers, then link against it. Bummer...
from fruit.
Oh, I see.
Yes, compiling things with different compiler flags that affect behaviour and then linking them together usually doesn't work very well. It's like compiling with different macros set, you're very likely to break the ODR for definitions in headers.
from fruit.
Related Issues (20)
- what should I do to use a string as an annotion of some bind? HOT 3
- VS2022 Just My Code for Fruit Library fails using CMAKE HOT 6
- Create a fruit::Component by iterating over a list of fruit::Components HOT 7
- Can fruit be used with C language? HOT 2
- Handling lifetimes HOT 6
- Providing non-injected arguments to DI Objects HOT 14
- Build fails with Visual Studio 2022 with C++20 HOT 8
- Fruit with QT HOT 4
- Factories with reference types broken in fruit 3.7.0
- Generic binding? HOT 2
- Defining Factory Functions for Objects with Multiple Constructors HOT 11
- Replace boost HOT 1
- Creating Collections of DI Objects HOT 3
- [Suggestion] ExtractFirstError meta function SHOULD be non-error safe HOT 2
- Can no longer build examples in VS2022 Preview built by Visual Studio, VS CMake builds OK HOT 7
- Examples miss virtual dtor
- bindInstance with copy HOT 13
- Understanding Compiler error messages in Fruit HOT 6
- Adding a special constructor to one implementation of an interface HOT 13
- Unable to build with Bazel on Linux HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fruit.