Comments (7)
Hi David,
- try recent gc7.3alpha3 snapshot
- if you turn off incremental collection, it works, right?
- what's your target CPU and OS?
Regards,
Ivan
Wed, 21 Aug 2013, 23:24 -07:00 from David Terei [email protected]:
I'm trying to use the GC in the memcached code base and running into the following issue. Note, this is a modified memcached setup so that the connection objects and various buffers per-connection for reading and writing to the network are managed by the GC. The storage engine for the key-value store is left alone, still uses malloc and reference counting.
- Enable incremental collection
- Connect to memcached server with one client and start generating load -- works fine.
- Connect as above with a second client -- first client will have its connection shutdown as during a read system call an EFAULT will occur, so the memcached code kills that client.
I'm not sure why an EFAULT is occurring for the first client. The buffer that it is trying to read into is one allocated by GC_malloc and so I assume something is going wrong with the page protection for incremental collection. I'm not able to figure out more than that.
This is with 7.3alpha2 .
—
Reply to this email directly or view it on GitHub .
Иван Майданский
from bdwgc.
- Trying now.
- Yes.
- x64 - Xeon E5620, Arch Linux.
You can see the changes I made to memcached to integrate the GC here. I believe I'm doing everything correct but perhaps not.
from bdwgc.
Sorry but where do I find the gc7.3alpha3 snapshot? Can't see any tag in git or mention in logs, nor find on gc homepage... What is the git hash?
from bdwgc.
Hi David,
Please use BDWGC mailing list for the discussion ([email protected]). Please also keep history in the mail otherwise it's hard to follow what your "2. Yes" means.
Sorry but where do I find the gc7.3alpha3 snapshot? Can't see any tag in git or mention in logs, nor find on gc homepage... What is the git hash?
Just use latest commit from master branch (e.g., 4872305) .
Thu, 22 Aug 2013, 0:02 -07:00 from David Terei [email protected]:
- Trying now.
- Yes.
- x64 - Xeon E5620, Arch Linux.
You can see the changes I made to memcached to integrate the GC here . I believe I'm doing everything correct but perhaps not.
I've glanced your changes:- I think you need to call GC_INIT.
- Have you verified that all pthread_create calls are intercepted by GC?
- Just performance concern: Why not to use GC_MALLOC_ATOMIC for buffers?
—
Reply to this email directly or view it on GitHub .
Regards,
Ivan
from bdwgc.
On 22 August 2013 02:46, Ivan Maidanski [email protected] wrote:
Hi David,
Please use BDWGC mailing list for the discussion ([email protected]). Please also keep history in the mail otherwise it's hard to follow what your "2. Yes" means.
OK.
Sorry but where do I find the gc7.3alpha3 snapshot? Can't see any tag in git or mention in logs, nor find on gc homepage... What is the git hash?
Just use latest commit from master branch (e.g., 4872305) .
OK, tried this, still same error.
Thu, 22 Aug 2013, 0:02 -07:00 from David Terei [email protected]:
- Trying now.
- Yes.
- x64 - Xeon E5620, Arch Linux.
You can see the changes I made to memcached to integrate the GC here . I believe I'm doing everything correct but perhaps not.
I've glanced your changes:- I think you need to call GC_INIT.
Already calling GC_INIT, see here:
dterei/memcached@d9c1634#L0R4759
- Have you verified that all pthread_create calls are intercepted by GC?
I just went and changed all pthread_create
calls to
GC_pthread_create
calls and still got the same issue. I've actually
been running memcached with just 1 thread so as to remove that
complexity and I still get the bug.
- Just performance concern: Why not to use GC_MALLOC_ATOMIC for buffers?
Sure, I'm just trying to get something stable first, plan to try
allocation hints after that.
—
Reply to this email directly or view it on GitHub .
Regards,
Ivan—
Reply to this email directly or view it on GitHub.
from bdwgc.
The discussion goes to BDWGC mailing list...
from bdwgc.
Copying Hans answer here in case other people come across this when searching.
It sounds to me like you're getting EFAULT during a read() system call which is writing to the
garbage-collected heap. That's unfortunately an expected problem with incremental collection.
Incremental collection has to protect the heap and catch write faults to track stores into the heap. That
works find for store instructions, but doesn't work correctly for Linux system calls.
I suspect the easiest correct way out is to make sure that the read system call writes to an atomic
(pointer-free) section of the heap, and call GC_incremental_protection_needs() to check whether it is
safe to call GC_enable_incremental. It should be on normal x86 systems.
As an alternative, it should be possible to wrap the read system call so as to avoid this problem. Last I
checked, there was sample code to do so in os_dep.c (grep for __wrap_read).
Hans
from bdwgc.
Related Issues (20)
- Only conditionally include `<signal.h>` HOT 5
- Memory allocated with `GC_memalign` or `GC_posix_memalign` can't be manually freed. HOT 4
- Enable GC_set_handle_fork(1) with incremental mode on for single-threaded build on Darwin HOT 1
- Re-enable incremental mode in child process on Darwin
- Re-enable thread-local allocation for GC_memalign
- SIGSEGV in subthreadcreatetest on Debian/x64
- Remove dependency on CoreFoundation or make it optional HOT 4
- Unexpected heap growth in gctest on Linux with malloc redirection HOT 2
- Regression: support of macOS before 10.7 HOT 8
- Soft-dirty bit is not supported by kernel on Ubuntu 22.04/x86_64 HOT 4
- Test crash on Windows if GWW mode and checksums
- gctest fails if shared build by Zig HOT 5
- Zig support improvement HOT 11
- Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS HOT 5
- compile fail on Win10/MSVC HOT 2
- Bad maximum heap size on large initial heap HOT 4
- Zig warning of "large atomic operation may incur significant performance penalty" on 32-bit arm HOT 7
- Assertion violation of GC_stop_count&THREAD_RESTARTED in GC_restart_all running disclaimtest
- Illegal instruction in GC_clear_stack in tests built by Zig on Linux HOT 7
- disclaimtest, weakmaptest or middletest fail in zig build on Linux if enable_gc_debug and enable_redirect_malloc HOT 5
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 bdwgc.