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.
Below is discover report. This should be fixed as if build is really really long leak can become significant ***************** Discover Memory Report ***************** 25 allocations at 1 location left on the heap with a total size of 500 bytes LEAK 1: 25 allocations with total size of 500 bytes main() + 0xa26 <rfs_controller.c:789> 786: 787: while (1) { 788: /* wait for a client to talk to us */ 789:=> connection_data* conn_data = (connection_data*) malloc(sizeof (connection_data)); 790: socklen_t addrlen = sizeof (conn_data->pin); 791: if ((conn_data->sd = accept(sd, (struct sockaddr *) & conn_data->pin, &addrlen)) == -1) { 792: perror("accept"); 0x403453 DISCOVER SUMMARY: unique errors : 0 (0 total) unique warnings : 0 (0 total)
There are also several issues wit rfs_preload: LEAK 18: 1 allocation with total size of 1025 bytes rfs_startup() + 0x12d <rfs_preload.c:361> 358: getcwd(p, PATH_MAX + 1); 359: dir = p; 360: } 361:=> char* real_dir = malloc(PATH_MAX + 1); 362: if ( realpath(dir, real_dir)) { 363: char *to_free = dir; 364: dir = real_dir; _init() + 0x35 call_init() + 0x119 is_dep_init() + 0xa2 elf_bndr() + 0x438 _elf_rtbndr() + 0x13 0xfe230587 : UNKNOWN ucrypto_init() + 0x26 LEAK 65: 1 allocation with total size of 63 bytes rfs_startup() + 0x1fb <rfs_preload.c:374> 371: dir = strdup(dir); 372: } else { 373: my_dir_len++; 374:=> void *p = malloc(my_dir_len + 1); 375: strcpy(p, dir); 376: strcat(p, "/"); 377: dir = p; _init() + 0x24 call_init() + 0x119 is_dep_init() + 0xa2 elf_bndr() + 0x438 _elf_rtbndr() + 0x13 0xfe230587 : UNKNOWN ucrypto_init() + 0x26 ERROR 1 (UAW): writing to unallocated memory at address 0x81f7c40 (63 bytes) on the heap at: strdup() + 0x48 rfs_startup() + 0xe5 <rfs_preload.c:355> 352: //getcwd(curr_dir, curr_dir_len); 353: char* dir = getenv("RFS_CONTROLLER_DIR"); 354: if (dir) { 355:=> dir = strdup(dir); 356: } else { 357: char* p = malloc(PATH_MAX + 1); 358: getcwd(p, PATH_MAX + 1); _init() + 0x24 call_init() + 0x119 is_dep_init() + 0xa2 elf_bndr() + 0x438 _elf_rtbndr() + 0x13 0x7f0f028f : UNKNOWN ERROR 2 (UAR): reading from unallocated memory "*real_dir" at address 0x8208d70 (62 bytes) on the heap at: rfs_startup() + 0x211 <rfs_preload.c:375> 372: } else { 373: my_dir_len++; 374: void *p = malloc(my_dir_len + 1); 375:=> strcpy(p, dir); 376: strcat(p, "/"); 377: dir = p; 378: } _init() + 0x24 call_init() + 0x119 is_dep_init() + 0xa2 elf_bndr() + 0x438 _elf_rtbndr() + 0x13 0x7f0f028f : UNKNOWN ucrypto_init() + 0x26
There are also issues discovered with static analysis. The summary is: PREVISE SUMMARY for ../release/bin/SunOS-x86/rfs_preload.so: 0 error(s), 4 warning(s), 0 leak(s) in total PREVISE SUMMARY for ../release/bin/SunOS-x86/rfs_controller: 0 error(s), 5 warning(s), 2 leak(s) in total Details are: ========== rfs_preload.so static analysis ========== STATIC report of ../release/bin/SunOS-x86/rfs_preload.so: WARNING 1 (MRC): missing null-pointer check after malloc: malloc(1025): rfs_startup() <rfs_preload.c : 357> 354: if (dir) { 355: dir = strdup(dir); 356: } else { 357:=> char* p = malloc(PATH_MAX + 1); 358: getcwd(p, PATH_MAX + 1); WARNING 2 (MRC): missing null-pointer check after malloc: malloc(1025): rfs_startup() <rfs_preload.c : 361> 358: getcwd(p, PATH_MAX + 1); 359: dir = p; 360: } 361:=> char* real_dir = malloc(PATH_MAX + 1); 362: if ( realpath(dir, real_dir)) { WARNING 3 (MRC): missing null-pointer check after malloc: malloc(((unsigned).XA$BAAB3lwXWUgk.my_dir_len+1)): rfs_startup() <rfs_preload.c : 374> 371: dir = strdup(dir); 372: } else { 373: my_dir_len++; 374:=> void *p = malloc(my_dir_len + 1); 375: strcpy(p, dir); WARNING 4 (MRC): missing null-pointer check after malloc: malloc(8): pthread_create() <rfs_preload.c : 425> 422: if (!prev) { 423: prev = (int (*)(void*, void*, void * (*)(void *), void*)) get_real_addr(pthread_create); 424: } 425:=> pthread_routine_data *data = malloc(sizeof (pthread_routine_data)); 426: // TODO: check for null??? PREVISE SUMMARY for ../release/bin/SunOS-x86/rfs_preload.so: 0 error(s), 4 warning(s), 0 leak(s) in total ========== rfs_controller static analysis ========== STATIC report of ../release/bin/SunOS-x86/rfs_controller: LEAK 1 : 1 block left allocated on heap with a total size of ? bytes init_files() <rfs_controller.c : 590> 587: } else if (state == DIRECTORY) { // directory 588: create_dir(path); 589: } else if (state == LINK) { // symbolic link 590:=> char lnk_src[bufsize]; // it is followed by a line that contains the link source 591: if( !fgets(lnk_src, sizeof lnk_src, stdin)) { LEAK 2 : 1 block left allocated on heap with a total size of 20 bytes main() <rfs_controller.c : 783> 779: pthread_detach(ping_pong_thread); 781: while (1) { 782: /* wait for a client to talk to us */ 783:=> connection_data* conn_data = (connection_data*) malloc(sizeof (connection_data)); 784: socklen_t addrlen = sizeof (conn_data->pin); WARNING 1 (MRC): missing null-pointer check after malloc: malloc(((unsigned)((int)((unsigned)namelen)+((unsigned)((int)strlen(real_path)))+14))): add_file_to_list() <rfs_controller.c : 411> 408: int namelen = strlen(filename); 409: int realpath_len = strlen(real_path); 410: int size = sizeof(file_elem) + namelen + realpath_len + 2; 411:=> file_elem *fe = (file_elem*) malloc(size); 412: fe->next = NULL; WARNING 2 (MRC): missing null-pointer check after malloc: malloc(20): main() <rfs_controller.c : 783> 779: pthread_detach(ping_pong_thread); 781: while (1) { 782: /* wait for a client to talk to us */ 783:=> connection_data* conn_data = (connection_data*) malloc(sizeof (connection_data)); 784: socklen_t addrlen = sizeof (conn_data->pin); WARNING 3 (MRC): missing null-pointer check after malloc: malloc(((unsigned).XA$BAAB3lwXWksk.data_cnt*4)): stop_adding_file_data() <rfs_filedata.c : 115> 111: } 113: void stop_adding_file_data() { 114: int el_size = sizeof(struct file_data *); 115:=> data = malloc(data_cnt * el_size); 116: int next = 0; WARNING 4 (MRC): missing null-pointer check after malloc: malloc(8): add_file_data() <rfs_filedata.c : 134> 131: return NULL; 132: } 133: data_cnt++; 134:=> struct adding_file_data_node *node = malloc(sizeof(struct adding_file_data_node)); 136: node->fd = (file_data*) malloc(sizeof(file_data) + strlen(filename) + 1); WARNING 5 (MRC): missing null-pointer check after malloc: malloc(strlen(filename)+29): add_file_data() <rfs_filedata.c : 136> 132: } 133: data_cnt++; 134: struct adding_file_data_node *node = malloc(sizeof(struct adding_file_data_node)); 136:=> node->fd = (file_data*) malloc(sizeof(file_data) + strlen(filename) + 1); 137: pthread_mutex_init(&node->fd->mutex, NULL); PREVISE SUMMARY for ../release/bin/SunOS-x86/rfs_controller: 0 error(s), 5 warning(s), 2 leak(s) in total It would be fine to fix these either.
Created attachment 157620 [details] zipped static analysis result in hml form
fixes on enum/release81 a39b365a5333, 7f1a074777b1, 45dc1b064b3d, 80e0db5ee60f
Created attachment 157964 [details] possible fix
Integrated into 'main-silver', will be available in build *201601120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/b5913a69d850 User: Vladimir Kvashin <vkvashin@netbeans.org> Log: fixed project metadata (#256919 - fix issues discovered in rfs_controller and rfs_preload) (transplanted from ad32ee2dbcdf14e88cb90ea0d2db9b715d6d3a76)
more fixes on enum: 3d6099405a38 3c47d98db1ba
Please redo fix 305478:92c8dea4f01b. It introduces possible NPE in the method RfsLocalController.checkVersion()
(In reply to Alexander Simon from comment #8) Thanks. Fixed: 53dfe1d02582
More fixes on enum: b0e098d0de62 b3676044604d 37b94762a6a8
Integrated into 'main-silver', will be available in build *201601180002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/36a1dbbec847 User: Vladimir Kvashin <vkvashin@netbeans.org> Log: fixing #256919 - fix issues discovered in rfs_controller and rfs_preload (transplanted from 92c8dea4f01b35e4d2ada6ed27472bd86075d684)
Fixes of this bug: http://hg.netbeans.org/releases/rev/ad32ee2dbcdf http://hg.netbeans.org/releases/rev/31602f750c0e http://hg.netbeans.org/releases/rev/a39b365a5333 http://hg.netbeans.org/releases/rev/7f1a074777b1 http://hg.netbeans.org/releases/rev/45dc1b064b3d http://hg.netbeans.org/releases/rev/80e0db5ee60f http://hg.netbeans.org/releases/rev/557e519a2a66 http://hg.netbeans.org/releases/rev/191946fb9e92 http://hg.netbeans.org/releases/rev/199bcd17df68 http://hg.netbeans.org/releases/rev/92c8dea4f01b http://hg.netbeans.org/releases/rev/3c47d98db1ba http://hg.netbeans.org/releases/rev/ce3ce16444da http://hg.netbeans.org/releases/rev/ff9e6365269d http://hg.netbeans.org/releases/rev/53dfe1d02582 http://hg.netbeans.org/releases/rev/b0e098d0de62 http://hg.netbeans.org/releases/rev/b3676044604d http://hg.netbeans.org/releases/rev/37b94762a6a8 http://hg.netbeans.org/releases/rev/d3001c61db43 http://hg.netbeans.org/releases/rev/ee90253088b9