Comments (4)
The as_monitor calls in ev_loop.txt
are not necessary and cause the program to hang because as_monitor_notify() is never called. After removing all as_monitor calls, the program runs to completion:
e = 0x7fdb03403930 loop = 0x7fdb03403a00, next = 0x7fdb03403930 c = 0x7fdb03403930
I could never get the program to segfault.
from aerospike-client-c.
Thanks a lot for immediate response. Sorry I did not share details about my development environment.
Here are the details
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
# dpkg -l | grep -i aero
ii aerospike-client-c-libev-devel 4.1.2 amd64 Aerospike Client Development with libev
Like you suggested, removed as_monitor code.
# gcc -o ev_loop ev_loop.c -ggdb -laerospike -lssl -lcrypto -lpthread -lm -lz -lev
# ulimit -c unlimited
# ./ev_loop 192.168.2.14
e = 0x1783030 loop = 0x1784100, next = 0x1 c = 0x1783030
Segmentation fault (core dumped)
# ls core
core
Debugging core file shows link list is corrupt
root@ubuntu-template:~/sources# gdb ./ev_loop core
...
...
(gdb) bt
#0 0x0000000000402af7 in as_event_loop_get () at /usr/include/aerospike/as_event.h:223
#1 0x0000000000402e36 in main (argc=2, argv=0x7ffc4d9fa908) at ev_loop.c:100
(gdb) frame 0
#0 0x0000000000402af7 in as_event_loop_get () at /usr/include/aerospike/as_event.h:223
223 as_event_loop_current = event_loop->next;
(gdb) print event_loop
$1 = (as_event_loop *) 0x1
(gdb) print as_event_loops[0]
$2 = {loop = 0x1784100, next = 0x1, lock = {__data = {__lock = 0, __count = 0, __owner = 24653872, __nusers = 0, __kind = 204278650, __spins = 32516,
__elision = 0, __list = {__prev = 0x0, __next = 0x1783030}},
__size = "\000\000\000\000\000\000\000\000\060\060x\001\000\000\000\000z\v-\f\004\177\000\000\000\000\000\000\000\000\000\000\060\060x\001\000\000\000",
__align = 0}, queue = {data = 0x0, capacity = 0, head = 0, tail = 0, item_size = 0, total = 0, flags = 0}, pipe_cb_queue = {data = 0x0, capacity = 24660032,
head = 0, tail = 256, item_size = 0, total = 0, flags = 8}, thread = 4294967296, index = 24654064, pipe_cb_calling = false}
(gdb) print i
$1 = 1 <<<< first as_event_loop_get() was successful.
Uploading complete code, executable, and core file.
aero-client.zip
Could this be problem with 4.1.2 version of the lib? Shall I use library from latest master instead? Please let me know if you need more information from my side.
Thanks and Regards,
Prasad
from aerospike-client-c.
I found the problem. AS_USE_LIBEV must be defined when compiling ev_loop.c.
gcc -DAS_USE_LIBEV -o ev_loop ev_loop.c -ggdb -laerospike -lssl -lcrypto -lpthread -lm -lz -lev
Otherwise, as_event_loop would have a different definition in your program compared with the compiled libaerospike.
from aerospike-client-c.
Yes indeed defining AS_USE_LIBEV works perfectly. Thanks a lot for your time. Closing the case.
from aerospike-client-c.
Related Issues (20)
- warning: 'MSG_NOSIGNAL' macro redefined (on macOS) HOT 1
- Deleting bins by setting values to null or empty string HOT 1
- Undefined symbols in static library HOT 2
- cmake support HOT 4
- Is this project still under maintenance HOT 1
- Unable to found benchmarks in aerospike-client-c HOT 2
- Logstash Pipeline Error
- Crash in as_node_ensure_login_shm when remote servers are restarted HOT 16
- Compile failed with "the clang compiler does not support '-march=nocona'" HOT 2
- crash inside as_cluster_tend on arm64 HOT 4
- Give a name to worker threads HOT 3
- apple silicon / arm support HOT 9
- Release tagged 4.6.24 refers to missing .gitmodules HOT 1
- On batch reads only AS_POLICY_REPLICA_SEQUENCE will actually find new nodes for requests, AS_POLICY_REPLICA_ANY will try the same node and fail again. HOT 6
- aerospike-client-c link error with extra compiler flags -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer HOT 1
- can not build without lua HOT 1
- Missing as_buffer.h in installed includes HOT 1
- scan callback failing with memory fault issue HOT 1
- Build fails for 6.4.1 with luajit HOT 1
- crash on exit in as_cluster_tender (after libuv event loop is stopped) 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 aerospike-client-c.