Comments (3)
2021-12-21 16:07:08.342 [1839657] main C> entering the event loop
tarantool: /home/sergeyb/sources/MRG/memcached/third_party/small/small/slab_cache.c:58: slab_assert: Assertion `pthread_equal(cache->thread_id, pthread_self())' failed.
[001] binary/binary-expire.test.py
[001]
[001] [Instance "binary" killed by signal: 6 (SIGABRT)]
[001] Found assertion fail in the results file [/home/sergeyb/sources/MRG/memcached/test/var/001_binary/binary.log]:
Tarantool 2.10.0-beta1-376-gd2a012455
from memcached.
Looks related to #59, we had libsmall update in tarantool recently: tarantool/tarantool#6678.
However after tarantool/tarantool#5932 it should not hit us. At least, not due to symbols clash.
I grepped cord_slab_cache()
usage:
$ ag cord_slab_cache
memcached/internal/network.c
34: mempool_create(&ibuf_pool, cord_slab_cache(), sizeof(struct ibuf));
35: mempool_create(&obuf_pool, cord_slab_cache(), sizeof(struct obuf));
51: ibuf_create((struct ibuf *)ibuf, cord_slab_cache(), iobuf_readahead);
60: obuf_create((struct obuf *)obuf, cord_slab_cache(), iobuf_readahead);
memcached/internal/memcached.c
250: region_create(&con.gc, cord_slab_cache());
memcached/internal/alloc.c
9: struct slab *slab = slab_get(cord_slab_cache(), len);
31: if (ptr) slab_put(cord_slab_cache(), slab_from_data(ptr));
At least we try to use module's region_create()
together with tarantool's slab cache. We also try to use memcached's slab_get()
/ slab_put()
with tarantool's slab cache.
from memcached.
The key reason of the fails is curious. Look at 1.1-91-g6bb9a52 in small. It fixes the following lines (the code below is the fixed version):
struct slab_cache {
<...>
#ifndef NDEBUG // !! it was _NDEBUG
pthread_t thread_id;
#endif
};
static inline void
slab_cache_set_thread(struct slab_cache *cache)
{
(void) cache;
#ifndef NDEBUG // !! it was _NDEBUG
cache->thread_id = pthread_self();
#endif
}
Before the change this code were always compiled (as in Debug as well as in the RelWithDebInfo builds). After tarantool 2.10.0-beta1-315-g173ce9fbb, where this fix lands, the ifndef'ed code present only in the Debug build.
When memcached is built in the Debug configuration the following assertion is in effect:
static inline void
slab_assert(struct slab_cache *cache, struct slab *slab)
{
<...>
assert(pthread_equal(cache->thread_id, pthread_self()));
<...>
}
Since we're using a slab cache from tarantool, which is built as RelWithDebInfo, there is no thread_id
field in the structure and it is not filled by actual thread ID. It contains garbage and the assertion fails.
Curious effect of this is that RelWithDebInfo tarantool should work with RelWithDebInfo memcached and Debug tarantool should work with Debug/RelWithDebInfo memcached. IOW, only RelWithDebInfo tarantool plus Debug memcached does not work. At least in context of this issue: I don't know, whether using of tarantool's slab cache in the module leads to other problems.
from memcached.
Related Issues (20)
- Wrong check for 'readahead' option value
- Convert port number to string automatically HOT 1
- text/noreply.test.py fails sporadically
- Hotreload is unsupported
- libmemcached doesn't build on Ubuntu 22.04.1 LTS HOT 4
- module doesn't work correctly after switching rw->ro->rw HOT 2
- text/getset.test.py has failed
- Unclear error when memcached instance created without box initialization
- No such option 'proto'
- CMake target 'libmemcached' is broken HOT 5
- Fix memtier benchmark
- Update tests for Python 3
- memcached uses libmemcached in personal GH account
- CMake target 'libmemcached' is not idempotent
- Use libmemcached benchmark memaslap
- Replace libmemcached GIT submodule with OS package libmemcached HOT 6
- Bump version of memtier submodule
- Bump version of small library HOT 1
- Report statistics to tarantool/metrics
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 memcached.