Return-Path: X-Original-To: apmail-cloudstack-dev-archive@www.apache.org Delivered-To: apmail-cloudstack-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 526B21094D for ; Mon, 24 Nov 2014 13:03:56 +0000 (UTC) Received: (qmail 4294 invoked by uid 500); 24 Nov 2014 13:03:55 -0000 Delivered-To: apmail-cloudstack-dev-archive@cloudstack.apache.org Received: (qmail 4249 invoked by uid 500); 24 Nov 2014 13:03:55 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Delivered-To: moderator for dev@cloudstack.apache.org Received: (qmail 98077 invoked by uid 99); 24 Nov 2014 13:00:20 -0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= X-Spam-Check-By: apache.org Received-SPF: unknown (nike.apache.org: error in processing during lookup of scan-admin@coverity.com) Date: Mon, 24 Nov 2014 04:59:51 -0800 From: scan-admin@coverity.com To: dev@cloudstack.apache.org Message-ID: <54732bc7816ea_331b475338669d1@scan.coverity.com.mail> Subject: New Defects reported by Coverity Scan for cloudstack Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 24 Nov 2014 12:59:14.0336 (UTC) FILETIME=[72C88200:01D007E6] X-Virus-Checked: Checked by ClamAV on apache.org Hi, Please find the latest report on new defect(s) introduced to cloudstack found with Coverity Scan. 9 new defect(s) introduced to cloudstack found with Coverity Scan. 22 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 9 of 9 defect(s) ** CID 1147101: NP: Null pointer dereference (FB.NP_BOOLEAN_RETURN_NULL) /plugins/hypervisors/hyperv/src/com/cloud/ha/HypervInvestigator.java: 52 in com.cloud.ha.HypervInvestigator.isVmAlive(com.cloud.vm.VirtualMachine, com.cloud.host.Host)() ** CID 1255922: Dm: Dubious method used (FB.DM_DEFAULT_ENCODING) /utils/src/org/apache/cloudstack/utils/graphite/GraphiteClient.java: 85 in org.apache.cloudstack.utils.graphite.GraphiteClient.sendMetrics(java.util.Map, long)() ** CID 1255921: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2566 in com.cloud.storage.VolumeApiServiceImpl.orchestrateAttachVolumeToVM(com.cloud.vm.VmWorkAttachVolume)() ** CID 1255920: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2589 in com.cloud.storage.VolumeApiServiceImpl.orchestrateMigrateVolume(com.cloud.vm.VmWorkMigrateVolume)() ** CID 1255919: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2581 in com.cloud.storage.VolumeApiServiceImpl.orchestrateResizeVolume(com.cloud.vm.VmWorkResizeVolume)() ** CID 1255918: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2596 in com.cloud.storage.VolumeApiServiceImpl.orchestrateTakeVolumeSnapshot(com.cloud.vm.VmWorkTakeVolumeSnapshot)() ** CID 1255917: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2574 in com.cloud.storage.VolumeApiServiceImpl.orchestrateDetachVolumeFromVM(com.cloud.vm.VmWorkDetachVolume)() ** CID 1255916: Dereference null return value (NULL_RETURNS) /engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java: 1422 in org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.cleanupStorageJobs()() /engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java: 1425 in org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.cleanupStorageJobs()() /engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java: 1428 in org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.cleanupStorageJobs()() ** CID 1255915: Dereference null return value (NULL_RETURNS) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2591 in com.cloud.storage.VolumeApiServiceImpl.orchestrateMigrateVolume(com.cloud.vm.VmWorkMigrateVolume)() ________________________________________________________________________________________________________ *** CID 1147101: NP: Null pointer dereference (FB.NP_BOOLEAN_RETURN_NULL) /plugins/hypervisors/hyperv/src/com/cloud/ha/HypervInvestigator.java: 52 in com.cloud.ha.HypervInvestigator.isVmAlive(com.cloud.vm.VirtualMachine, com.cloud.host.Host)() 46 @Override 47 public Boolean isVmAlive(com.cloud.vm.VirtualMachine vm, Host host) { 48 Status status = isAgentAlive(host); 49 if (status == null) { 50 return null; 51 } >>> CID 1147101: NP: Null pointer dereference (FB.NP_BOOLEAN_RETURN_NULL) >>> Another occurrence here 52 return status == Status.Up ? true : null; 53 } 54 55 @Override 56 public Status isAgentAlive(Host agent) { 57 if (agent.getHypervisorType() != Hypervisor.HypervisorType.Hyperv) { ________________________________________________________________________________________________________ *** CID 1255922: Dm: Dubious method used (FB.DM_DEFAULT_ENCODING) /utils/src/org/apache/cloudstack/utils/graphite/GraphiteClient.java: 85 in org.apache.cloudstack.utils.graphite.GraphiteClient.sendMetrics(java.util.Map, long)() 79 */ 80 public void sendMetrics(Map metrics, long timeStamp) { 81 try (DatagramSocket sock = new DatagramSocket()){ 82 InetAddress addr = InetAddress.getByName(this.graphiteHost); 83 84 for (Map.Entry metric: metrics.entrySet()) { >>> CID 1255922: Dm: Dubious method used (FB.DM_DEFAULT_ENCODING) >>> Found reliance on default encoding: String.getBytes() 85 byte[] message = new String(metric.getKey() + " " + metric.getValue() + " " + timeStamp + "\n").getBytes(); 86 DatagramPacket packet = new DatagramPacket(message, message.length, addr, graphitePort); 87 sock.send(packet); 88 } 89 } catch (UnknownHostException e) { 90 throw new GraphiteException("Unknown host: " + graphiteHost); ________________________________________________________________________________________________________ *** CID 1255921: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2566 in com.cloud.storage.VolumeApiServiceImpl.orchestrateAttachVolumeToVM(com.cloud.vm.VmWorkAttachVolume)() 2560 AsyncJobExecutionContext.getCurrentExecutionContext().joinJob(workJob.getId()); 2561 2562 return new VmJobSnapshotOutcome(workJob,snapshotId); 2563 } 2564 2565 @ReflectionUse >>> CID 1255921: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) >>> Private method com.cloud.storage.VolumeApiServiceImpl.orchestrateAttachVolumeToVM(VmWorkAttachVolume) is never called 2566 private Pair orchestrateAttachVolumeToVM(VmWorkAttachVolume work) throws Exception { 2567 Volume vol = orchestrateAttachVolumeToVM(work.getVmId(), work.getVolumeId(), work.getDeviceId()); 2568 2569 return new Pair(JobInfo.Status.SUCCEEDED, 2570 _jobMgr.marshallResultObject(new Long(vol.getId()))); 2571 } ________________________________________________________________________________________________________ *** CID 1255920: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2589 in com.cloud.storage.VolumeApiServiceImpl.orchestrateMigrateVolume(com.cloud.vm.VmWorkMigrateVolume)() 2583 work.getNewServiceOfferingId(), work.isShrinkOk()); 2584 return new Pair(JobInfo.Status.SUCCEEDED, 2585 _jobMgr.marshallResultObject(new Long(vol.getId()))); 2586 } 2587 2588 @ReflectionUse >>> CID 1255920: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) >>> Private method com.cloud.storage.VolumeApiServiceImpl.orchestrateMigrateVolume(VmWorkMigrateVolume) is never called 2589 private Pair orchestrateMigrateVolume(VmWorkMigrateVolume work) throws Exception { 2590 Volume newVol = orchestrateMigrateVolume(work.getVolumeId(), work.getDestPoolId(), work.isLiveMigrate()); 2591 return new Pair(JobInfo.Status.SUCCEEDED, 2592 _jobMgr.marshallResultObject(new Long(newVol.getId()))); 2593 } 2594 ________________________________________________________________________________________________________ *** CID 1255919: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2581 in com.cloud.storage.VolumeApiServiceImpl.orchestrateResizeVolume(com.cloud.vm.VmWorkResizeVolume)() 2575 Volume vol = orchestrateDetachVolumeFromVM(work.getVmId(), work.getVolumeId()); 2576 return new Pair(JobInfo.Status.SUCCEEDED, 2577 _jobMgr.marshallResultObject(new Long(vol.getId()))); 2578 } 2579 2580 @ReflectionUse >>> CID 1255919: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) >>> Private method com.cloud.storage.VolumeApiServiceImpl.orchestrateResizeVolume(VmWorkResizeVolume) is never called 2581 private Pair orchestrateResizeVolume(VmWorkResizeVolume work) throws Exception { 2582 Volume vol = orchestrateResizeVolume(work.getVolumeId(), work.getCurrentSize(), work.getNewSize(), work.getNewMinIops(), work.getNewMaxIops(), 2583 work.getNewServiceOfferingId(), work.isShrinkOk()); 2584 return new Pair(JobInfo.Status.SUCCEEDED, 2585 _jobMgr.marshallResultObject(new Long(vol.getId()))); 2586 } ________________________________________________________________________________________________________ *** CID 1255918: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2596 in com.cloud.storage.VolumeApiServiceImpl.orchestrateTakeVolumeSnapshot(com.cloud.vm.VmWorkTakeVolumeSnapshot)() 2590 Volume newVol = orchestrateMigrateVolume(work.getVolumeId(), work.getDestPoolId(), work.isLiveMigrate()); 2591 return new Pair(JobInfo.Status.SUCCEEDED, 2592 _jobMgr.marshallResultObject(new Long(newVol.getId()))); 2593 } 2594 2595 @ReflectionUse >>> CID 1255918: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) >>> Private method com.cloud.storage.VolumeApiServiceImpl.orchestrateTakeVolumeSnapshot(VmWorkTakeVolumeSnapshot) is never called 2596 private Pair orchestrateTakeVolumeSnapshot(VmWorkTakeVolumeSnapshot work) throws Exception { 2597 Account account = _accountDao.findById(work.getAccountId()); 2598 orchestrateTakeVolumeSnapshot(work.getVolumeId(), work.getPolicyId(), work.getSnapshotId(), 2599 account, work.isQuiesceVm()); 2600 return new Pair(JobInfo.Status.SUCCEEDED, 2601 _jobMgr.marshallResultObject(work.getSnapshotId())); ________________________________________________________________________________________________________ *** CID 1255917: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2574 in com.cloud.storage.VolumeApiServiceImpl.orchestrateDetachVolumeFromVM(com.cloud.vm.VmWorkDetachVolume)() 2568 2569 return new Pair(JobInfo.Status.SUCCEEDED, 2570 _jobMgr.marshallResultObject(new Long(vol.getId()))); 2571 } 2572 2573 @ReflectionUse >>> CID 1255917: UPM: Private method is never called (FB.UPM_UNCALLED_PRIVATE_METHOD) >>> Private method com.cloud.storage.VolumeApiServiceImpl.orchestrateDetachVolumeFromVM(VmWorkDetachVolume) is never called 2574 private Pair orchestrateDetachVolumeFromVM(VmWorkDetachVolume work) throws Exception { 2575 Volume vol = orchestrateDetachVolumeFromVM(work.getVmId(), work.getVolumeId()); 2576 return new Pair(JobInfo.Status.SUCCEEDED, 2577 _jobMgr.marshallResultObject(new Long(vol.getId()))); 2578 } 2579 ________________________________________________________________________________________________________ *** CID 1255916: Dereference null return value (NULL_RETURNS) /engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java: 1422 in org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.cleanupStorageJobs()() 1416 VmWorkMigrateVolume.class.getName(), VmWorkTakeVolumeSnapshot.class.getName()); 1417 1418 for (AsyncJobVO job : jobs) { 1419 try { 1420 if (job.getCmd().equalsIgnoreCase(VmWorkAttachVolume.class.getName())) { 1421 VmWorkAttachVolume work = VmWorkSerializer.deserialize(VmWorkAttachVolume.class, job.getCmdInfo()); >>> CID 1255916: Dereference null return value (NULL_RETURNS) >>> Calling a method on null object "work". 1422 cleanupVolumeDuringAttachFailure(work.getVolumeId()); 1423 } else if (job.getCmd().equalsIgnoreCase(VmWorkMigrateVolume.class.getName())) { 1424 VmWorkMigrateVolume work = VmWorkSerializer.deserialize(VmWorkMigrateVolume.class, job.getCmdInfo()); 1425 cleanupVolumeDuringMigrationFailure(work.getVolumeId(), work.getDestPoolId()); 1426 } else if (job.getCmd().equalsIgnoreCase(VmWorkTakeVolumeSnapshot.class.getName())) { 1427 VmWorkTakeVolumeSnapshot work = VmWorkSerializer.deserialize(VmWorkTakeVolumeSnapshot.class, job.getCmdInfo()); /engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java: 1425 in org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.cleanupStorageJobs()() 1419 try { 1420 if (job.getCmd().equalsIgnoreCase(VmWorkAttachVolume.class.getName())) { 1421 VmWorkAttachVolume work = VmWorkSerializer.deserialize(VmWorkAttachVolume.class, job.getCmdInfo()); 1422 cleanupVolumeDuringAttachFailure(work.getVolumeId()); 1423 } else if (job.getCmd().equalsIgnoreCase(VmWorkMigrateVolume.class.getName())) { 1424 VmWorkMigrateVolume work = VmWorkSerializer.deserialize(VmWorkMigrateVolume.class, job.getCmdInfo()); >>> CID 1255916: Dereference null return value (NULL_RETURNS) >>> Calling a method on null object "work". 1425 cleanupVolumeDuringMigrationFailure(work.getVolumeId(), work.getDestPoolId()); 1426 } else if (job.getCmd().equalsIgnoreCase(VmWorkTakeVolumeSnapshot.class.getName())) { 1427 VmWorkTakeVolumeSnapshot work = VmWorkSerializer.deserialize(VmWorkTakeVolumeSnapshot.class, job.getCmdInfo()); 1428 cleanupVolumeDuringSnapshotFailure(work.getVolumeId(), work.getSnapshotId()); 1429 } 1430 } catch (Exception e) { /engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java: 1428 in org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.cleanupStorageJobs()() 1422 cleanupVolumeDuringAttachFailure(work.getVolumeId()); 1423 } else if (job.getCmd().equalsIgnoreCase(VmWorkMigrateVolume.class.getName())) { 1424 VmWorkMigrateVolume work = VmWorkSerializer.deserialize(VmWorkMigrateVolume.class, job.getCmdInfo()); 1425 cleanupVolumeDuringMigrationFailure(work.getVolumeId(), work.getDestPoolId()); 1426 } else if (job.getCmd().equalsIgnoreCase(VmWorkTakeVolumeSnapshot.class.getName())) { 1427 VmWorkTakeVolumeSnapshot work = VmWorkSerializer.deserialize(VmWorkTakeVolumeSnapshot.class, job.getCmdInfo()); >>> CID 1255916: Dereference null return value (NULL_RETURNS) >>> Calling a method on null object "work". 1428 cleanupVolumeDuringSnapshotFailure(work.getVolumeId(), work.getSnapshotId()); 1429 } 1430 } catch (Exception e) { 1431 s_logger.debug("clean up job failure, will continue", e); 1432 } 1433 } ________________________________________________________________________________________________________ *** CID 1255915: Dereference null return value (NULL_RETURNS) /server/src/com/cloud/storage/VolumeApiServiceImpl.java: 2591 in com.cloud.storage.VolumeApiServiceImpl.orchestrateMigrateVolume(com.cloud.vm.VmWorkMigrateVolume)() 2585 _jobMgr.marshallResultObject(new Long(vol.getId()))); 2586 } 2587 2588 @ReflectionUse 2589 private Pair orchestrateMigrateVolume(VmWorkMigrateVolume work) throws Exception { 2590 Volume newVol = orchestrateMigrateVolume(work.getVolumeId(), work.getDestPoolId(), work.isLiveMigrate()); >>> CID 1255915: Dereference null return value (NULL_RETURNS) >>> Calling a method on null object "newVol". 2591 return new Pair(JobInfo.Status.SUCCEEDED, 2592 _jobMgr.marshallResultObject(new Long(newVol.getId()))); 2593 } 2594 2595 @ReflectionUse 2596 private Pair orchestrateTakeVolumeSnapshot(VmWorkTakeVolumeSnapshot work) throws Exception { ________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/943?tab=overview To unsubscribe from the email notification for new defects, http://scan5.coverity.com/cgi-bin/unsubscribe.py