Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150584 Details for
Bug 233294
crash utility: a set of memory leak fixes
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch: a set of memory leak fixes
diff-crash-freebuf-20070320 (text/plain), 14.02 KB, created by
Konstantin Khorenko
on 2007-03-21 14:40:52 UTC
(
hide
)
Description:
patch: a set of memory leak fixes
Filename:
MIME Type:
Creator:
Konstantin Khorenko
Created:
2007-03-21 14:40:52 UTC
Size:
14.02 KB
patch
obsolete
>--- ./dev.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./dev.c 2007-03-20 14:23:17.000000000 -0400 >@@ -564,6 +564,7 @@ ioport_list: > hq_open(); > cnt = do_list(ld); > if (!cnt) >+ FREEBUF(resource_buf); > return; > resource_list = (ulong *)GETBUF(cnt * sizeof(ulong)); > cnt = retrieve_list(resource_list, cnt); >@@ -603,6 +604,8 @@ ioport_list: > } > } > >+ FREEBUF(resource_list); >+ FREEBUF(resource_buf); > return; > > resource_list: >@@ -635,6 +638,7 @@ resource_list: > CENTER|LJUST, "RANGE")); > do_resource_list(symbol_value("iomem_resource"), resource_buf, size); > >+ FREEBUF(resource_buf); > return; > } > >--- ./filesys.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./filesys.c 2007-03-20 14:23:17.000000000 -0400 >@@ -2445,6 +2445,7 @@ nlm_files_dump(void) > file_dump(*file, dentry, inode, 0, > DUMP_INODE_ONLY | DUMP_FULL_NAME); > } >+ FREEBUF(files_list); > } > out: > if (!header_printed) >@@ -3545,6 +3546,7 @@ do_radix_tree(ulong root, int flag, stru > readmem(root, KVADDR, radix_tree_root_buf, SIZE(radix_tree_root), > "radix_tree_root", FAULT_ON_ERROR); > height = UINT(radix_tree_root_buf + OFFSET(radix_tree_root_height)); >+ FREEBUF(radix_tree_root_buf); > > if (height > ilen) { > fprintf(fp, "radix_tree_root at %lx:\n", root); >--- ./ia64.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./ia64.c 2007-03-20 14:23:17.000000000 -0400 >@@ -423,8 +423,10 @@ ia64_in_per_cpu_mca_stack(void) > __per_cpu_mca = (ulong *)GETBUF(sizeof(ulong) * kt->cpus); > > if (!readmem(symbol_value("__per_cpu_mca"), KVADDR, __per_cpu_mca, >- sizeof(ulong) * kt->cpus, "__per_cpu_mca", RETURN_ON_ERROR|QUIET)) >+ sizeof(ulong) * kt->cpus, "__per_cpu_mca", RETURN_ON_ERROR|QUIET)) { >+ FREEBUF(__per_cpu_mca); > return 0; >+ } > > if (CRASHDEBUG(1)) { > for (i = 0; i < kt->cpus; i++) { >@@ -2712,8 +2714,10 @@ check_mem_limit(void) > saved_command_line, len, "saved_command_line", RETURN_ON_ERROR)) > goto no_command_line; > >- if (!(p1 = strstr(saved_command_line, "mem="))) >+ if (!(p1 = strstr(saved_command_line, "mem="))) { >+ FREEBUF(saved_command_line); > goto no_command_line; >+ { > > p2 = p1; > while (*p2 && !whitespace(*p2)) >@@ -2722,6 +2726,7 @@ check_mem_limit(void) > > error(pc->flags & RUNTIME ? INFO : WARNING, > "boot command line argument: %s\n", p1); >+ FREEBUF(saved_command_line); > return mem_limit; > > no_command_line: >@@ -4060,8 +4065,10 @@ ia64_in_mca_stack_hyper(ulong addr, stru > __per_cpu_mca = (ulong *)GETBUF(sizeof(ulong) * xht->pcpus); > > if (!readmem(symbol_value("__per_cpu_mca"), KVADDR, __per_cpu_mca, >- sizeof(ulong) * xht->pcpus, "__per_cpu_mca", RETURN_ON_ERROR|QUIET)) >+ sizeof(ulong) * xht->pcpus, "__per_cpu_mca", RETURN_ON_ERROR|QUIET)) { >+ FREEBUF(__per_cpu_mca); > return 0; >+ } > > if (CRASHDEBUG(1)) { > for (i = 0; i < xht->pcpus; i++) { >--- ./kernel.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./kernel.c 2007-03-20 14:23:17.000000000 -0400 >@@ -933,6 +933,8 @@ cmd_dis(void) > sprintf(buf1, "x/%ldi 0x%lx", > req->count ? req->count : 1, req->addr); > gdb_pass_through(buf1, NULL, 0); >+ FREEBUF(req->buf); >+ FREEBUF(req); > return; > } > >@@ -945,6 +947,8 @@ cmd_dis(void) > req->count ? req->count : 1, req->addr); > pc->curcmd_flags |= MEMTYPE_UVADDR; > gdb_pass_through(buf1, NULL, 0); >+ FREEBUF(req->buf); >+ FREEBUF(req); > return; > } > >@@ -2080,6 +2084,8 @@ module_init(void) > kt->mods_installed = 0; > kt->flags |= NO_MODULE_ACCESS; > FREEBUF(modbuf); >+ if (kallsymsbuf) >+ FREEBUF(kallsymsbuf); > return; > } > >@@ -2761,6 +2767,7 @@ module_objfile_search(char *modref, char > > if (!is_module_name(modref, NULL, &lm)) { > error(INFO, "%s is not a module reference\n", modref); >+ FREEBUF(retbuf); > return NULL; > } > >@@ -2776,6 +2783,7 @@ module_objfile_search(char *modref, char > if (find_remote_module_objfile(lm, file, retbuf)) > return retbuf; > >+ FREEBUF(retbuf); > return NULL; > } > >@@ -3279,6 +3287,7 @@ is_system_call(char *name, ulong value) > char *sp; > long size; > int NR_syscalls; >+ int result = FALSE; > > NR_syscalls = get_NR_syscalls(); > size = sizeof(void *) * NR_syscalls; >@@ -3289,15 +3298,20 @@ is_system_call(char *name, ulong value) > > for (i = 0, sct = sys_call_table; i < NR_syscalls; i++, sct++) { > if (name && (sp = value_symbol(*sct))) { >- if (STREQ(name, sp)) >- return TRUE; >+ if (STREQ(name, sp)) { >+ result = TRUE; >+ break; >+ } > } else if (value) { >- if (value == *sct) >- return TRUE; >+ if (value == *sct) { >+ result = TRUE; >+ break; >+ } > } > } > >- return FALSE; >+ FREEBUF(sys_call_table); >+ return result; > } > > char *sys_call_hdr = "NUM SYSTEM CALL FILE AND LINE NUMBER\n"; >@@ -3420,6 +3434,8 @@ dump_sys_call_table(char *spec, int cnt) > > close_tmpfile(); > } >+ >+ FREEBUF(sys_call_table); > } > > /* >@@ -4540,6 +4556,9 @@ dump_timer_data(void) > fprintf(fp, "\n"); > } > } >+ >+ FREEBUF(td); >+ FREEBUF(vec); > } > > /* >@@ -4657,6 +4676,8 @@ next_cpu: > > if (++cpu < kt->cpus) > goto next_cpu; >+ >+ FREEBUF(vec); > } > > /* >@@ -4784,6 +4805,8 @@ next_cpu: > > if (++cpu < kt->cpus) > goto next_cpu; >+ >+ FREEBUF(vec); > } > > /* >@@ -5038,6 +5061,8 @@ new_timer_list_format: > tdx++; > } > } >+ >+ FREEBUF(timer_list); > } > > FREEBUF(timer_list_buf); >@@ -5225,6 +5250,7 @@ dump_waitq(ulong wq, char *wq_name) > } > } > >+ FREEBUF(wq_list); > hq_close(); > } > >@@ -5271,11 +5297,11 @@ get_cpus_online() > for (i = 0; i < (len/sizeof(ulong)); i++, maskptr++) > online += count_bits_long(*maskptr); > >- FREEBUF(buf); > if (CRASHDEBUG(1)) > error(INFO, "get_cpus_online: online: %d\n", online); > } > >+ FREEBUF(buf); > return online; > } > >--- ./memory.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./memory.c 2007-03-20 14:23:17.000000000 -0400 >@@ -3884,6 +3884,7 @@ dump_mem_map_SPARSEMEM(struct meminfo *m > > if (pg_spec) { > if (!page_to_phys(mi->spec_addr, &tmp)) >+ FREEBUF(page_cache); > return; > pfn = tmp >> PAGESHIFT(); > } else >@@ -4901,6 +4902,8 @@ dump_page_hash_table(struct meminfo *hi) > hi->retval = TRUE; > } > } >+ >+ FREEBUF(pghash_cache); > } > > /* >@@ -5036,6 +5039,8 @@ dump_free_pages(struct meminfo *fi) > } > hq_close(); > >+ FREEBUF(free_area_buf); >+ > fprintf(fp, "\nnr_free_pages: %d ", nr_free_pages); > if (total_free != nr_free_pages) > fprintf(fp, "(found %ld)\n", total_free); >@@ -5249,6 +5254,8 @@ dump_multidimensional_free_pages(struct > } > hq_close(); > >+ FREEBUF(free_area_buf); >+ > fprintf(fp, "nr_free_pages: %d ", nr_free_pages); > if (total_free != nr_free_pages) > fprintf(fp, "(found %ld)\n", total_free); >@@ -7419,6 +7426,7 @@ dump_kmem_cache(struct meminfo *si) > error(INFO, > "address is not allocated in slab subsystem: %lx\n", > si->spec_addr); >+ FREEBUF(si->addrlist); > return; > } > >@@ -7621,7 +7629,7 @@ dump_kmem_cache_percpu_v1(struct meminfo > error(INFO, > "address is not allocated in slab subsystem: %lx\n", > si->spec_addr); >- return; >+ goto free_out; > } > > if (si->reqname && (si->reqname != p1)) >@@ -7780,6 +7788,7 @@ next_cache: > error(INFO, "%ld error%s encountered\n", > si->errors, si->errors > 1 ? "s" : ""); > >+free_out: > FREEBUF(si->addrlist); > FREEBUF(si->kmem_bufctl); > for (i = 0; i < vt->kmem_max_cpus; i++) >@@ -7841,7 +7850,7 @@ dump_kmem_cache_percpu_v2(struct meminfo > error(INFO, > "address is not allocated in slab subsystem: %lx\n", > si->spec_addr); >- return; >+ goto free_out; > } > > if (si->reqname && (si->reqname != p1)) >@@ -8015,6 +8024,7 @@ next_cache: > error(INFO, "%ld error%s encountered\n", > si->errors, si->errors > 1 ? "s" : ""); > >+free_out: > FREEBUF(si->addrlist); > FREEBUF(si->kmem_bufctl); > for (i = 0; i < vt->kmem_max_cpus; i++) >@@ -10737,7 +10747,7 @@ search(ulong start, ulong end, ulong mas > if (!uvtop(CURRENT_CONTEXT(), pp, &paddr, 0) || > !phys_to_page(paddr, &page)) { > if (!next_upage(CURRENT_CONTEXT(), pp, &pp)) >- return; >+ goto free_out; > continue; > } > break; >@@ -10746,7 +10756,7 @@ search(ulong start, ulong end, ulong mas > if (!kvtop(CURRENT_CONTEXT(), pp, &paddr, 0) || > !phys_to_page(paddr, &page)) { > if (!next_kpage(pp, &pp)) >- return; >+ goto free_out; > continue; > } > break; >@@ -10780,6 +10790,9 @@ search(ulong start, ulong end, ulong mas > > pp += PAGESIZE(); > } >+ >+free_out: >+ FREEBUF(pagebuf); > } > > >@@ -11054,6 +11067,7 @@ dump_swap_info(ulong swapflags, ulong *t > if (swapflags & RETURN_ON_ERROR) { > *totalswap_pages = swap_map; > *totalused_pages = i; >+ FREEBUF(map); > return FALSE; > } else > error(FATAL, >@@ -12489,13 +12503,14 @@ dump_vm_stat(char *item, long *retval) > { > char *buf; > ulong *vp; >- int i; >+ int i, result; > >+ result = FALSE; > if (!vm_stat_init()) { > if (!item) > error(FATAL, > "vm_stat not available in this kernel\n"); >- return FALSE; >+ return result; > } > > buf = GETBUF(sizeof(ulong) * vt->nr_vm_stat_items); >@@ -12509,16 +12524,20 @@ dump_vm_stat(char *item, long *retval) > vp = (ulong *)buf; > for (i = 0; i < vt->nr_vm_stat_items; i++) > fprintf(fp, "%20s: %ld\n", vt->vm_stat_items[i], vp[i]); >- return TRUE; >+ result = TRUE; >+ goto free_out; > } > > vp = (ulong *)buf; > for (i = 0; i < vt->nr_vm_stat_items; i++) { > if (STREQ(vt->vm_stat_items[i], item)) { > *retval = vp[i]; >- return TRUE; >+ result = TRUE; >+ goto free_out; > } > } > >- return FALSE; >+free_out: >+ FREEBUF(buf); >+ return result; > } >--- ./ppc64.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./ppc64.c 2007-03-20 14:23:17.000000000 -0400 >@@ -2387,6 +2387,7 @@ ppc64_paca_init(void) > kt->cpus = cpus; > if (kt->cpus > 1) > kt->flags |= SMP; >+ FREEBUF(cpu_paca_buf); > } > > void >--- ./symbols.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./symbols.c 2007-03-20 14:23:17.000000000 -0400 >@@ -361,6 +361,9 @@ check_gnu_debuglink(bfd *bfd) > > } > >+ FREEBUF(contents); >+ FREEBUF(dirname); >+ > return FALSE; > > reset_bfd: >@@ -8654,5 +8657,6 @@ get_thisfile(void) > tok = strtok(NULL, ":"); > } > >+ FREEBUF(buf1); > return pc->program_path; > } >--- ./task.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./task.c 2007-03-20 14:23:17.000000000 -0400 >@@ -1293,6 +1293,7 @@ retry_pid_hash: > if (!(tt->flags & TASK_INIT_DONE)) > clean_exit(1); > error(INFO, "using stale task_structs\n"); >+ FREEBUF(nodebuf); > FREEBUF(pid_hash); > return; > } >@@ -1519,6 +1520,7 @@ retry_pid_hash: > if (!(tt->flags & TASK_INIT_DONE)) > clean_exit(1); > error(INFO, "using stale task_structs\n"); >+ FREEBUF(nodebuf); > FREEBUF(pid_hash); > return; > } >@@ -2044,6 +2046,9 @@ cmd_task(void) > for (c = 0; c < tcnt; c++) > do_task(tasklist[c], 0, strlen(ref->str) ? ref : NULL); > >+ FREEBUF(memberlist); >+ FREEBUF(ref); >+ FREEBUF(tasklist); > } > > /* >@@ -2154,6 +2159,7 @@ task_struct_member(struct task_context * > } > } > close_tmpfile(); >+ FREEBUF(refcopy); > } > > /* >@@ -2659,8 +2665,10 @@ show_task_times(struct task_context *tcp > > fill_task_struct(tc->task); > if (!tt->last_task_read) { >- if (tcp) >+ if (tcp) { >+ FREEBUF(task_start_times); > return; >+ } > continue; > } > >@@ -5389,6 +5397,8 @@ get_active_set(void) > } > } > >+ FREEBUF(runqbuf); >+ > if (cnt) { > tt->flags |= ACTIVE_SET; > return TRUE; >@@ -5734,6 +5744,8 @@ start_again: > if (!is_idle_thread(tc->task)) > print_task_header(fp, tc, 0); > } >+ >+ FREEBUF(tlist); > } > > #define RUNQ_ACTIVE (1) >@@ -5790,6 +5802,8 @@ dump_runqueues(void) > offset = expired - runq; > dump_prio_array(RUNQ_EXPIRED, expired, &runqbuf[offset]); > } >+ >+ FREEBUF(runqbuf); > } > > static void >@@ -6115,6 +6129,9 @@ cmd_sig(void) > } > } > >+ FREEBUF(siglist); >+ FREEBUF(ref); >+ FREEBUF(tasklist); > } > > >@@ -6259,6 +6276,7 @@ dump_signal_data(struct task_context *tc > fprintf(fp, "SIGNAL_STRUCT: %lx ", signal_struct); > if (!signal_struct) { > fprintf(fp, "\n"); >+ FREEBUF(signal_buf); > return; > } > fprintf(fp, "COUNT: %d\n", >--- ./tools.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./tools.c 2007-03-20 14:23:17.000000000 -0400 >@@ -3059,6 +3059,8 @@ next_arg: > "LIST_HEAD contents", FAULT_ON_ERROR); > if (ld->start == ld->end) { > fprintf(fp, "(empty)\n"); >+ if (ld->structname_args) >+ FREEBUF(ld->structname); > return; > } > } >--- ./unwind.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./unwind.c 2007-03-20 14:23:17.000000000 -0400 >@@ -1560,8 +1560,10 @@ load_unw_table(int clear_cache) > if (!readmem(symbol_value("unw")+ms->unw_tables_offset, > KVADDR, up, > sizeof(struct unw) + sizeof(struct unw_table *), >- "unw", RETURN_ON_ERROR|QUIET)) >+ "unw", RETURN_ON_ERROR|QUIET)) { >+ FREEBUF(unw_temp); > return FALSE; >+ } > > unw.tables = up->tables; > >@@ -2780,6 +2782,7 @@ lookup(struct unw_table *table, unsigned > if (IS_MODULE_VADDR(table->segment_base + rel_ip)) > error(WARNING, > "cannot read module unw_table_entry array\n"); >+ FREEBUF(loc_array); > return 0; > } > array = loc_array; >--- ./x86.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./x86.c 2007-03-20 14:23:17.000000000 -0400 >@@ -3913,6 +3913,7 @@ x86_display_memmap(void) > fprintf(fp, "%016llx - %016llx %s\n", addr, addr+size, > e820type[type]); > } >+ FREEBUF(buf); > } > > /* >--- ./x86_64.c.freebuf 2007-03-16 15:35:05.000000000 -0400 >+++ ./x86_64.c 2007-03-20 14:23:17.000000000 -0400 >@@ -3871,6 +3871,7 @@ x86_64_display_memmap(void) > fprintf(fp, "%016llx - %016llx %s\n", addr, addr+size, > e820type[type]); > } >+ FREEBUF(buf); > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233294
: 150584