Comments (6)
@davidchisnall I had a look, and Trieste seems to be including snmallocshim-static, which I thought would be correct? Could you post me a repro, so I can investigate further?
from rego-cpp.
https://github.com/CHERIoT-Platform/cheriot-audit
Linking on macOS, we call __cxa_demangle
, which is provided by /usr/lib/libc++.1.dylib
. This gets its malloc
symbol from /usr/lib/libSystem.B.dylib
.
Running this test:
https://github.com/CHERIoT-Platform/cheriot-audit/blob/main/Tests/demangle_compartment_call.query
Crashes with a malloc error if this malloc
is too small:
I've added a hack to make it try to guess an adequate size.
In general, a library replacing malloc for an entire program is not a good idea. It would be nice if Trieste had an option to use snmalloc, but didn't do it unconditionally, then we could turn it off.
from rego-cpp.
(Note: for that specific case, I can pass nullptr
to force the callee to allocate, but then I get back a malloc'd pointer and I need to free it with the system malloc. I'm not sure what happens if I pass it to snmalloc's free
)
from rego-cpp.
(Note: for that specific case, I can pass
nullptr
to force the callee to allocate, but then I get back a malloc'd pointer and I need to free it with the system malloc. I'm not sure what happens if I pass it to snmalloc'sfree
)
Another crash.
from rego-cpp.
https://github.com/CHERIoT-Platform/cheriot-audit
Linking on macOS, we call
__cxa_demangle
, which is provided by/usr/lib/libc++.1.dylib
. This gets itsmalloc
symbol from/usr/lib/libSystem.B.dylib
.Running this test:
https://github.com/CHERIoT-Platform/cheriot-audit/blob/main/Tests/demangle_compartment_call.query
Crashes with a malloc error if this
malloc
is too small:I've added a hack to make it try to guess an adequate size.
In general, a library replacing malloc for an entire program is not a good idea. It would be nice if Trieste had an option to use snmalloc, but didn't do it unconditionally, then we could turn it off.
Probably best to have it off by default, and then we can turn it on where we know it works. It is already off for Windows as that doesn't work.
from rego-cpp.
I've updated to the latest version of Trieste, which has an explicit flag to disable snmalloc new override, which I believes resolves this issue.
from rego-cpp.
Related Issues (20)
- Performance issue with small policy HOT 6
- rego-cpp binaries are large HOT 1
- Not possible to use tools like heaptrack to analyze memory usage HOT 1
- `(1 - 7) % 3` computes to negative `-0` instead of `0`.
- Result of division is treated as float even if value is integer
- `json*` builtins
- `uuid` builtins
- rego.v1 import
- Debugging options could be more discoverable
- OPA test causes stray terms in output HOT 1
- Richer output from `rego` tool
- Var shadowing in comprehension contexts
- Well-formedness error on rego files starting with comments
- Failure parsing json HOT 1
- recursion not detected
- Build fails in snmalloc update HOT 1
- rule with else evaluated incorrectly HOT 2
- Rule definitions evaluating to undefined not ignored
- rule with value dependent on input silently disappears
- package directives that end with whitespace cause errors
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 rego-cpp.