This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PING^3][PATCH] Refactor debug routines.


ping
On Tue, Nov 05, 2013 at 02:57:14PM +0100, OndÅej BÃlka wrote:
> ping
> On Wed, Oct 30, 2013 at 04:11:53PM +0100, OndÅej BÃlka wrote:
> > On Wed, Oct 23, 2013 at 01:15:56AM +0200, OndÅej BÃlka wrote:
> > > Hi,
> > > 
> > > After I looked at generic and x86-64 code I found following problems.
> > > a) Performance. Performance of checking memset_chk and memcpy_chk is 
> > > comparable to nonchecking ones. A strcpy_chk on benchtests is much
> > > slower than stupid variant. Other functions are also slow because debug
> > > has often byte-by-byte implementation.
> > > b) Extensibility. Adding overlap checks is easier to add in c than
> > > assembly.
> > > 
> > > A solution is to write functions in style of bounds check followed by
> > > jump to corresponding routine. 
> > > This should produce identic assembly as assembly files in ideal case, 
> > > unfortunately gcc (or our annotations) contains a bug and does not issue
> > > tailcall. Code for memset is following
> > > 
> > > 0000000000000000 <__memset_chk>:
> > >    0:	48 83 ec 08          	sub    $0x8,%rsp
> > >    4:	48 39 d1             	cmp    %rdx,%rcx
> > >    7:	72 09                	jb     12 <__memset_chk+0x12>
> > >    9:	48 83 c4 08          	add    $0x8,%rsp
> > >    d:	e9 00 00 00 00       	jmpq   12 <__memset_chk+0x12>
> > >   12:	e8 00 00 00 00       	callq  17 <__memset_chk+0x17>
> > > 
> > > 
> > > 
> 
> -- 
> 
> Of course it doesn't work. We've performed a software upgrade.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]