This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Question about madvise(DONTNEED) in glibc malloc
- From: Rich Felker <dalias at aerifal dot cx>
- To: OndÅej BÃlka <neleai at seznam dot cz>
- Cc: Samuel Thibault <samuel dot thibault at ens-lyon dot org>, KOSAKI Motohiro <kosaki dot motohiro at gmail dot com>, Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 15 Apr 2013 08:48:24 -0400
- Subject: Re: Question about madvise(DONTNEED) in glibc malloc
- References: <516ADB3C dot 9040805 at gmail dot com> <CAAHN_R23vHH4B_=GUHFXAfcRL5gFrOp6dyBLcskCQNG5VswxAA at mail dot gmail dot com> <516B8C16 dot 1050802 at gmail dot com> <20130415101439 dot GA3110 at domone dot kolej dot mff dot cuni dot cz> <20130415111319 dot GB6152 at type dot bordeaux dot inria dot fr> <20130415121141 dot GA10611 at domone dot kolej dot mff dot cuni dot cz> <20130415121508 dot GF6152 at type dot bordeaux dot inria dot fr> <20130415123504 dot GA12790 at domone dot kolej dot mff dot cuni dot cz>
On Mon, Apr 15, 2013 at 02:35:04PM +0200, OndÅej BÃlka wrote:
> > > > > A SIGBUS makes using vrange out of question. We simply cannot ignore user generated SIGBUS.
> > > >
> > > > Such SIGBUS would not happen unless the user accesses some freed memory,
> > > > which he shouldn't be doing anyway.
> > >
> > > When kill -BUS pid became illegal?
> >
> > I don't understand how that relates to what we are talking about. I've
> > never said sending -BUS was illegal. I've said that accessing freed
> > memory is illegal.
>
> Accessing freed memory is illegal but not only way how that SIGBUS could
> happen. It could be SIGBUS from kill which is perfectly legal.
You misunderstand. glibc/malloc would not be _catching_ SIGBUS, so the
fact that it's delivered when freed memory is accessed is irrelevant
to applications unless they access freed memory (and then it's their
fault they get it!). So I don't see what the problem is. This does not
interfere with an application's use of SIGBUS whatsoever.
Rich