This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256922 - fix issues discovered in nativeexecution tools
Summary: fix issues discovered in nativeexecution tools
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: execution (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-02 11:21 UTC by Vladimir Kvashin
Modified: 2016-02-18 12:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2015-12-02 11:21:07 UTC
Following issues were discovered in nativeexecution native tools:

[process_start]
	ERROR 1 (UMR): accessing uninitialized data at address 0xffff80ffbffffcb0 (1 byte) on the stack at:
		main() + 0x2236  <process_start.c:190>
			187:    #endif
			188:        }
			189:    
			190:=>      if (w != -1 && WIFEXITED(status)) {
			191:            exit(WEXITSTATUS(status));
			192:        }
			193:    
		0x401263 
	ERROR 2 (UMR): accessing uninitialized data at address 0xffff80ffbffffcb0 (4 bytes) on the stack at:
		main() + 0x22d2  <process_start.c:191>
			188:        }
			189:    
			190:        if (w != -1 && WIFEXITED(status)) {
			191:=>          exit(WEXITSTATUS(status));
			192:        }
			193:    
			194:    
		0x401263 

[pty]
	1 allocation at 1 location left on the heap with a total size of 16440 bytes

	    LEAK 1: 1 allocation with total size of 16440 bytes
		_nss_XbyY_buf_alloc() + 0x1b 
		get_grbuf() + 0x7b 
		_getgrnam() + 0x10 
		_grantpt() + 0x29 
		ptm_open() + 0x12c  <pty_fork.c:44>
			41:            return -1;
			42:        }
			43:    
			44:=>      if (grantpt(masterfd) == -1 || unlockpt(masterfd) == -1) {
			45:            close(masterfd);
			46:            return -1;
			47:        }
		pty_fork() + 0x3ef  <pty_fork.c:113>
			110:            }
			111:        }
			112:    
			113:=>      if ((master_fd = ptm_open()) < 0) {
			114:            err_sys("ERROR: ptm_open() failed [%d]\n", master_fd);
			115:        }
			116:    
		main() + 0x1377  <pty.c:114>
			111:            if (params.pty != NULL) {
			112:                pid = pty_fork1(params.pty);
			113:            } else {
			114:=>              pid = pty_fork(&allocated_pty_fd);
			115:            }
			116:        } else {
			117:            pid = fork();
		0x402933 

[sigqueue]
	ERROR 1 (PIR): accessing partially initialized data at address 0xffff80ffbffffd48 (8 bytes) on the stack at:
		main() + 0x70f  <sigqueue.c:78>
			75:        union sigval value;
			76:        value.sival_int = atoi(argv[3]);
			77:    
			78:=>      return sigqueue(pid, signo, value);
			79:    }
			80:    
		0x400d93 

[stat]
	ERROR 1 (UMR): accessing uninitialized data at address 0xffff80ffbffffd08 (8 bytes) on the stack at:
		main() + 0x442  <stat.c:82>
			79:            err = stat64(argv[1], &st);
			80:        #endif
			81:    
			82:=>      printf("inode: %ld\n", st.st_ino);
			83:        printf("ctime: %ld\n\n", st.st_ctime * 1000);
			84:        fflush(stdout);
			85:    
		0x400da3 
	ERROR 2 (UMR): accessing uninitialized data at address 0xffff80ffbffffd50 (8 bytes) on the stack at:
		main() + 0x4e1  <stat.c:83>
			80:        #endif
			81:    
			82:        printf("inode: %ld\n", st.st_ino);
			83:=>      printf("ctime: %ld\n\n", st.st_ctime * 1000);
			84:        fflush(stdout);
			85:    
			86:        return err;
		0x400da3
Comment 1 ilia 2015-12-02 16:31:12 UTC
Static analysis results:

MFR: Missing Function Return
killall/src/killall.c:180

MRC: Missing malloc Return value Check
killall/src/linux/pfind.c:52
killall/src/linux/pfind.c:69
killall/src/macosx/pfind.c:35
killall/src/macosx/pfind.c:44
killall/src/solaris/pfind.c:124
killall/src/solaris/pfind.c:142
pty/src/env.c:118
pty/src/env.c:124
pty/src/options.c:77

LEAK: Memory leak datasize
pty/src/env.c:118