[PATCH 3/5] kern/processor.c: check if threads is NULL

2013-11-18 Thread Marin Ramesa
When addr is equal to zero, array access from pointer threads results in a dereference of null pointer. Avoid this by checking if it's NULL. * kern/processor.c (threads): Check if it's NULL. --- kern/processor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kern/processor

More patches based on clang reports

2013-11-18 Thread Marin Ramesa
[PATCH 1/5] kern/slab.c: initialize optimal_embed http://darnassus.sceen.net/~teythoon/qa/gnumach/scan-build/2013-11-15/report-cAaz8T.html#EndPath [PATCH 2/5] kern/slab.c: initialize info_size http://darnassus.sceen.net/~teythoon/qa/gnumach/scan-build/2013-11-15/report-sSmdAq.html#EndPath [PATCH

[PATCH 2/5] kern/slab.c: initialize info_size

2013-11-18 Thread Marin Ramesa
info_size is initialized to a random value. Quiet the warning by initializing to zero. * kern/slab.c (info_size): Initialize to zero. --- kern/slab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kern/slab.c b/kern/slab.c index bb35a34..07e1192 100644 --- a/kern/slab.c +++

[PATCH 5/5] vm/vm_fault.c: check if active_threads is NULL

2013-11-18 Thread Marin Ramesa
Check if active_threads is NULL before calling current_task() to avoid dereference of null pointer. * vm/vm_fault.c (active_threads): Check if it's NULL. --- vm/vm_fault.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/vm_fault.c b/vm/vm_fault.c index 1089491..b8be122

[PATCH 4/5] vm/vm_fault.c: check if active_threads is NULL

2013-11-18 Thread Marin Ramesa
Check is active_threads is NULL before calling current_task() to avoid dereference of null pointer. * vm/vm_fault.c (active_threads): Check if it's NULL. --- vm/vm_fault.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vm/vm_fault.c b/vm/vm_fault.c index 4b30f98..1089491 1

[PATCH 1/5] kern/slab.c: initialize optimal_embed

2013-11-18 Thread Marin Ramesa
optimal_embed is initialized to a random value. Quiet the warning by initializing to zero. * kern/slab.c (optimal_embed): Initialize to zero. --- kern/slab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kern/slab.c b/kern/slab.c index 47c2c8f..bb35a34 100644 --- a/kern/sla

Re: [RFC] Enable thread termination

2013-11-18 Thread Neal H. Walfield
At Mon, 18 Nov 2013 16:14:57 +0100, Samuel Thibault wrote: > > Neal H. Walfield, le Mon 18 Nov 2013 13:41:46 +0100, a écrit : > > At Mon, 18 Nov 2013 12:31:42 +0100, > > Richard Braun wrote: > > > The threading library is a > > > low level component and should act as closely as its users expect it

Re: [RFC] Enable thread termination

2013-11-18 Thread Richard Braun
On Mon, Nov 18, 2013 at 04:22:06PM +0100, Samuel Thibault wrote: > Richard Braun, le Sun 17 Nov 2013 17:13:23 +0100, a écrit : > > Two resources are still recycled: the internal pthread structure > > (because it makes ID allocation easy), and thread local storage (TLS) > > because that's where the

Re: [RFC] Enable thread termination

2013-11-18 Thread Samuel Thibault
Richard Braun, le Sun 17 Nov 2013 17:13:23 +0100, a écrit : > Two resources are still recycled: the internal pthread structure > (because it makes ID allocation easy), and thread local storage (TLS) > because that's where the reply port is stored, and it didn't seem > convenient to call _dl_dealloc

Re: [RFC] Enable thread termination

2013-11-18 Thread Samuel Thibault
Neal H. Walfield, le Mon 18 Nov 2013 13:41:46 +0100, a écrit : > At Mon, 18 Nov 2013 12:31:42 +0100, > Richard Braun wrote: > > The threading library is a > > low level component and should act as closely as its users expect it to. > > I don't agree. On Linux, creating a thread is a pretty much a

Re: [RFC] Enable thread termination

2013-11-18 Thread Neal H. Walfield
At Mon, 18 Nov 2013 12:31:42 +0100, Richard Braun wrote: > > On Mon, Nov 18, 2013 at 11:33:55AM +0100, Neal H. Walfield wrote: > > Richard Braun wrote: > > > The current state is to never terminate threads, on the assumption that > > > they can't both terminate and release their stack on their own

Re: [RFC] Enable thread termination

2013-11-18 Thread Richard Braun
On Mon, Nov 18, 2013 at 11:33:55AM +0100, Neal H. Walfield wrote: > Richard Braun wrote: > > The current state is to never terminate threads, on the assumption that > > they can't both terminate and release their stack on their own. Such > > resources are recycled by the threading library. This pa

Re: [RFC] Enable thread termination

2013-11-18 Thread Neal H. Walfield
At Sun, 17 Nov 2013 17:13:23 +0100, Richard Braun wrote: > The current state is to never terminate threads, on the assumption that > they can't both terminate and release their stack on their own. Such > resources are recycled by the threading library. This patch makes use > of a new GNU Mach spec

Re: [RFC] Enable thread termination

2013-11-18 Thread Richard Braun
On Sun, Nov 17, 2013 at 05:13:23PM +0100, Richard Braun wrote: > The following changes actually apply to Debian eglibc 2.17-96 sources, Binary packages are available for testing on my repository : deb http://ftp.sceen.net/debian-hurd-i386 experimental/ Install gnumach first, then glibc, then the

Re: [PATCH 1/2] Add copyright

2013-11-18 Thread Justus Winter
Quoting Marin Ramesa (2013-11-18 10:26:41) > On 18.11.2013 09:53:34, Justus Winter wrote: > > IANAL, and I do not now if this is ok to do, but the copyright > > template you used is out of date. See > > https://www.gnu.org/licenses/gpl-howto.html. > > I don't know either. Should I add the copyrigh

Re: [PATCH 1/2] Add copyright

2013-11-18 Thread Marin Ramesa
On 18.11.2013 09:53:34, Justus Winter wrote: > IANAL, and I do not now if this is ok to do, but the copyright > template you used is out of date. See > https://www.gnu.org/licenses/gpl-howto.html. I don't know either. Should I add the copyright or somebody else does that? When I wrote that files

Re: [PATCH 1/2] Add copyright

2013-11-18 Thread Justus Winter
Quoting Marin Ramesa (2013-11-18 09:38:56) > * ddb/db_write_cmd.h: Add copyright. > * ipc/ipc_print.h: Likewise. > * vm/vm_print.h: Likewise. > > --- > ddb/db_write_cmd.h | 18 ++ > ipc/ipc_print.h| 18 ++ > vm/vm_print.h | 18 ++ > 3 files

[PATCH 2/2] Add ifndefs

2013-11-18 Thread Marin Ramesa
Finish up with the addition of ifndefs. * device/buf.h: Add ifndef. * device/dev_master.h: Likewise. * include/device/tty_status.h: Likewise. * include/mach/version.h: Likewise. * ipc/ipc_machdep.h: Likewise. --- device/buf.h| 5 + device/dev_master.h | 5 + inclu

[PATCH 1/2] Add copyright

2013-11-18 Thread Marin Ramesa
* ddb/db_write_cmd.h: Add copyright. * ipc/ipc_print.h: Likewise. * vm/vm_print.h: Likewise. --- ddb/db_write_cmd.h | 18 ++ ipc/ipc_print.h| 18 ++ vm/vm_print.h | 18 ++ 3 files changed, 54 insertions(+) diff --git a/ddb/db_write_cmd.h b