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:	Fri, 9 Oct 2015 15:24:02 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Jiri Olsa <jolsa@...hat.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	LKML <linux-kernel@...r.kernel.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Stephane Eranian <eranian@...gle.com>,
	David Ahern <dsahern@...il.com>,
	Andi Kleen <andi@...stfloor.org>
Subject: Re: [RFC/PATCH 17/38] perf tools: Maintain map groups list in a
 leader thread

On Thu, Oct 08, 2015 at 02:51:43PM +0200, Jiri Olsa wrote:
> On Fri, Oct 02, 2015 at 02:18:58PM +0900, Namhyung Kim wrote:
> 
> SNIP
> 
> > +static int thread__clone_map_groups(struct thread *thread,
> > +				    struct thread *parent);
> > +
> >  int __thread__set_comm(struct thread *thread, const char *str, u64 timestamp,
> >  		       bool exec)
> >  {
> > @@ -182,6 +257,40 @@ int __thread__set_comm(struct thread *thread, const char *str, u64 timestamp,
> >  			unwind__flush_access(thread);
> >  	}
> >  
> > +	if (exec) {
> > +		struct machine *machine;
> > +
> > +		BUG_ON(thread->mg == NULL || thread->mg->machine == NULL);
> > +
> > +		machine = thread->mg->machine;
> > +
> > +		if (thread->tid != thread->pid_) {
> > +			struct map_groups *old = thread->mg;
> > +			struct thread *leader;
> > +
> > +			leader = machine__findnew_thread(machine, thread->pid_,
> > +							 thread->pid_);
> > +
> > +			/* now it'll be a new leader */
> > +			thread->pid_ = thread->tid;
> > +
> > +			thread->mg = map_groups__new(old->machine);
> > +			if (thread->mg == NULL)
> > +				return -ENOMEM;
> 
> hum, isn't this leaking thread->mg ?
> should we call map_groups__put(old) at the end of block?

You're right!  Will fix.

Thanks,
Namhyung
--
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