segmentation fault
we are attempting to run f2k on centos 7.
f2k immediately segfault on start. this is not entirely deterministic as it will continue to run every once in a while:
16/Oct/2017 16:33:35 [rb_listener.c:154] Creating listening socket in port 9996
16/Oct/2017 16:33:35 [rb_kafka.c:58] Applying socket.keepalive.enable=true to rdkafka
16/Oct/2017 16:33:35 [rb_kafka.c:58] Applying socket.max.fails=3 to rdkafka
16/Oct/2017 16:33:35 [rb_kafka.c:58] Applying socket.keepalive.enable=true to rdkafka
16/Oct/2017 16:33:35 [rb_kafka.c:58] Applying socket.max.fails=3 to rdkafka
Segmentation fault (core dumped)
the segfault is due to readOnlyGlobals.rb_databases.sensors_info being null:
#0 get_sensor (database=0x0, ip=181607651) at rb_sensor.c:1329
#1 0x00000000004136e7 in netFlowCollectLoop0 (collector=<optimized out>, collector=<optimized out>) at rb_listener.c:87
#2 netFlowCollectLoop (_port_collector=0x625460) at rb_listener.c:136
#3 0x00007ffff7bc6dc5 in start_thread () from /lib64/libpthread.so.0
#4 0x00007ffff671d28d in clone () from /lib64/libc.so.6
the commandline we use:
f2k --debug --kafka=10.212.225.48:[email protected] --collector-port=9996 --rb-config=config_basic.json -b99 --template ../templates/ --event-log=test.log
any help advise appreciated.
This issue seems to be an invalid database file. Can you post the content of the config_basic.json file?
config is:
{
"sensors_networks": {
"10.211.28.227":{
"observations_id": {
"16777224":{
"enrichment":{
"sensor_ip":"10.211.28.227",
"sensor_name":"flow_test",
"observation_id":16777224
}
},
"16777248":{
"enrichment":{
"sensor_ip":"10.211.28.227",
"sensor_name":"flow_test",
"observation_id":16777248
}
},
"16777240":{
"enrichment":{
"sensor_ip":"10.211.28.227",
"sensor_name":"flow_test",
"observation_id":16777240
}
}
}
}
}
}
this does not explain why f2k will actually run after trying a few times. makes me think of a race condition....but that is just a guess.
I can't reproduce this issue. I tried your configuration and no segfault is produced. Maybe the problem is due to a different library version. There is an available a docker image which contains all the required dependencies with the correct versions.
You can take a look to the Dockerfile or use the image available on Docker Hub.
Using f2k with Docker:
- Clone the repo and cd to the project folder
- The following command will open a shell inside the container:
docker run -it --rm -v $(pwd):/app redborder/dev-containers:f2k
- Compile with
./cofigureandmake - Run
f2k
something that might be different is that the netflow packets are send continuously while f2k attempts to startup. not sure if that will have an impact?
will try the docker instance. thank you for the tip.
Closing this due to inactivity