lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 20 Oct 2011 10:51:43 -0200
From:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To:	David Ahern <dsahern@...il.com>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu, peterz@...radead.org,
	fweisbec@...il.com
Subject: Re: [PATCH] perf top: fix crash on annotate request

Em Wed, Oct 19, 2011 at 03:39:30PM -0600, David Ahern escreveu:
> On 10/19/2011 01:20 PM, Arnaldo Carvalho de Melo wrote:
> > Can you check if that is the problem? I.e. take notes->lock, check if
> > ->src is NULL, if so call symbol__alloc_hist, etc?
> > 
> 
> Reproduced it on a lab box. This fixes the segfault:
> 
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index bc8f477..6bd501a 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -253,6 +253,17 @@ static int symbol__parse_objdump_line(struct symbol
> *sym, struct map *map,
>         free(line);
>         return -1;
>     }
> +
> +   pthread_mutex_lock(&notes->lock);
> +   if (notes->src == NULL &&
> +       symbol__alloc_hist(sym, 1) < 0) {
> +       pthread_mutex_unlock(&notes->lock);
> +       ui__warning("Not enough memory for annotating '%s' symbol!\n",
> +               sym->name);
> +       return -1;
> +   }
> +   pthread_mutex_unlock(&notes->lock);
> +
>     objdump__add_line(&notes->src->source, objdump_line);
> 
>     return 0;
> 
> Should I plumb nr_events down versus assuming its 1?

better to plumb it properly, i.e. at some point where you have access to
evlist to get its ->nr_entries so that we properly support multiple
events.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ