openNetVM icon indicating copy to clipboard operation
openNetVM copied to clipboard

Segmentation Fault From ONVM Web

Open kevindweb opened this issue 4 years ago • 0 comments

Bug Report

Due to my own code, there is a segfault only when running manager with -s web.

Current Behavior When we run any configuration of manager with -s web, I can get it to segfault every time. The issue is caused by #82 . Key points:

  • It does not matter what NF you run, just run one
  • You don't actually have to look at the web output, that's irrelevant to this issue
  • Things only need to initialize, you don't need to run for a long time or anything

Expected behavior/code We should not have segmentation faults.

Steps to reproduce

  1. Run manager with ./go.sh 0,1,2,3 1 0xF0 -s web
  2. Run any NF, multiple is fine. I tested with:
  • Speed_tester ./go.sh 1 -d 1
  • Basic_monitor ./go.sh 1
  1. Once NF is running, ^C on the manager
  2. Watch segfault

Environment

  • OS: Ubuntu 18.04
  • onvm version: Current
  • dpdk version:
  • other info:

Possible Solution I think I found the solution, but might want to wait on it until the release is complete to add more PRs. Instead of:

cJSON_Delete(onvm_json_root);
cJSON_Delete(onvm_json_events_arr);

We want:

cJSON_Delete(onvm_json_events_arr);
cJSON_Delete(onvm_json_root);

My thought is that there are shared members between the two cJSON objects, and when root is deleted first, cJSON faults out on line https://github.com/sdnfv/openNetVM/blob/master/onvm/lib/cJSON.c#L1877

kevindweb avatar Apr 15 '20 20:04 kevindweb