Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros

2016-06-05 Thread Samuel Thibault
Ludovic Courtès, on Sun 05 Jun 2016 21:53:35 +0200, wrote:
> Justus Winter  skribis:
> > +#define Mach_port_check(NAME)   \
> > +  void _Mach_port_check_##NAME(char *_unused[] __attribute__ ((unused))) \
> > +  { \
> > +  if (MACH_PORT_VALID (NAME))   \
> > +__print_fail_backtrace (#NAME " leaked",\
> > +__FILE__, __LINE__, "Port leak detector");  \
> > +  } \
> > +  char _Mach_port_check_x_##NAME[0] \
> > +  __attribute__ ((unused, cleanup (_Mach_port_check_##NAME)))
> 
> I think writing a GCC plug-in that would automatically add a cleanup
> handler to automatic variables of type ‘mach_port_t’ wouldn’t be
> unreasonable.

I don't enough to be sure, but isn't that the typical work of
LocalitySanitizer, precisely?

Samuel



Re: [PATCH hurd 2/2] libshouldbeinlibc: add safe port handling macros

2016-06-05 Thread Ludovic Courtès
Justus Winter  skribis:

> +#define Mach_port_check(NAME)   \
> +  void _Mach_port_check_##NAME(char *_unused[] __attribute__ ((unused))) \
> +  { \
> +  if (MACH_PORT_VALID (NAME))   \
> +__print_fail_backtrace (#NAME " leaked",\
> +__FILE__, __LINE__, "Port leak detector");  \
> +  } \
> +  char _Mach_port_check_x_##NAME[0] \
> +  __attribute__ ((unused, cleanup (_Mach_port_check_##NAME)))

I think writing a GCC plug-in that would automatically add a cleanup
handler to automatic variables of type ‘mach_port_t’ wouldn’t be
unreasonable.

Ludo’.




Re: gnumach 1.7 issue

2016-06-05 Thread Samuel Thibault
Adam Richards, on Sun 05 Jun 2016 11:35:17 +0100, wrote:
> However, in my case I was not running X. 
> The issue was with hurd-console
> Both mouse and  keyboard queues would fill up and the system would freeze.

That's the same driver :)

Samuel



Re: gnumach 1.7 issue

2016-06-05 Thread Adam Richards
On 4 June 2016 at 17:08, James Clarke  wrote:

>
> Reverting 1db202e indeed fixes it. I also rebuilt the same source tree with
> the patch commented out in d/p/series just to be sure there wasn’t a
> toolchain issue, and that build *doesn’t* work, so 1db202e is either buggy
> or exposing other bugs.
>
>
Thanks Samuel and James. This fixed it for me also.
However, in my case I was not running X.
The issue was with hurd-console
Both mouse and  keyboard queues would fill up and the system would freeze.

Cheers,

adam