test_vnswif - intf_delete test references freed memory

Bug #1715147 reported by Jacek Iżykowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenContrail
New
Undecided
Unassigned

Bug Description

Let's have a look into the following code from controller\src\vnsw\agent\vrouter\ksync\test\test_vnswif.cc:

01: // Validate that link-local address is deleted when interface is deleted
02: TEST_F(TestVnswIf, intf_delete) {
03: DeleteVmportEnv(input, 1, false);
04: client->WaitForIdle();
05: EXPECT_FALSE(vnswif_->IsValidLinkLocalAddress(vnet1_->mdata_ip_addr()));
06: EXPECT_TRUE(vnswif_->IsValidLinkLocalAddress(vnet2_->mdata_ip_addr()));
07: }

Statement from line 3 schedules deletion of object pointed by vnet1_. Once statement from line 4 is completed, the object has already been deleted. However, it is referenced in line 5. It means that freed memory is accessed. It may be unnoticed if that memory is still available to the process and there is still meaningful value, but this behavior is incorrect.

Tags: ci vrouter
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.