Phil | 6 Feb 03:00

Patches, patches, patches

Hi all,

In my tla archive, which you can get at with:

tla register-archive phil <at> y-windows.org--2005-kalimdor \
       http://willerz.org/arch/2005-kalimdor

You'll find a couple of patch levels.  The first one, 
Y--phil--0.2--patch-1, adds a tracing framework to Y which is going to 
need a lot more code changes before it's truly useful; read the change 
log for that patch for more info.  It has zero runtime cost until you 
need to use it.

The second one, Y--phil--0.2--patch-2,  fixes some build errors I found 
on my desktop box.  There are still runtime problems on my system, but 
as I add more tracing it should get easier to isolate them.

Have fun,

Phil

Phil | 6 Feb 14:02

Re: Logs, logs, logs

For the lazy, here are the patch logs:

Revision: Y--phil--0.2--patch-1
Archive: phil <at> y-windows.org--2005-kalimdor
Creator: Phil <phil <at> y-windows.org>
Date: Sun Feb  6 01:17:45 GMT 2005
Standard-date: 2005-02-06 01:17:45 GMT
New-files: Y/trace/.arch-ids/=id
     Y/trace/.arch-ids/trace.c.id
     Y/trace/.arch-ids/trace.h.id
     Y/trace/.arch-ids/tracetest.c.id Y/trace/trace.c
     Y/trace/trace.h Y/trace/tracetest.c
New-directories: Y/trace Y/trace/.arch-ids
Modified-files: Y/Makefile.am Y/main/y.c Y/y.h
     clients/tools/startY.in startY.devel.in
New-patches: phil <at> y-windows.org--2005-kalimdor/Y--phil--0.2--patch-1
Summary: Add the framework for trace support and a few tracepoints
Keywords: trace traceY

Y/trace/trace.c contains the tracing logic.
Y/trace/trace.h has macros to make tracing easier to use and disable.
Y/trace/tracetest.c simple tests for the above code. make check to run.

Added new target to Y/Makefile.am named traceY.  This is the version of
Y with trace support built in.  The original Y program does not have
trace support, and there is therefore no overhead to this change unless
you use traceY instead of Y as the server.  Both are built and installed
to ${prefix}/bin by default.

To enable trace, set the environment variable Y_TRACE to 1 and run
(Continue reading)

Andrew Suffield | 6 Feb 15:11
Picon
Favicon

Re: Patches, patches, patches

On Sun, Feb 06, 2005 at 02:00:31AM +0000, Phil wrote:
> In my tla archive, which you can get at with:
> 
> tla register-archive phil <at> y-windows.org--2005-kalimdor \
>       http://willerz.org/arch/2005-kalimdor

This is signed with key E642EB09, but that key doesn't appear to be on
any of the usual keyservers.

--

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |
Andrew Suffield | 6 Feb 15:23
Picon
Favicon

Re: Logs, logs, logs

On Sun, Feb 06, 2005 at 01:02:54PM +0000, Phil wrote:
> clients/clock/clock.cc: needed <math.h> for sin() cos() and M_PI.  How
> did this ever work?

Via <iostream>, which previously sucked in <cmath> in order to use
ceil() somewhere in the middle of its inlined locale facet
logic. Unfortunately there's no easy way to detect missing #includes
of this form just yet.

--

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |
Phil | 6 Feb 18:19

Re: Patches, patches, patches

Andrew Suffield wrote:
> On Sun, Feb 06, 2005 at 02:00:31AM +0000, Phil wrote:
> 
>>In my tla archive, which you can get at with:
>>
>>tla register-archive phil <at> y-windows.org--2005-kalimdor \
>>      http://willerz.org/arch/2005-kalimdor
> 
> 
> This is signed with key E642EB09, but that key doesn't appear to be on
> any of the usual keyservers.

Oops, I've now put it on wwwkeys.eu.pgp.net which should synchronise 
throughout the whole pgp.net hierarchy.

I'll try and hassle Mark into signing it at some point this coming week. 
  For those who have an unfounded trust in the security of email, the 
key info and fingerprint is:

pub  2048R/E642EB09 2005-02-05 Phil W (Signing key for my arch 
changesets) <phil <at> y-windows.org>
      Key fingerprint = 53EB 70C6 0755 F2F9 DCF8  62F1 7B3A 9DFF E642 EB09

Cheers,

Phil

Phil | 6 Feb 18:21

Re: Logs, logs, logs

Andrew Suffield wrote:
> Via <iostream>, which previously sucked in <cmath> 

I'll change my <math.h> to <cmath> to keep it in the C++ style.

Phil

Phil | 6 Feb 21:31

Re: Patches, patches, patches

Phil wrote:
> Hi all,
> 
> In my tla archive, which you can get at with:
> 
> tla register-archive phil <at> y-windows.org--2005-kalimdor \
>       http://willerz.org/arch/2005-kalimdor

New today: Y--phil--0.2--patch-3.  In this release:

ymalloc() and yfree() will detect _some_ buffer under- and over-runs.  I
plan to add to improve this shortly, --patch-4 should detect more
under-run conditions.  Overrun conditions tend to be more common, so I
felt I should release it now.

ymalloc() will return data aligned on a malloc()-alignment + 16
boundary.  Previous behaviour was to align on a malloc()-alignment + 4
boundary, which was incorrectly aligned on my machine if you wanted to
store double, size_t, uint64_t, int64_t, or pointer types.

ymalloc() and yfree() are now traced.

You can now trace size_t variables.

Tracing buffers now works properly.

ystrdup() is a bit cleaner, and is now traced.

The #include lines in the clock application have been C++-ified.

(Continue reading)

Phil | 6 Feb 21:54

Re: Patches, patches, patches

Phil wrote:
> ymalloc() and yfree() will detect _some_ buffer under- and over-runs.  I
> plan to add to improve this shortly, --patch-4 should detect more
> under-run conditions.  Overrun conditions tend to be more common, so I
> felt I should release it now.

It turned out to be easier than I thought, so patch-4 is now good to go. 
  It should detect buffer under- or over-runs of as little as one byte 
(unless you're unlucky enough to write the magic number in there).

I also changed the check programs to use ymalloc() and yfree(), as this 
will allow us to trace their memory usage if there is ever a problem in 
the code they test.

This'll probably be it for a while, as I'll be too tired to do anything 
much in the week and I have plans for the weekend...

Cheers,

Phil

Phil | 6 Feb 23:01

Re: Patches, patches, patches

Phil wrote:
> This'll probably be it for a while, as I'll be too tired to do anything 
> much in the week and I have plans for the weekend...

Y--phil--0.2--patch-5 is now live.  Highlights:

ystrdup() cleaned up to use memcpy instead of strncpy (thanks to Andy 
for pointing this one out).

pointerLoadImages() cleaned up to remove a buffer over-run and eliminate 
another two strncpy() calls (again, thanks to Andy for a suggested fix).

Y can now be reliably started on amd64 provided the font path in 
server.conf contains only TTF files.  Previously it would sometimes 
start but more often fail, presumably one of the bugs we fixed recently 
was the problem before.

I shan't go looking for a fix for the non-TTF font problem just yet, as 
there are things which annoy me more.

This really is it for today, as I am now too tired to code coherently.

Have fun,

Phil

Phil | 6 Feb 23:20

Re: Patches, patches, patches

Phil wrote:
> This really is it for today, as I am now too tired to code coherently.

Proof of this of course is the memory leak I introduced and then had to 
fix in patch-6.

G'nite,

Phil


Gmane