Dresden 1945

2005-05-15 Thread james
Lese selbst:
http://www.kommunisten-online.de/blackchanel/dresden3.htm



___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


GNU emacs on Hurd

2012-07-05 Thread James Collier
Hi,
My apologies if this is the incorrect forum for this. I appreciate being
corrected.
I should quickly introduce myself as this is my first post. I've been
subscribed on this list for several years and have been very interested
in the GNU/Hurd. I would very much like to see (and help) it released in
Debian Wheezy.
Anyway, onto my problem. I have recently installed Debian GNU/Hurd from
the debian installer images at
http://people.debian.org/~sthibault/hurd-i386/installer/cdimage/

Firstly, networking works but `devprobe eth0' doesn't return anything.
Secondly, and the reason for this email, emacs refuses to start. After
some googling I found:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-04/msg00140.html

Trying to start emacs from the hurd console results in the message:
$ emacs
emacs: Not a tty device: /dev/tty

$emacs -nw
emacs: Not a tty device: /dev/tty

$ emacs --version
GNU Emacs 23.2.1

$ apt-cache policy emacs
emacs:
  Installed: 24.1+1-1
  Candidate: 24.1+1-1
  Version table:
 *** 24.1+1-1 0
500 http://ftp.debian.org/debian/ sid/main hurd-i386 Packages
100 /var/lib/dpkg/status
 23.2+1-7 0
500 http://ftp.debian.org/debian/ sid/main hurd-i386 Packages

I would appreciate some advice on what to do next. Should I forward the
bug to Debian (I can't find it on the debian bug tracker) with the
patch?

Thanks very much,

James




re involved

2013-04-13 Thread James Simko
do you still need a technical writer to do documentation?



VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-06-27 Thread James Clarke
Hi,
I have been suffering a lot from my Hurd system (running in VirtualBox) hanging 
at startup, just after "Hurd server bootstrap..." but before "INIT: version 
2.88 booting".

I have been able to trace it back to getblk.c:248 (unsigned long addr_per_block 
= EXT2_ADDR_PER_BLOCK (sblock);) in ext2_getblk. It faults because sblock is 
NULL.

I have traced the execution with debugging statements, and what seems to happen 
is as follows:

1. diskfs_remount is called (because root is remounted as rw)
2. RPCs are inhibited
3. diskfs_reload_global_state is called
4. sblock is set to NULL
5. While this is happening, ext2_getblk is called

If you’re lucky, the superblock is read and sblock is set to point to this data 
before 5 (or at least before it gets to dereferencing sblock). If not, sblock 
is still NULL and thus a page fault is raised, causing the system to be stuck.

Does anyone have an idea how this situation could be occurring?

James Clarke




Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-11 Thread James Clarke
I did some more digging around today. I think what’s happening is that ext2fs 
tries to handle a pager RPC while the disk is being remounted.

We do call ports_inhibit_class_rpcs, which will wait until all RPCs for that 
class have finished. However, we call this with diskfs_protoid_class, which 
does *not* include the pager ports. These are added to _pager_class 
(libpager/priv.h) in pager_create (libpager/pager-create.c:32) and 
disk_pager_bucket (ext2fs/pager.c) in create_disk_pager (ext2fs/pager.c), and 
so as a result I believe we can get pager RPCs while remounting, leading to the 
call to ext2_getblk. Below is the stack for the call to ext2_getblk that leads 
to dereferencing sblock when it is NULL:

 0  ext2fs/getblk.c:253 (ext2_getblk)
 1  ext2fs/pager.c:147 (find_block)
 2  ext2fs/pager.c:244 (file_pager_read_page)
 3  ext2fs/pager.c:550 (pager_read_page)
 4  libpager/data-request.c:113 (_pager_S_memory_object_data_request)
 5  libpager/memory_objectServer.c:443 (_Xmemory_object_data_request)
 6  libpager/demuxer.c:215 (worker_func)
 7  libpthread/pthread/pt-create.c:64 (entry_point)

James Clarke

> On 27 Jun 2015, at 20:34, Richard Braun  wrote:
> 
> On Sat, Jun 27, 2015 at 03:39:58PM +0100, James Clarke wrote:
>> I have been suffering a lot from my Hurd system (running in VirtualBox) 
>> hanging at startup, just after "Hurd server bootstrap..." but before "INIT: 
>> version 2.88 booting".
>> 
>> I have been able to trace it back to getblk.c:248 (unsigned long 
>> addr_per_block = EXT2_ADDR_PER_BLOCK (sblock);) in ext2_getblk. It faults 
>> because sblock is NULL.
>> 
>> I have traced the execution with debugging statements, and what seems to 
>> happen is as follows:
>> 
>> 1. diskfs_remount is called (because root is remounted as rw)
>> 2. RPCs are inhibited
>> 3. diskfs_reload_global_state is called
>> 4. sblock is set to NULL
>> 5. While this is happening, ext2_getblk is called
>> 
>> If you’re lucky, the superblock is read and sblock is set to point to this 
>> data before 5 (or at least before it gets to dereferencing sblock). If not, 
>> sblock is still NULL and thus a page fault is raised, causing the system to 
>> be stuck.
>> 
>> Does anyone have an idea how this situation could be occurring?
> 
> My initial thought would be "how could it not happen ?".
> 
> Despite diskfs_remount calling ports_inhibit_class_rpcs, other threads
> can very well be running to process previously received messages. There
> seems to be no other form of access synchronization such as locks in
> diskfs_reload_global_state.
> 
> Can you get the call trace leading to ext2_getblk ? I'm not sure about
> backtrace(3) in static executables but it might be worth trying.
> 
> -- 
> Richard Braun




Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-12 Thread James Clarke
That doesn’t seem to boot at all. I had tried changing it to inhibiting all 
RPCs (it looks like you’ve inhibited an extra class?), but it seems that paging 
is needed? Perhaps part of ext2fs gets paged out, and it needs to be paged in 
when remounting?

James

> On 12 Jul 2015, at 00:27, Justus Winter <4win...@informatik.uni-hamburg.de> 
> wrote:
> 
> Quoting James Clarke (2015-07-11 22:33:44)
>> I did some more digging around today. I think what’s happening is
>> that ext2fs tries to handle a pager RPC while the disk is being
>> remounted
> 
> Sounds plausible.  Could you try:
> 
> http://darnassus.sceen.net/~teythoon/ext2fs.static
> 
> I'll send the patch as follow-up.
> 
> Justus




Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-15 Thread James Clarke
As discussed in IRC, this successfully stopped the disk pager from 
dereferencing sblock. However, it was still hanging at boot a lot of the time 
(seemingly if and only if I booted in normal mode ie not recovery mode, but 
that's probably just a timing thing).

I had a look today at what's happening, and it's that the *file* pager is 
trying to read from disk. Any thoughts?

James

> On 14 Jul 2015, at 20:54, Justus Winter <4win...@informatik.uni-hamburg.de> 
> wrote:
> 
> Hi James :)
> 
> you found a long-standing bug in ext2fs.  Fixing it allows us to get
> rid of the ugly workaround in daemons/runsystem.sh (look for `XXX').
> 
> Quoting Richard Braun (2015-07-13 10:16:14)
>>> On Sun, Jul 12, 2015 at 12:56:31PM +0100, James Clarke wrote:
>>> That doesn’t seem to boot at all. I had tried changing it to inhibiting all 
>>> RPCs (it looks like you’ve inhibited an extra class?), but it seems that 
>>> paging is needed? Perhaps part of ext2fs gets paged out, and it needs to be 
>>> paged in when remounting?
>> 
>> Remounting can require paging out, yes.
>> 
>> See diskfs_reload_global_state in ext2fs :
>> 
>> diskfs_reload_global_state ()
>> {
>>  pokel_flush (&global_pokel);
>>  pager_flush (diskfs_disk_pager, 1);
> 
> So I guess we need to inhibit the RPCs here, not before calling
> diskfs_reload_global_state, then do:
> 
>  get_hypermetadata ();
>  map_hypermetadata ();
> 
> And reenable them here.
> 
>  return 0;
> }
> 
> I guess that means changing the diskfs API.  James, do you want to
> give it a shot?
> 
> In the mean time, enjoy my hacky workaround:
> http://nonmonolithic.org/ext2fs.static
> 
> Cheers,
> Justus



Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-19 Thread James Clarke
Yeah, I tried inhibiting both buckets, but the paging RPCs still got through, 
so my guess was that libports's inhibit/resume methods weren't able to deal 
with libpager's own threads. The thing is I don't think we currently keep track 
of any reference to the main/worker threads, as pager_start_workers just takes 
a bucket and returns void. Is there a way we can instead make the main thread 
and/or workers able to block ports_inhibit_X_rpcs like normal RPC handlers and 
be cancelled etc? If possible I think that would be a cleaner solution.

James

> On 19 Jul 2015, at 13:50, Justus Winter <4win...@informatik.uni-hamburg.de> 
> wrote:
> 
> Hello James :)
> 
> Quoting James Clarke (2015-07-15 22:20:57)
>> I had a look today at what's happening, and it's that the *file*
>> pager is trying to read from disk. Any thoughts?
> 
> There is another thing I forgot.  libpager is special, it has its own
> demuxer (see libpager/demuxer.c) that writes requests into a queue,
> and a pool of workers that process requests from said queue.
> 
> The thing is, when we inhibit the pager RPCs, we merely prevent new
> ones from being enqueued, but we don't prevent the workers from
> processing already enqueued requests.  So we indeed need to add
> functions to inhibit and restart paging to libpager that know about
> the queue.
> 
> Justus



Re: VirtualBox Hangs Pre-Init Due To Ext2FS Fault

2015-07-20 Thread James Clarke
I have now got a patch that drains down the queue, and it does successfully 
stop sblock from being dereferenced etc when we actually reload. However, 
sometimes thread 5 (the same one that would dereference sblock) seems to get 
stuck in vm_fault_continue (at least according to the kernel debugger), so I 
need to do some more debugging to see why.

James

> On 19 Jul 2015, at 15:00, Richard Braun  wrote:
> 
>> On Sun, Jul 19, 2015 at 02:25:14PM +0100, James Clarke wrote:
>> Yeah, I tried inhibiting both buckets, but the paging RPCs still got 
>> through, so my guess was that libports's inhibit/resume methods weren't able 
>> to deal with libpager's own threads. The thing is I don't think we currently 
>> keep track of any reference to the main/worker threads, as 
>> pager_start_workers just takes a bucket and returns void. Is there a way we 
>> can instead make the main thread and/or workers able to block 
>> ports_inhibit_X_rpcs like normal RPC handlers and be cancelled etc? If 
>> possible I think that would be a cleaner solution.
> 
> To continue our discussion on IRC:
> 
> No, it would definitely not be a cleaner solution, just an ugly hack.
> Since paging doesn't occur as part of an RPC, you just can't use RPC
> stuff to manage it. I suggest building rwlock-based synrchonization
> functions specific to the pager workers.
> 
> -- 
> Richard Braun



[PATCH] WIP: Fix ext2fs remount race condition

2015-07-21 Thread James Clarke
---
 ext2fs/ext2fs.c  |  18 +++
 ext2fs/ext2fs.h  |   6 +++
 ext2fs/pager.c   |  35 +-
 fatfs/fatfs.h|   2 +
 fatfs/pager.c|  35 +-
 libdiskfs/disk-pager.c   |   3 +-
 libdiskfs/diskfs-pager.h |   1 +
 libpager/demuxer.c   | 122 +++
 libpager/pager.h |  23 -
 9 files changed, 230 insertions(+), 15 deletions(-)

diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
index d0fdfe7..200c210 100644
--- a/ext2fs/ext2fs.c
+++ b/ext2fs/ext2fs.c
@@ -207,10 +207,28 @@ main (int argc, char **argv)
 error_t
 diskfs_reload_global_state ()
 {
+  error_t err;
+
   pokel_flush (&global_pokel);
   pager_flush (diskfs_disk_pager, 1);
+
+  /* Paging must specifically be inhibited; if not, a paging request
+ could be handled while sblock is still NULL.
+ While some RPCs are inhibited when this function is called by
+ libdiskfs, paging RPCs are still enabled. Even if we were to
+ inhibit paging RPCs, libpager has its own pool of workers to handle
+ requests asynchronously, which libports is unaware of, so requests
+ can be handled even after the relevant RPCs are disabled.  This is
+ all dealt with by {inhibit,resume}_disk_pager.  */
+  err = inhibit_disk_pager ();
+  if (err)
+return err;
+
   sblock = NULL;
   get_hypermetadata ();
   map_hypermetadata ();
+
+  resume_disk_pager ();
+
   return 0;
 }
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 96d8e9d..d5f400e 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -201,6 +201,12 @@ struct user_pager_info
 /* Set up the disk pager.  */
 void create_disk_pager (void);
 
+/* Inhibit the disk pager.  */
+error_t inhibit_disk_pager (void);
+
+/* Resume the disk pager.  */
+void resume_disk_pager (void);
+
 /* Call this when we should turn off caching so that unused memory object
ports get freed.  */
 void drop_pager_softrefs (struct node *node);
diff --git a/ext2fs/pager.c b/ext2fs/pager.c
index b56c923..f41107f 100644
--- a/ext2fs/pager.c
+++ b/ext2fs/pager.c
@@ -34,6 +34,10 @@ struct port_bucket *disk_pager_bucket;
 /* A ports bucket to hold file pager ports.  */
 struct port_bucket *file_pager_bucket;
 
+/* Stores a reference to the requests instance used by the file pager so its
+   worker threads can be inhibited and resumed.  */
+struct requests *file_pager_requests;
+
 pthread_spinlock_t node_to_page_lock = PTHREAD_SPINLOCK_INITIALIZER;
 
 
@@ -1217,11 +1221,40 @@ create_disk_pager (void)
   file_pager_bucket = ports_create_bucket ();
 
   /* Start libpagers worker threads.  */
-  err = pager_start_workers (file_pager_bucket);
+  err = pager_start_workers (&file_pager_requests, file_pager_bucket);
   if (err)
 ext2_panic ("can't create libpager worker threads: %s", strerror (err));
 }
 
+error_t
+inhibit_disk_pager (void)
+{
+  error_t err;
+
+  /* Inhibiting RPCs is not sufficient, nor is it in fact necessary.
+ Since libpager has its own pool of workers, requests can still be
+ handled after RPCs have been inhibited, so pager_inhibit_workers
+ must be used. In fact, RPCs will not be inhibited; the requests
+ will just queue up inside libpager, and will be handled once the
+ workers are resumed.
+ The file pager can rely on the disk pager, so inhibit the file
+ pager first.  */
+
+  err = pager_inhibit_workers (file_pager_requests);
+  if (err)
+return err;
+
+  err = pager_inhibit_workers (diskfs_disk_pager_requests);
+  return err;
+}
+
+void
+resume_disk_pager (void)
+{
+  pager_resume_workers (diskfs_disk_pager_requests);
+  pager_resume_workers (file_pager_requests);
+}
+
 /* Call this to create a FILE_DATA pager and return a send right.
NODE must be locked.  */
 mach_port_t
diff --git a/fatfs/fatfs.h b/fatfs/fatfs.h
index 3c3d836..54c3426 100644
--- a/fatfs/fatfs.h
+++ b/fatfs/fatfs.h
@@ -121,6 +121,8 @@ extern struct dirrect dr_root_node;
 void drop_pager_softrefs (struct node *);
 void allow_pager_softrefs (struct node *);
 void create_fat_pager (void);
+error_t inhibit_fat_pager (void);
+void resume_fat_pager (void);
 
 void flush_node_pager (struct node *node);
 
diff --git a/fatfs/pager.c b/fatfs/pager.c
index 10d1fc9..3d860d1 100644
--- a/fatfs/pager.c
+++ b/fatfs/pager.c
@@ -29,6 +29,10 @@ struct port_bucket *disk_pager_bucket;
 /* A ports bucket to hold file pager ports.  */
 struct port_bucket *file_pager_bucket;
 
+/* Stores a reference to the requests instance used by the file pager so its
+   worker threads can be inhibited and resumed.  */
+struct requests *file_pager_requests;
+
 /* Mapped image of the FAT.  */
 void *fat_image;
 
@@ -776,11 +780,40 @@ create_fat_pager (void)
   file_pager_bucket = ports_create_bucket ();
 
   /* Start libpagers worker threads.  */
-  err = pager_start_workers (file_pager_bucket);
+  err = pager_start_workers (&file_pager_requests, file_pager_bucket);
   if (err)
 error (2, err, "can't create libpager 

[PATCH] Fix race condition in ext2fs when remounting

2015-07-22 Thread James Clarke
On some systems, ext2fs.static would regularly hang at startup, as a
race condition meant it would process paging requests while reounting.
To fix this, libpager has been altered to allow inhibiting and resuming
its worker threads.

* console/pager.c (pager_requests): New variable.
(user_pager_init): Updated call to pager_start_workers to use new
pager_requests variable.
* daemons/runsystem.sh: Removed artificial delay working around the race
condition.
* ext2fs/ext2fs.c (diskfs_reload_global_state): Call new
inhibit_ext2_pager and resume_ext2_pager functions, and leave sblock as
non-NULL so it will be munmapped.
* ext2fs/ext2fs.h (inhibit_ext2_pager,resume_ext2_pager): New functions.
* ext2fs/pager.c (file_pager_requests): New variable.
(create_disk_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_ext2_pager,resume_ext2_pager): New functions.
* fatfs/fatfs.h (inhibit_fat_pager,resume_fat_pager): New functions.
* fatfs/pager.c (file_pager_requests): New variable.
(create_fat_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_fat_pager,resume_fat_pager): New functions.
* libdiskfs/disk-pager.c (diskfs_disk_pager_requests): New variable.
(diskfs_start_disk_pager): Updated call to pager_start_workers to use
new diskfs_disk_pager_requests variable.
* libdiskfs/diskfs-pager.h (diskfs_disk_pager_requests): New variable.
* libpager/demuxer.c (struct pager_requests): Renamed struct requests to
struct pager_requests. Replaced queue with queue_in and queue_out
pointers. Added inhibit_wakeup field.
(pager_demuxer): Updated to use new queue_in/queue_out pointers. Only
wake up workers if not inhibited.
(worker_func): Updated to use new queue_in/queue_out pointers. Final
worker thread to sleep notifies the inhibit_wakeup condition variable.
(pager_start_workers): Added out parameter for the requests instance.
Allocate heap space shared by both queues. Initialise new inhibit_wakeup
condition.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/pager.h (struct pager_requests): Public forward definition.
(pager_start_workers): Added out parameter for the requests instance.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/queue.h (queue_empty): New function.
* storeio/pager.c (pager_requests): New variable.
(init_dev_paging): Updated call to pager_start_workers to use new
pager_requests variable.
---
 console/pager.c  |   3 +-
 daemons/runsystem.sh |   3 --
 ext2fs/ext2fs.c  |  12 -
 ext2fs/ext2fs.h  |   6 +++
 ext2fs/pager.c   |  29 +++-
 fatfs/fatfs.h|   2 +
 fatfs/pager.c|  29 +++-
 libdiskfs/disk-pager.c   |   3 +-
 libdiskfs/diskfs-pager.h |   1 +
 libpager/demuxer.c   | 119 ---
 libpager/pager.h |  28 ++-
 libpager/queue.h |   8 
 storeio/pager.c  |   3 +-
 13 files changed, 219 insertions(+), 27 deletions(-)

diff --git a/console/pager.c b/console/pager.c
index 5e13ba4..818e49d 100644
--- a/console/pager.c
+++ b/console/pager.c
@@ -42,6 +42,7 @@ struct user_pager_info
 
 /* We need a separate bucket for the pager ports.  */
 static struct port_bucket *pager_bucket;
+static struct pager_requests *pager_requests;
 
 
 /* Implement the pager_clear_user_data callback from the pager library. */
@@ -133,7 +134,7 @@ user_pager_init (void)
 error (5, errno, "Cannot create pager bucket");
 
   /* Start libpagers worker threads.  */
-  err = pager_start_workers (pager_bucket);
+  err = pager_start_workers (pager_bucket, &pager_requests);
   if (err)
 error (5, err, "Cannot start pager worker threads");
 }
diff --git a/daemons/runsystem.sh b/daemons/runsystem.sh
index ae25a7d..5d0ad01 100644
--- a/daemons/runsystem.sh
+++ b/daemons/runsystem.sh
@@ -118,9 +118,6 @@ esac
 /hurd/mach-defpager
 
 # This is necessary to make stat / return the correct device ids.
-# Work around a race condition (probably in the root translator).
-for i in `seq 1 10` ; do : ; done # XXX
-
 fsysopts / --update --readonly
 
 # Finally, start the actual init.
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
index d0fdfe7..03c9eed 100644
--- a/ext2fs/ext2fs.c
+++ b/ext2fs/ext2fs.c
@@ -207,10 +207,20 @@ main (int argc, char **argv)
 error_t
 diskfs_reload_global_state ()
 {
+  error_t err;
+
   pokel_flush (&global_pokel);
   pager_flush (diskfs_disk_pager, 1);
-  sblock = NULL;
+
+  /* libdiskfs is not responsible for inhibiting paging.  */
+  err = inhibit_ext2_pager ();
+  if (err)
+return err;
+
   get_hypermetadata ();
   map_hypermetadata ();
+
+  resume_ext2_pager ();
+
   return 0;
 }
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 96d8e9d..a744685 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -201,6 +201,12 @@ struct user_pager_info
 /* Set up the disk pager.  */
 void create_disk_pager (void);
 
+/* Inhibit the disk pager.  */
+e

[PATCH v2] Fix race condition in ext2fs when remounting

2015-07-22 Thread James Clarke
On some systems, ext2fs.static would regularly hang at startup, as a
race condition meant it would process paging requests while remounting.
To fix this, libpager has been altered to allow inhibiting and resuming
its worker threads, and ext2fs uses this to inhibit paging while
remounting.

* console/pager.c (pager_requests): New variable.
(user_pager_init): Updated call to pager_start_workers to use new
pager_requests variable.
* daemons/runsystem.sh: Removed artificial delay working around the race
condition.
* ext2fs/ext2fs.c (diskfs_reload_global_state): Call new
inhibit_ext2_pager and resume_ext2_pager functions, and leave sblock as
non-NULL so it will be munmapped.
* ext2fs/ext2fs.h (inhibit_ext2_pager,resume_ext2_pager): New functions.
* ext2fs/pager.c (file_pager_requests): New variable.
(create_disk_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_ext2_pager,resume_ext2_pager): New functions.
* fatfs/fatfs.h (inhibit_fat_pager,resume_fat_pager): New functions.
* fatfs/pager.c (file_pager_requests): New variable.
(create_fat_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_fat_pager,resume_fat_pager): New functions.
* libdiskfs/disk-pager.c (diskfs_disk_pager_requests): New variable.
(diskfs_start_disk_pager): Updated call to pager_start_workers to use
new diskfs_disk_pager_requests variable.
* libdiskfs/diskfs-pager.h (diskfs_disk_pager_requests): New variable.
* libpager/demuxer.c (struct pager_requests): Renamed struct requests to
struct pager_requests. Replaced queue with queue_in and queue_out
pointers. Added inhibit_wakeup field.
(pager_demuxer): Updated to use new queue_in/queue_out pointers. Only
wake up workers if not inhibited.
(worker_func): Updated to use new queue_in/queue_out pointers. Final
worker thread to sleep notifies the inhibit_wakeup condition variable.
(pager_start_workers): Added out parameter for the requests instance.
Allocate heap space shared by both queues. Initialise new inhibit_wakeup
condition.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/pager.h (struct pager_requests): Public forward definition.
(pager_start_workers): Added out parameter for the requests instance.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/queue.h (queue_empty): New function.
* storeio/pager.c (pager_requests): New variable.
(init_dev_paging): Updated call to pager_start_workers to use new
pager_requests variable.
---
 console/pager.c  |   3 +-
 daemons/runsystem.sh |   3 --
 ext2fs/ext2fs.c  |  12 -
 ext2fs/ext2fs.h  |   6 +++
 ext2fs/pager.c   |  29 +++-
 fatfs/fatfs.h|   2 +
 fatfs/pager.c|  29 +++-
 libdiskfs/disk-pager.c   |   3 +-
 libdiskfs/diskfs-pager.h |   1 +
 libpager/demuxer.c   | 119 ---
 libpager/pager.h |  28 ++-
 libpager/queue.h |   8 
 storeio/pager.c  |   3 +-
 13 files changed, 219 insertions(+), 27 deletions(-)

diff --git a/console/pager.c b/console/pager.c
index 5e13ba4..818e49d 100644
--- a/console/pager.c
+++ b/console/pager.c
@@ -42,6 +42,7 @@ struct user_pager_info
 
 /* We need a separate bucket for the pager ports.  */
 static struct port_bucket *pager_bucket;
+static struct pager_requests *pager_requests;
 
 
 /* Implement the pager_clear_user_data callback from the pager library. */
@@ -133,7 +134,7 @@ user_pager_init (void)
 error (5, errno, "Cannot create pager bucket");
 
   /* Start libpagers worker threads.  */
-  err = pager_start_workers (pager_bucket);
+  err = pager_start_workers (pager_bucket, &pager_requests);
   if (err)
 error (5, err, "Cannot start pager worker threads");
 }
diff --git a/daemons/runsystem.sh b/daemons/runsystem.sh
index ae25a7d..5d0ad01 100644
--- a/daemons/runsystem.sh
+++ b/daemons/runsystem.sh
@@ -118,9 +118,6 @@ esac
 /hurd/mach-defpager
 
 # This is necessary to make stat / return the correct device ids.
-# Work around a race condition (probably in the root translator).
-for i in `seq 1 10` ; do : ; done # XXX
-
 fsysopts / --update --readonly
 
 # Finally, start the actual init.
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
index d0fdfe7..03c9eed 100644
--- a/ext2fs/ext2fs.c
+++ b/ext2fs/ext2fs.c
@@ -207,10 +207,20 @@ main (int argc, char **argv)
 error_t
 diskfs_reload_global_state ()
 {
+  error_t err;
+
   pokel_flush (&global_pokel);
   pager_flush (diskfs_disk_pager, 1);
-  sblock = NULL;
+
+  /* libdiskfs is not responsible for inhibiting paging.  */
+  err = inhibit_ext2_pager ();
+  if (err)
+return err;
+
   get_hypermetadata ();
   map_hypermetadata ();
+
+  resume_ext2_pager ();
+
   return 0;
 }
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 96d8e9d..a744685 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -201,6 +201,12 @@ struct user_pager_info
 /* Set up the disk pager.  */
 void crea

Re: [PATCH] Fix race condition in ext2fs when remounting

2015-07-22 Thread James Clarke
Perhaps; I was following what diskfs_remount does when inhibiting RPCs, which 
stay inhibited on error.

James

> On 23 Jul 2015, at 00:51, Diego Nieto Cid  wrote:
> 
> Hi
> 
> This is me being picky about a corner case :-)
> 
> 2015-07-22 19:42 GMT-03:00 James Clarke :
>> +error_t
>> +inhibit_ext2_pager (void)
>> +{
>> +  error_t err;
>> +
>> +  /* The file pager can rely on the disk pager, so inhibit the file
>> + pager first.  */
>> +
>> +  err = pager_inhibit_workers (file_pager_requests);
>> +  if (err)
>> +return err;
>> +
>> +  err = pager_inhibit_workers (diskfs_disk_pager_requests);
>> +  return err;
>> +}
> 
> It looks like the file pager workers will remain inhibited if the
> 'pager_inhibit_workers' function
> fails to inhibit the disk pager. fatfs is affected by this problem too.
> 
> Should a call to 'pager_resume_workers' be inserted before returning
> in case of error?
> 
> Regards



[PATCH v3] Fix race condition in ext2fs when remounting

2015-07-23 Thread James Clarke
On some systems, ext2fs.static would regularly hang at startup, as a
race condition meant it would process paging requests while remounting.
To fix this, libpager has been altered to allow inhibiting and resuming
its worker threads, and ext2fs uses this to inhibit paging while
remounting.

* console/pager.c (pager_requests): New variable.
(user_pager_init): Updated call to pager_start_workers to use new
pager_requests variable.
* daemons/runsystem.sh: Removed artificial delay working around the race
condition.
* ext2fs/ext2fs.c (diskfs_reload_global_state): Call new
inhibit_ext2_pager and resume_ext2_pager functions, and leave sblock as
non-NULL so it will be munmapped.
* ext2fs/ext2fs.h (inhibit_ext2_pager,resume_ext2_pager): New functions.
* ext2fs/pager.c (file_pager_requests): New variable.
(create_disk_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_ext2_pager,resume_ext2_pager): New functions.
* fatfs/fatfs.h (inhibit_fat_pager,resume_fat_pager): New functions.
* fatfs/pager.c (file_pager_requests): New variable.
(create_fat_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_fat_pager,resume_fat_pager): New functions.
* libdiskfs/disk-pager.c (diskfs_disk_pager_requests): New variable.
(diskfs_start_disk_pager): Updated call to pager_start_workers to use
new diskfs_disk_pager_requests variable.
* libdiskfs/diskfs-pager.h (diskfs_disk_pager_requests): New variable.
* libpager/demuxer.c (struct pager_requests): Renamed struct requests to
struct pager_requests. Replaced queue with queue_in and queue_out
pointers. Added inhibit_wakeup field.
(pager_demuxer): Updated to use new queue_in/queue_out pointers. Only
wake up workers if not inhibited.
(worker_func): Updated to use new queue_in/queue_out pointers. Final
worker thread to sleep notifies the inhibit_wakeup condition variable.
(pager_start_workers): Added out parameter for the requests instance.
Allocate heap space shared by both queues. Initialise new inhibit_wakeup
condition.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/pager.h (struct pager_requests): Public forward definition.
(pager_start_workers): Added out parameter for the requests instance.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/queue.h (queue_empty): New function.
* storeio/pager.c (pager_requests): New variable.
(init_dev_paging): Updated call to pager_start_workers to use new
pager_requests variable.
---
 console/pager.c  |   3 +-
 daemons/runsystem.sh |   3 --
 ext2fs/ext2fs.c  |  12 -
 ext2fs/ext2fs.h  |   6 +++
 ext2fs/pager.c   |  33 -
 fatfs/fatfs.h|   2 +
 fatfs/pager.c|  33 -
 libdiskfs/disk-pager.c   |   3 +-
 libdiskfs/diskfs-pager.h |   1 +
 libpager/demuxer.c   | 119 ---
 libpager/pager.h |  28 ++-
 libpager/queue.h |   8 
 storeio/pager.c  |   3 +-
 13 files changed, 227 insertions(+), 27 deletions(-)

diff --git a/console/pager.c b/console/pager.c
index 5e13ba4..818e49d 100644
--- a/console/pager.c
+++ b/console/pager.c
@@ -42,6 +42,7 @@ struct user_pager_info
 
 /* We need a separate bucket for the pager ports.  */
 static struct port_bucket *pager_bucket;
+static struct pager_requests *pager_requests;
 
 
 /* Implement the pager_clear_user_data callback from the pager library. */
@@ -133,7 +134,7 @@ user_pager_init (void)
 error (5, errno, "Cannot create pager bucket");
 
   /* Start libpagers worker threads.  */
-  err = pager_start_workers (pager_bucket);
+  err = pager_start_workers (pager_bucket, &pager_requests);
   if (err)
 error (5, err, "Cannot start pager worker threads");
 }
diff --git a/daemons/runsystem.sh b/daemons/runsystem.sh
index ae25a7d..5d0ad01 100644
--- a/daemons/runsystem.sh
+++ b/daemons/runsystem.sh
@@ -118,9 +118,6 @@ esac
 /hurd/mach-defpager
 
 # This is necessary to make stat / return the correct device ids.
-# Work around a race condition (probably in the root translator).
-for i in `seq 1 10` ; do : ; done # XXX
-
 fsysopts / --update --readonly
 
 # Finally, start the actual init.
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
index d0fdfe7..03c9eed 100644
--- a/ext2fs/ext2fs.c
+++ b/ext2fs/ext2fs.c
@@ -207,10 +207,20 @@ main (int argc, char **argv)
 error_t
 diskfs_reload_global_state ()
 {
+  error_t err;
+
   pokel_flush (&global_pokel);
   pager_flush (diskfs_disk_pager, 1);
-  sblock = NULL;
+
+  /* libdiskfs is not responsible for inhibiting paging.  */
+  err = inhibit_ext2_pager ();
+  if (err)
+return err;
+
   get_hypermetadata ();
   map_hypermetadata ();
+
+  resume_ext2_pager ();
+
   return 0;
 }
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 96d8e9d..a744685 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -201,6 +201,12 @@ struct user_pager_info
 /* Set up the disk pager.  */
 void cr

Re: [PATCH v3] Fix race condition in ext2fs when remounting

2015-08-15 Thread James Clarke
Not sure how I missed that; will grep for any others.

James

> On 14 Aug 2015, at 13:16, Justus Winter <4win...@informatik.uni-hamburg.de> 
> wrote:
> 
> Quoting James Clarke (2015-07-23 19:33:42)
>> diff --git a/libdiskfs/disk-pager.c b/libdiskfs/disk-pager.c
>> index 008aa2d..33b109c 100644
>> --- a/libdiskfs/disk-pager.c
>> +++ b/libdiskfs/disk-pager.c
>> @@ -24,6 +24,7 @@
>> __thread struct disk_image_user *diskfs_exception_diu;
>> 
>> struct pager *diskfs_disk_pager;
>> +struct requests *diskfs_disk_pager_requests;
> 
> struct pager_requests
> 
> Justus



[PATCH] Fix race condition in ext2fs when remounting

2015-08-27 Thread James Clarke
On some systems, ext2fs.static would regularly hang at startup, as a
race condition meant it would process paging requests while remounting.
To fix this, libpager has been altered to allow inhibiting and resuming
its worker threads, and ext2fs uses this to inhibit paging while
remounting.

* console/pager.c (pager_requests): New variable.
(user_pager_init): Updated call to pager_start_workers to use new
pager_requests variable.
* daemons/runsystem.sh: Removed artificial delay working around the race
condition.
* ext2fs/ext2fs.c (diskfs_reload_global_state): Call new
inhibit_ext2_pager and resume_ext2_pager functions, and leave sblock as
non-NULL so it will be munmapped.
* ext2fs/ext2fs.h (inhibit_ext2_pager,resume_ext2_pager): New functions.
* ext2fs/pager.c (file_pager_requests): New variable.
(create_disk_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_ext2_pager,resume_ext2_pager): New functions.
* fatfs/fatfs.h (inhibit_fat_pager,resume_fat_pager): New functions.
* fatfs/pager.c (file_pager_requests): New variable.
(create_fat_pager): Updated call to pager_start_workers to use new
file_pager_requests variable.
(inhibit_fat_pager,resume_fat_pager): New functions.
* libdiskfs/disk-pager.c (diskfs_disk_pager_requests): New variable.
(diskfs_start_disk_pager): Updated call to pager_start_workers to use
new diskfs_disk_pager_requests variable.
* libdiskfs/diskfs-pager.h (diskfs_disk_pager_requests): New variable.
* libpager/demuxer.c (struct pager_requests): Renamed struct requests to
struct pager_requests. Replaced queue with queue_in and queue_out
pointers. Added inhibit_wakeup field.
(pager_demuxer): Updated to use new queue_in/queue_out pointers. Only
wake up workers if not inhibited.
(worker_func): Updated to use new queue_in/queue_out pointers. Final
worker thread to sleep notifies the inhibit_wakeup condition variable.
(pager_start_workers): Added out parameter for the requests instance.
Allocate heap space shared by both queues. Initialise new inhibit_wakeup
condition.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/pager.h (struct pager_requests): Public forward definition.
(pager_start_workers): Added out parameter for the requests instance.
(pager_inhibit_workers,pager_resume_workers): New functions.
* libpager/queue.h (queue_empty): New function.
* storeio/pager.c (pager_requests): New variable.
(init_dev_paging): Updated call to pager_start_workers to use new
pager_requests variable.
---
 console/pager.c  |   3 +-
 daemons/runsystem.sh |   3 --
 ext2fs/ext2fs.c  |  12 -
 ext2fs/ext2fs.h  |   6 +++
 ext2fs/pager.c   |  33 -
 fatfs/fatfs.h|   2 +
 fatfs/pager.c|  33 -
 libdiskfs/disk-pager.c   |   3 +-
 libdiskfs/diskfs-pager.h |   1 +
 libpager/demuxer.c   | 119 ---
 libpager/pager.h |  28 ++-
 libpager/queue.h |   8 
 storeio/pager.c  |   3 +-
 13 files changed, 227 insertions(+), 27 deletions(-)

diff --git a/console/pager.c b/console/pager.c
index 5e13ba4..818e49d 100644
--- a/console/pager.c
+++ b/console/pager.c
@@ -42,6 +42,7 @@ struct user_pager_info
 
 /* We need a separate bucket for the pager ports.  */
 static struct port_bucket *pager_bucket;
+static struct pager_requests *pager_requests;
 
 
 /* Implement the pager_clear_user_data callback from the pager library. */
@@ -133,7 +134,7 @@ user_pager_init (void)
 error (5, errno, "Cannot create pager bucket");
 
   /* Start libpagers worker threads.  */
-  err = pager_start_workers (pager_bucket);
+  err = pager_start_workers (pager_bucket, &pager_requests);
   if (err)
 error (5, err, "Cannot start pager worker threads");
 }
diff --git a/daemons/runsystem.sh b/daemons/runsystem.sh
index ae25a7d..5d0ad01 100644
--- a/daemons/runsystem.sh
+++ b/daemons/runsystem.sh
@@ -118,9 +118,6 @@ esac
 /hurd/mach-defpager
 
 # This is necessary to make stat / return the correct device ids.
-# Work around a race condition (probably in the root translator).
-for i in `seq 1 10` ; do : ; done # XXX
-
 fsysopts / --update --readonly
 
 # Finally, start the actual init.
diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c
index d0fdfe7..03c9eed 100644
--- a/ext2fs/ext2fs.c
+++ b/ext2fs/ext2fs.c
@@ -207,10 +207,20 @@ main (int argc, char **argv)
 error_t
 diskfs_reload_global_state ()
 {
+  error_t err;
+
   pokel_flush (&global_pokel);
   pager_flush (diskfs_disk_pager, 1);
-  sblock = NULL;
+
+  /* libdiskfs is not responsible for inhibiting paging.  */
+  err = inhibit_ext2_pager ();
+  if (err)
+return err;
+
   get_hypermetadata ();
   map_hypermetadata ();
+
+  resume_ext2_pager ();
+
   return 0;
 }
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 96d8e9d..a744685 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -201,6 +201,12 @@ struct user_pager_info
 /* Set up the disk pager.  */
 void cr

[RFC] Fix printk not handling ANSI escape codes

2015-08-29 Thread James Clarke
* i386/i386at/kd.c (kdstart): Moved escape sequence handling to new
kd_putc_esc function.
(kd_putc_esc): New function with logic from kdstart.
(kdcnputc): Call kd_putc_esc rather than kd_putc to allow for ANSI
escape codes.
* i386/i386at/kd.h (kd_putc_esc): New function.
---
 i386/i386at/kd.c | 63 +++-
 i386/i386at/kd.h |  1 +
 2 files changed, 40 insertions(+), 24 deletions(-)

diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index 5656e83..52ba0b6 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -1059,7 +1059,6 @@ kdstart(struct tty *tp)
 {
spl_t   o_pri;
int ch;
-   unsigned char   c;
 
if (tp->t_state & TS_TTSTOP)
return;
@@ -1069,33 +1068,12 @@ kdstart(struct tty *tp)
break;
if ((tp->t_outq.c_cc <= 0) || (ch = getc(&tp->t_outq)) == -1)
break;
-   c = ch;
/*
 * Drop priority for long screen updates. ttstart() calls us at
 * spltty.
 */
o_pri = splsoftclock(); /* block timeout */
-   if (c == (K_ESC)) {
-   if (esc_spt == esc_seq) {
-   *(esc_spt++)=(K_ESC);
-   *(esc_spt) = '\0';
-   } else {
-   kd_putc((K_ESC));
-   esc_spt = esc_seq;
-   }
-   } else {
-   if (esc_spt - esc_seq) {
-   if (esc_spt - esc_seq > K_MAXESC - 1)
-   esc_spt = esc_seq;
-   else {
-   *(esc_spt++) = c;
-   *(esc_spt) = '\0';
-   kd_parseesc();
- }
-   } else {
-   kd_putc(c);
-   }
-   }
+   kd_putc(ch);
splx(o_pri);
}
if (tp->t_outq.c_cc <= TTLOWAT(tp)) {
@@ -1237,6 +1215,43 @@ kd_bellon(void)
 
 /*
  *
+ * Function kd_putc_esc():
+ *
+ * This function puts a character on the screen, handling escape
+ * sequences.
+ *
+ * input   : character to be displayed (or part of an escape code)
+ * output  : character is displayed, or some action is taken
+ *
+ */
+void
+kd_putc_esc(u_char c)
+{
+   if (c == (K_ESC)) {
+   if (esc_spt == esc_seq) {
+   *(esc_spt++)=(K_ESC);
+   *(esc_spt) = '\0';
+   } else {
+   kd_putc((K_ESC));
+   esc_spt = esc_seq;
+   }
+   } else {
+   if (esc_spt - esc_seq) {
+   if (esc_spt - esc_seq > K_MAXESC - 1)
+   esc_spt = esc_seq;
+   else {
+   *(esc_spt++) = c;
+   *(esc_spt) = '\0';
+   kd_parseesc();
+   }
+   } else {
+   kd_putc(c);
+   }
+   }
+}
+
+/*
+ *
  * Function kd_putc():
  *
  * This function simply puts a character on the screen.  It does some
@@ -2950,7 +2965,7 @@ kdcnputc(dev_t dev, int c)
/* Note that tab is handled in kd_putc */
if (c == '\n')
kd_putc('\r');
-   kd_putc(c);
+   kd_putc_esc(c);
 
return 0;
 }
diff --git a/i386/i386at/kd.h b/i386/i386at/kd.h
index 0cfed69..60cee7e 100644
--- a/i386/i386at/kd.h
+++ b/i386/i386at/kd.h
@@ -702,6 +702,7 @@ extern void kd_setleds1 (u_char);
 extern void kd_setleds2 (void);
 extern void cnsetleds (u_char);
 extern void kdreboot (void);
+extern void kd_putc_esc (u_char);
 extern void kd_putc (u_char);
 extern void kd_parseesc (void);
 extern void kd_down (void);
-- 
2.5.1




Re: [RFC] Fix printk not handling ANSI escape codes

2015-08-29 Thread James Clarke
Yes, it should be; since I didn't catch that I'd guess nothing in Mach/Hurd is 
actually using escape codes.

I was trying to decide whether putc should handle escape codes or whether it 
should be left as outputting raw bytes to the display. As you can see I chose 
the latter, but do you think that was the right decision?

James

> On 29 Aug 2015, at 11:20, Samuel Thibault  wrote:
> 
> James Clarke, le Sat 29 Aug 2015 11:15:29 +0100, a écrit :
>> @@ -1069,33 +1068,12 @@ kdstart(struct tty *tp)
>>break;
>>if ((tp->t_outq.c_cc <= 0) || (ch = getc(&tp->t_outq)) == -1)
>>break;
>> -c = ch;
>>/*
>> * Drop priority for long screen updates. ttstart() calls us at
>> * spltty.
>> */
>>o_pri = splsoftclock();/* block timeout */
>> -if (c == (K_ESC)) {
> ...
>> -}
>> +kd_putc(ch);
> 
> I don't understand: shouldn't that be kd_putc_esc?
> 
> Samuel



Re: [RFC] Fix printk not handling ANSI escape codes

2015-08-29 Thread James Clarke
I never gave that as an option?

James

> On 29 Aug 2015, at 11:44, Samuel Thibault  wrote:
> 
> James Clarke, le Sat 29 Aug 2015 11:42:38 +0100, a écrit :
>> Yes, it should be; since I didn't catch that I'd guess nothing in Mach/Hurd 
>> is actually using escape codes.
>> 
>> I was trying to decide whether putc should handle escape codes or whether it 
>> should be left as outputting raw bytes to the display. As you can see I 
>> chose the latter, but do you think that was the right decision?
> 
> Well, I don't see why we would want to forbid the use of ESC sequences
> in Mach/Hurd :)
> 
> Samuel



Re: [RFC] Fix printk not handling ANSI escape codes

2015-08-29 Thread James Clarke
Yes, that was a mistake, it should call kd_putc_esc.

James

> On 29 Aug 2015, at 11:55, Samuel Thibault  wrote:
> 
> James Clarke, le Sat 29 Aug 2015 11:53:57 +0100, a écrit :
>> I never gave that as an option?
> 
> ? I understand even less.  AIUI, before kd_start had esc support; with
> your patch it doesn't have any more.  Probably Mach/Hurd never made use
> of it, but that's probably not a reason for removing the support, you
> never know who might want to make use of it someday.
> 
> Samuel



[PATCH] Install port-deref-deferred.h header for ports.h

2015-09-10 Thread James Clarke
* libports/Makefile (installhdrs): Add port-deref-deferred.h for ports.h
---
 libports/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libports/Makefile b/libports/Makefile
index b8b82ee..af881f8 100644
--- a/libports/Makefile
+++ b/libports/Makefile
@@ -38,7 +38,7 @@ SRCS = create-bucket.c create-class.c \
  claim-right.c transfer-right.c create-port-noinstall.c create-internal.c \
  interrupted.c extern-inline.c port-deref-deferred.c
 
-installhdrs = ports.h
+installhdrs = ports.h port-deref-deferred.h
 
 HURDLIBS= ihash
 LDLIBS += -lpthread
-- 
2.5.1




[PATCH] Add support for ANSI.SYS SCP/RCP escape codes

2015-09-11 Thread James Clarke
This adds support for CSI s and u, which are equivalent to ESC 7 and 8,
saving/restoring the cursor position.

* console/display.c (handle_esc_bracket): Added support for CSI s and u.
---
 console/display.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/console/display.c b/console/display.c
index eb420fd..98c70f5 100644
--- a/console/display.c
+++ b/console/display.c
@@ -1210,6 +1210,18 @@ handle_esc_bracket (display_t display, char op)
   user->cursor.col -= (parse->params[0] ?: 1);
   limit_cursor (display);
   break;
+case 's':  /* ANSI.SYS: Save cursor and attributes.  */
+  /* Save cursor position: .  */
+  display->cursor.saved_x = user->cursor.col;
+  display->cursor.saved_y = user->cursor.row;
+  break;
+case 'u':  /* ANSI.SYS: Restore cursor and attributes.  */
+  /* Restore cursor position: .  */
+  user->cursor.col = display->cursor.saved_x;
+  user->cursor.row = display->cursor.saved_y;
+  /* In case the screen was larger before:  */
+  limit_cursor (display);
+  break;
 case 'l':
   /* Reset mode.  */
   for (i = 0; i < parse->nparams; i++)
-- 
2.5.1




Re: [PATCH] Add support for ANSI.SYS SCP/RCP escape codes

2015-09-12 Thread James Clarke
Currently the new "apt" command-line tool relies on them (when it installs 
packages, it keeps a progress bar at the bottom, but shows a log above), 
although they've recently patched it to use the more widely-available ESC 7/8 
(though the patch is not yet in sid).
I chose SCP/RCP, because ANSI.SYS called them Save/Restore Cursor Position, and 
everywhere seems to refer to them by that acronym (they're even listed on 
Wikipedia in the table of codes, despite not being in ECMA-48, nor being 
implemented by the VT100).

James

> On 12 Sep 2015, at 10:15, Samuel Thibault  wrote:
> 
> Hello,
> 
> James Clarke, le Sat 12 Sep 2015 00:42:05 +0100, a écrit :
>> This adds support for CSI s and u, which are equivalent to ESC 7 and 8,
>> saving/restoring the cursor position.
> 
> Just curious: in which case did you see it a problem, or is it just for
> completeness? (which can always become convenient anyway)
> 
>> +case 's':/* ANSI.SYS: Save cursor and attributes.  */
>> +  /* Save cursor position: .  */
> 
> Why scp?  AIUI from terminfo(5), scp is the capname for set_color_pair,
> the tcap code for save cursor position is sc.
> 
>> +  display->cursor.saved_x = user->cursor.col;
>> +  display->cursor.saved_y = user->cursor.row;
>> +  break;
>> +case 'u':/* ANSI.SYS: Restore cursor and attributes.  */
>> +  /* Restore cursor position: .  */
>> +  user->cursor.col = display->cursor.saved_x;
>> +  user->cursor.row = display->cursor.saved_y;
>> +  /* In case the screen was larger before:  */
>> +  limit_cursor (display);
>> +  break;
>> case 'l':
>>   /* Reset mode.  */
>>   for (i = 0; i < parse->nparams; i++)
>> -- 
>> 2.5.1
>> 
>> 



Re: (Newbie question) Failed building hurd on Debian GNU Hurd

2015-09-24 Thread James Clarke
That’s an issue with the current Hurd repo on Savannah. You need this patch 
http://darnassus.sceen.net/gitweb/teythoon/packaging/hurd.git/blob/HEAD:/debian/patches/proc-task-notify-0005-proc-fix-build.patch,
 from what I gather (at least it fixes it for me).

James

> On 24 Sep 2015, at 13:50, Braione Pietro  
> wrote:
> 
> Hello Samuel.
>> Il giorno 15/set/2015, alle ore 17:28, Samuel Thibault 
>>  ha scritto:
>> 
>> Hello,
>> 
>> Braione Pietro, le Tue 15 Sep 2015 12:31:16 +, a écrit :
>>> ../libports/libports.so: undefined reference to 
>>> `mach_port_set_protected_payload’
>>> ../libports/libports.so: undefined reference to 
>>> `mach_port_clear_protected_payload’
>> 
>> These are new features which were added to GNU Mach after the 2013
>> release.  To get them you need at least a newer glibc in addition to the
>> newer gnumach.  
> 
> Since I want to be able to build the head version, I downloaded the 2015 
> Debian distribution and rebuilt everything (except for mig, but I don’t think 
> this is the issue). I strictly followed the instructions at 
> http://www.gnu.org/software/hurd/microkernel/mach/gnumach/building.html and 
> http://www.gnu.org/software/hurd/hurd/building.html, in their non-Debian 
> variant, plus make install of gnumach. It still fails, but now while linking 
> the proc server:
> 
> …
> make -C proc all
> …
> mgt.o: In function `S_mach_notify_new_task’:
> /root/hurd/build/proc/../../proc/mgt.c:1081: undefined reference to 
> `mach_notify_new_task’
> collect2: error: ld returned 1 exit status
> 
> Can I suppose that I need a newer glibc? If yes, which of the many branches 
> should I check out?
> Best,
> Pietro




Hurd Login Utility

2015-09-29 Thread James Clarke
Whilst looking through the code in utils/login.c, I noticed a security issue. 
Even if --paranoid is set, if you give it a UID that doesn’t exist (login 
treats it as a UID if the first character is a digit, with no fallback to 
treating it as a username), it will exit without prompting for a password (and 
of course prompts for a password if it is a valid UID!). Is this intentional?
I was also thinking that login should prompt for a username if not provided on 
the command line, as with Linux and BSD. This would in fact let us get rid of 
/bin/loginpr (currently we go via bash just to prompt for a username, and then 
exec login, which seems unnecessary). Thoughts?

James




Re: Hurd Login Utility

2015-09-30 Thread James Clarke

This seems to be caused by a segfault, so I imagine this is not intended! 
Tracking down the cause...

James

On Tue, 29 Sep 2015, James Clarke wrote:


Whilst looking through the code in utils/login.c, I noticed a security issue. 
Even if --paranoid is set, if you give it a UID that doesn’t exist (login 
treats it as a UID if the first character is a digit, with no fallback to 
treating it as a username), it will exit without prompting for a password (and 
of course prompts for a password if it is a valid UID!). Is this intentional?
I was also thinking that login should prompt for a username if not provided on 
the command line, as with Linux and BSD. This would in fact let us get rid of 
/bin/loginpr (currently we go via bash just to prompt for a username, and then 
exec login, which seems unnecessary). Thoughts?

James



[PATCH 1/1] Add missing null checks in libshouldbeinlibc

2015-09-30 Thread James Clarke
The getpwnam_r and similar functions only return non-zero on error, but not
finding the given name/UID/GID does not count as an error. When they return 0,
the value of the result (*result when looking at the arguments in the man pages)
still needs to be checked for null.

* libshouldbeinlibc/idvec-rep.c (lookup_uid): Check result for null.
(lookup_gid): Likewise.
* libshouldbeinlibc/idvec-verify.c (verify_passwd): Likewise.
(verify_id): Likewise.
---
 libshouldbeinlibc/idvec-rep.c| 4 ++--
 libshouldbeinlibc/idvec-verify.c | 7 ---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/libshouldbeinlibc/idvec-rep.c b/libshouldbeinlibc/idvec-rep.c
index 16408a4..4fc7712 100644
--- a/libshouldbeinlibc/idvec-rep.c
+++ b/libshouldbeinlibc/idvec-rep.c
@@ -129,7 +129,7 @@ lookup_uid (uid_t uid)
 {
   char buf[1024];
   struct passwd _pw, *pw;
-  if (getpwuid_r (uid, &_pw, buf, sizeof buf, &pw) == 0)
+  if (getpwuid_r (uid, &_pw, buf, sizeof buf, &pw) == 0 && pw)
 return strdup (pw->pw_name);
   else
 return 0;
@@ -141,7 +141,7 @@ lookup_gid (gid_t gid)
 {
   char buf[1024];
   struct group _gr, *gr;
-  if (getgrgid_r (gid, &_gr, buf, sizeof buf, &gr) == 0)
+  if (getgrgid_r (gid, &_gr, buf, sizeof buf, &gr) == 0 && gr)
 return strdup (gr->gr_name);
   else
 return 0;
diff --git a/libshouldbeinlibc/idvec-verify.c b/libshouldbeinlibc/idvec-verify.c
index 4d9b6db..4019a04 100644
--- a/libshouldbeinlibc/idvec-verify.c
+++ b/libshouldbeinlibc/idvec-verify.c
@@ -107,7 +107,8 @@ verify_passwd (const char *password,
  return pw->pw_passwd;
}
 
-  if (getpwuid_r (wheel_uid, &_pw, lookup_buf, sizeof lookup_buf, &pw))
+  if (getpwuid_r (wheel_uid, &_pw, lookup_buf, sizeof lookup_buf, &pw)
+ || ! pw)
return errno ?: EINVAL;
 
   sys_encrypted = check_shadow (pw);
@@ -266,7 +267,7 @@ verify_id (uid_t id, int is_group, int multiple,
  {
struct group _gr, *gr;
if (getgrgid_r (id, &_gr, id_lookup_buf, sizeof id_lookup_buf, &gr)
-   == 0)
+   == 0 && gr)
  {
if (!gr->gr_passwd || !*gr->gr_passwd)
  return (*verify_fn) ("", id, 1, gr, verify_hook);
@@ -278,7 +279,7 @@ verify_id (uid_t id, int is_group, int multiple,
  {
struct passwd _pw, *pw;
if (getpwuid_r (id, &_pw, id_lookup_buf, sizeof id_lookup_buf, &pw)
-   == 0)
+   == 0 && pw)
  {
if (strcmp (pw->pw_passwd, SHADOW_PASSWORD_STRING) == 0)
  {
-- 
2.5.3




[PATCH 0/1] Add missing null checks in libshouldbeinlibc

2015-09-30 Thread James Clarke
This stops /bin/login segfaulting when giving it a bad UID. However, the fact
that the UID does not exist is still leaked, since
libshouldbeinlibc/idvec-verify.c:verify_id falls back on asking for the root
password, and indicates this by changing the prompt to "Password for root".

James Clarke (1):
  Add missing null checks in libshouldbeinlibc

 libshouldbeinlibc/idvec-rep.c| 4 ++--
 libshouldbeinlibc/idvec-verify.c | 7 ---
 2 files changed, 6 insertions(+), 5 deletions(-)

-- 
2.5.3




[PATCH] sulogin: Use fallback method on the Hurd for detecting consoles

2015-10-09 Thread James Clarke
Signed-off-by: James Clarke 
---
 login-utils/sulogin-consoles.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/login-utils/sulogin-consoles.c b/login-utils/sulogin-consoles.c
index 39d24d2..1b05b38 100644
--- a/login-utils/sulogin-consoles.c
+++ b/login-utils/sulogin-consoles.c
@@ -612,6 +612,14 @@ int detect_consoles(const char *device, int fallback, 
struct list_head *consoles
 #ifdef TIOCGDEV
unsigned int devnum;
 #endif
+#ifdef __GNU__
+   /*
+* The Hurd always gives st_rdev as 0, which causes this
+* method to select the first terminal it finds.
+*/
+   close(fd);
+   goto fallback;
+#endif
DBG(dbgprint("trying device/fallback file descriptor"));
 
if (fstat(fd, &st) < 0) {
-- 
2.5.3




Re: PATCH: Hurd FTBFS with perl 5.22

2016-01-04 Thread James Clarke
On 4 Jan 2016, at 22:13, Samuel Thibault  wrote:
> Svante Signell, on Mon 04 Jan 2016 23:09:00 +0100, wrote:
>> Obviously the !defined(@val) is
>> no longer allowed, and I don't know how to rewrite that condition.
> 
> Perhaps juste !@val?
> I have no idea, I don't know perl. But probably worth trying and
> investigating, and I believe you can do it.

It is indeed just !@val (this use of defined was deprecated in 5.6.1 and raised 
warnings since 5.16[1]). Here's the simplified patch (untested):

> Index: hurd-0.7/libdde-linux26/lib/src/kernel/timeconst.pl
> ===
> --- hurd-0.7.orig/libdde-linux26/lib/src/kernel/timeconst.pl
> +++ hurd-0.7/libdde-linux26/lib/src/kernel/timeconst.pl
> @@ -369,10 +369,10 @@ if ($hz eq '--can') {
>   die "Usage: $0 HZ\n";
>   }
> 
>   @val = @{$canned_values{$hz}};
> - if (!defined(@val)) {
> + if (!@val) {
>   @val = compute_values($hz);
>   }
>   output($hz, @val);
>  }
>  exit 0;


James

[1] 
https://metacpan.org/pod/release/RJBS/perl-5.22.0/pod/perldelta.pod#defined-array-and-defined-hash-are-now-fatal-errors



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [PATCH] Check for a return value in netfs_make_peropen before using it in netfs_make_protid.

2016-02-07 Thread James Clarke
On 7 Feb 2016, at 14:51, Flavio Cruz  wrote:
> -  cred = netfs_make_protid (netfs_make_peropen (node, flags, cookie2),
> - user);
> +  po = netfs_make_peropen (node, flags, cookie2);
> +  if (! po)
> +return errno;

You need to free user.

James



signature.asc
Description: Message signed with OpenPGP using GPGMail


[PATCH] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread James Clarke
* libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Fixed leaking
iouser and peropen structs on error.
---
 libnetfs/trans-callback.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c
index 3f1aee6..7816bd1 100644
--- a/libnetfs/trans-callback.c
+++ b/libnetfs/trans-callback.c
@@ -67,7 +67,10 @@ _netfs_translator_callback2_fn (void *cookie1, void 
*cookie2, int flags,
 
   po = netfs_make_peropen (node, flags, cookie2);
   if (! po)
-return errno;
+{
+  iohelp_free_iouser (user);
+  return errno;
+}
 
   cred = netfs_make_protid (po, user);
   if (cred)
@@ -79,6 +82,7 @@ _netfs_translator_callback2_fn (void *cookie1, void *cookie2, 
int flags,
 }
   else
 {
+  netfs_release_peropen (po);
   iohelp_free_iouser (user);
   return errno;
 }
-- 
2.7.1




Re: [PATCH] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread James Clarke
> On 7 Feb 2016, at 23:10, Samuel Thibault  wrote:
> Flávio Cruz, on Sun 07 Feb 2016 23:57:25 +0100, wrote:
>> Maybe here we should do it as follows:
>> 
>> err = errno;
>> netfs_release_peropen (po);
>> iohelp_free_iouser (user);
>> return err;
> 
> Yes, you never know what they could be doing to errno.
> 
> Samuel

Does that include changing

>   po = netfs_make_peropen (node, flags, cookie2);
>   if (! po)
> -return errno;
> +{
> +  iohelp_free_iouser (user);
> +  return errno;
> +}

to

>   po = netfs_make_peropen (node, flags, cookie2);
>   if (! po)
> -return errno;
> +{
> +  err = errno;
> +  iohelp_free_iouser (user);
> +  return err;
> +}

or can we assume the free functions don’t set errno?

James


signature.asc
Description: Message signed with OpenPGP using GPGMail


[PATCH v2] Fixed leaks in _netfs_translator_callback2_fn

2016-02-07 Thread James Clarke
* libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Fixed leaking
iouser and peropen structs on error.
---
 libnetfs/trans-callback.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c
index 3f1aee6..ed21aa2 100644
--- a/libnetfs/trans-callback.c
+++ b/libnetfs/trans-callback.c
@@ -67,7 +67,11 @@ _netfs_translator_callback2_fn (void *cookie1, void 
*cookie2, int flags,
 
   po = netfs_make_peropen (node, flags, cookie2);
   if (! po)
-return errno;
+{
+  err = errno;
+  iohelp_free_iouser (user);
+  return err;
+}
 
   cred = netfs_make_protid (po, user);
   if (cred)
@@ -79,8 +83,10 @@ _netfs_translator_callback2_fn (void *cookie1, void 
*cookie2, int flags,
 }
   else
 {
+  err = errno;
+  netfs_release_peropen (po);
   iohelp_free_iouser (user);
-  return errno;
+  return err;
 }
 }
 
-- 
2.7.1




Re: Coppyright assignment (was: RFC: Lightweight synchronization mechanism for gnumach)

2016-03-03 Thread James Clarke
> On 3 Mar 2016, at 14:47, Justus Winter <4win...@informatik.uni-hamburg.de> 
> wrote:
> Quoting Samuel Thibault (2016-02-28 22:29:52)
>> We'll probably want to have a copyright assignement from you for this
>> work.  I have pasted below the form for this.  If you're to contribute
>> more to GNU/Hurd, it'd be useful that you already assign copyright for
>> GNUMACH, HURD, GLIBC.
> 
> You forgot MIG.

Unless it’s changed since I assigned copyright last year, MIG is an individual 
project and you can’t assign copyright for it.

James


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: gnumach 1.7 issue

2016-06-04 Thread James Clarke
> On 3 Jun 2016, at 19:36, Samuel Thibault  wrote:
> 
> Samuel Thibault, on Fri 03 Jun 2016 20:35:13 +0200, wrote:
>> Adam Richards, on Fri 03 Jun 2016 19:30:40 +0100, wrote:
>>> On rebooting and reverting to  gnumach-1.6-486.gz this is not an issue.
>> 
>> It could be worth bisecting the issue on the upstream git repository.
> 
> (there are really not much difference between the last 1.6 snapshot
> 2:1.6+git20160502-1 and the 1.7 snapshot 2:1.7+git20160522-1)

1.7 seems to break running Xorg for me (running latest MATE). I can’t
move the mouse, opening htop via ssh hangs at a black screen, and then
subsequent ssh attempts can’t connect, so I have to perform a hard
reboot. If I don’t send *any* mouse events, htop loads, but locks up
as soon as I move the mouse. MATE’s clock does continue to update every
second, so some things still work. Booting 1.6+git20160502 instead works
fine.

Looking at the changes[1], some variables types have been changed (many
int -> unsigned, and a few int -> dev_t in xen/console.{c,h}), but I
doubt that’s it. My guess is that it’s one of:

* b4d07d3 Fix pageout deadlock
* 1db202e vm_map: back allocations with a red-black tree

I shall try building a kernel with 1db202e reverted.

James

[1] 
https://anonscm.debian.org/cgit/pkg-hurd/gnumach.git/commit/?id=8d63d9c0d3b84e8496248093ce333c959fe985c9



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: gnumach 1.7 issue

2016-06-04 Thread James Clarke
> On 4 Jun 2016, at 15:04, James Clarke  wrote:
> 
>> On 3 Jun 2016, at 19:36, Samuel Thibault  wrote:
>> 
>> Samuel Thibault, on Fri 03 Jun 2016 20:35:13 +0200, wrote:
>>> Adam Richards, on Fri 03 Jun 2016 19:30:40 +0100, wrote:
>>>> On rebooting and reverting to  gnumach-1.6-486.gz this is not an issue.
>>> 
>>> It could be worth bisecting the issue on the upstream git repository.
>> 
>> (there are really not much difference between the last 1.6 snapshot
>> 2:1.6+git20160502-1 and the 1.7 snapshot 2:1.7+git20160522-1)
> 
> 1.7 seems to break running Xorg for me (running latest MATE). I can’t
> move the mouse, opening htop via ssh hangs at a black screen, and then
> subsequent ssh attempts can’t connect, so I have to perform a hard
> reboot. If I don’t send *any* mouse events, htop loads, but locks up
> as soon as I move the mouse. MATE’s clock does continue to update every
> second, so some things still work. Booting 1.6+git20160502 instead works
> fine.
> 
> Looking at the changes[1], some variables types have been changed (many
> int -> unsigned, and a few int -> dev_t in xen/console.{c,h}), but I
> doubt that’s it. My guess is that it’s one of:
> 
> * b4d07d3 Fix pageout deadlock
> * 1db202e vm_map: back allocations with a red-black tree
> 
> I shall try building a kernel with 1db202e reverted.

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.

James



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [PATCH] LwIP translator

2017-08-24 Thread James Clarke
Hi Joan,

On 24 Aug 2017, at 18:49, Joan Lledó  wrote:
> ...
> diff --git a/config.make.in b/config.make.in
> index dfbf0c1..f74220e 100644
> --- a/config.make.in
> +++ b/config.make.in
> @@ -99,6 +99,13 @@ HAVE_SUN_RPC = @HAVE_SUN_RPC@
> # Whether we found libgcrypt.
> HAVE_LIBGCRYPT = @HAVE_LIBGCRYPT@
> 
> +# Whether we found libgcrypt.

Copy-paste error :)

James




Re: [PATCH] eth-multiplxer: Implement ds_device_close()

2017-09-20 Thread James Clarke
On 20 Sep 2017, at 11:08, Joan Lledó  wrote:
> 
> ---
> eth-multiplexer/Makefile  | 2 +-
> eth-multiplexer/device_impl.c | 5 +
> 2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/eth-multiplexer/Makefile b/eth-multiplexer/Makefile
> index cefa0abd..2b19de6d 100644
> --- a/eth-multiplexer/Makefile
> +++ b/eth-multiplexer/Makefile
> @@ -29,6 +29,6 @@ LCLHDRS = ethernet.h util.h vdev.h netfs_impl.h
> HURDLIBS = ports ihash iohelp fshelp shouldbeinlibc netfs bpf
> LDLIBS = -lpthread
> 
> -CFLAGS += -I$(top_srcdir)/libbpf
> +CFLAGS += -I$(top_srcdir)/libbpf -ggdb -O0

I don't think you meant to include this hunk? :)

James




Re: [PATCH] LwIP translator

2017-12-18 Thread James Clarke
On 18 Dec 2017, at 16:28, Samuel Thibault  wrote:
> Joan Lledó, on lun. 18 déc. 2017 17:10:42 +0100, wrote:
>> 2017-12-18 14:46 GMT+01:00 Samuel Thibault :
>>> We need to know what is not yet in upstream, what will
>>> eventually get to upstream, and what may not get to
>>> upstream.
>> 
>> There're also some patches that are in upstream, I think it would be
>> simpler for me to first upgrade liblwip to 2.0.3 and then take that
>> version as start point to create the list of pending patches.
> 
> Ok.  In the meanwhile I have prepared an upload for lwip to Debian, I
> have borrowed some code I could find in your tree and hacked a bit, see 
> 
> git clone https://anonscm.debian.org/collab-maint/lwip.git

You missed the initial /git/ there (and in Vcs-Git). Also there's already
src:lwipv6 in the archive which last saw an upload in 2012, so might be worth
unifying them if possible (it seems to be a fork from a while ago[1], probably
before IPv6 was added upstream).

Regards,
James

[1] https://sourceforge.net/p/view-os/code/HEAD/tree/trunk/lwipv6/




Re: [PATCH] LwIP translator

2017-12-18 Thread James Clarke
On 18 Dec 2017, at 17:09, Samuel Thibault  wrote:
> James Clarke, on lun. 18 déc. 2017 17:06:28 +, wrote:
>> On 18 Dec 2017, at 16:28, Samuel Thibault  wrote:
>>> Joan Lledó, on lun. 18 déc. 2017 17:10:42 +0100, wrote:
>>>> 2017-12-18 14:46 GMT+01:00 Samuel Thibault :
>>>>> We need to know what is not yet in upstream, what will
>>>>> eventually get to upstream, and what may not get to
>>>>> upstream.
>>>> 
>>>> There're also some patches that are in upstream, I think it would be
>>>> simpler for me to first upgrade liblwip to 2.0.3 and then take that
>>>> version as start point to create the list of pending patches.
>>> 
>>> Ok.  In the meanwhile I have prepared an upload for lwip to Debian, I
>>> have borrowed some code I could find in your tree and hacked a bit, see 
>>> 
>>> git clone https://anonscm.debian.org/collab-maint/lwip.git
>> 
>> You missed the initial /git/ there (and in Vcs-Git).
> 
> It looks like dh-make is bogus then, that's what set this URL.

*sigh* Fixed in 2016, but no upload yet[1] (also [2] more recently).
I will ping the bug...

James

[1] 
https://anonscm.debian.org/cgit/collab-maint/dh-make.git/commit/?id=8bc8e0fab2f8293f8946e51768802532a6470d7f
[2] 
https://anonscm.debian.org/cgit/collab-maint/dh-make.git/commit/?id=b5a2903efa716e898c141397a6e471ec6fd9febb




Re: Glibc port: commit clenup

2018-02-17 Thread James Clarke
On 17 Feb 2018, at 23:40, Svante Signell  wrote:
> On Sat, 2018-02-17 at 22:59 +0100, Samuel Thibault wrote:
>> Hello,
>> 
>> Anatoly A. Kazantsev, on jeu. 25 janv. 2018 21:39:44 +1300, wrote:
>>> Next branches I will work on are:
>>> 
>>> - t/pagesize
>> 
>> I have completely changed the fix there, and commited upstream.
> 
> Maybe I can try to help out here after being AFK for a month. Where is
> upstream? Noting visible at
> http://git.savannah.gnu.org/cgit/hurd/glibc.git/
> except your commit??

That's still the Hurd fork; upstream is [0].

James

[0] https://sourceware.org/git/?p=glibc.git




Re: Samuel: Do you have permission to _enable_ the gccgo patches again?

2018-03-26 Thread James Clarke
On 26 Mar 2018, at 18:20, Svante Signell  wrote:
> On Mon, 2018-03-26 at 19:06 +0200, Samuel Thibault wrote:
>> Svante Signell, on lun. 26 mars 2018 18:50:20 +0200, wrote:
>>> I just saw:
>>> https://anonscm.debian.org/viewvc/gcccvs?view=revision&revision=10084
>>> 
>>> This is really a large step BACK:
>> 
>> It's not a step back, it's just fixing something that is completely
>> wrong.
> 
> What is really wrong is that Matthias Klose removed the Hurd patches. Adding
> them back is a piece of cake for you (or him), see #894080.
> 
> Next step is to send them to golang-dev for upstream adoption. gcc-patches 
> seems
> to be a null sink. Sending patches there gives no reply whatsoever: Recent
> examples gdb and gccgo.

The best place for them is https://go-review.googlesource.com against 
go-frontend.

James




Re: Enable SMP support

2018-06-08 Thread James Clarke
On 8 Jun 2018, at 18:06, Joshua Branson  wrote:
> 
> Almudena Garcia  writes:
> 
>> Hi all:
>> 
>> Reading this post in Hurd FAQ, I read that Mach has SMP support, but It was 
>> disabled because the Linux device drivers glue code isn't thread-safe.
>> 
>> https://www.gnu.org/software/hurd/faq/smp.html
>> 
>> Then, I ask . Are there any form to enable this SMP support in GNU Mach? (At 
>> my own risk).
>> 
>> I would like to test it.
>> 
>> P.D.: It's only a curiosity, not an urgency
> 
> That actually sounds like really fun!  haha.  I bet it would involve
> diving into the mach code...I believe that the Hurd currently uses
> drivers from linux via DDE.  A lot of that code was shoved into
> GNU/Mach.  You'd have to pull it out, or find the commandline option to
> not compile it in...but I don't know how to do it.

From gnumach's configfrag.ac:

> # Multiprocessor support is still broken.
> AH_TEMPLATE([MULTIPROCESSOR], [set things up for a uniprocessor])
> mach_ncpus=1
> AC_DEFINE_UNQUOTED([NCPUS], [$mach_ncpus], [number of CPUs])
> [if [ $mach_ncpus -gt 1 ]; then]
>   AC_DEFINE([MULTIPROCESSOR], [1], [set things up for a multiprocessor])
> [fi]

So enabling it is just a case of tweaking that constant or making it a
configurable option.

James




Re: Error with gnumach compilation

2019-02-15 Thread James Clarke
On 15 Feb 2019, at 13:21, Samuel Thibault  wrote:
> 
> Almudena Garcia, le ven. 15 févr. 2019 14:13:17 +0100, a ecrit:
>> This is defined in imps/cpu_number.h , included in kern/cpu_number.h
> 
> cswitch.S includes i386/cpu_number.h, not kern/cpu_number.h
> 
> Really, make sure it gets defined, that's very most probably the issue,
> or else it's the CPU_NUMBER macro which is not actually valid assembly.

Well, I had checked before sending my email, and i386/cpu_number.h does not
define CPU_NUMBER, though I was unaware of kern/cpu_number.h. The latter does
define a cpu_number function, but it's a C header, not for use in assembly.
Your `smp` branch fixes this in [1] by making CPU_NUMBER a macro that calls
cpu_number (though I might suggest that you make the macro do nothing for
NCPUS==1). Honestly, this is not a hard bug to find, it took all of a few
minutes for me. You've had more than enough information from us to pinpoint the
problem; this mailing list is really not for simple programming questions like
this.

James

[1] 
https://github.com/AlmuHS/GNUMach_SMP/commit/371df36e565f4408737948ccc3d25acf2e1ccb57


Re: Error with gnumach compilation

2019-02-15 Thread James Clarke
On 15 Feb 2019, at 13:33, Almudena Garcia  wrote:
> El vie., 15 feb. 2019 a las 14:28, James Clarke () 
> escribió:
>> On 15 Feb 2019, at 13:21, Samuel Thibault  wrote:
>> > 
>> > Almudena Garcia, le ven. 15 févr. 2019 14:13:17 +0100, a ecrit:
>> >> This is defined in imps/cpu_number.h , included in kern/cpu_number.h
>> > 
>> > cswitch.S includes i386/cpu_number.h, not kern/cpu_number.h
>> > 
>> > Really, make sure it gets defined, that's very most probably the issue,
>> > or else it's the CPU_NUMBER macro which is not actually valid assembly.
>> 
>> Well, I had checked before sending my email, and i386/cpu_number.h does not
>> define CPU_NUMBER, though I was unaware of kern/cpu_number.h. The latter does
>> define a cpu_number function, but it's a C header, not for use in assembly.
>> Your `smp` branch fixes this in [1] by making CPU_NUMBER a macro that calls
>> cpu_number (though I might suggest that you make the macro do nothing for
>> NCPUS==1). Honestly, this is not a hard bug to find, it took all of a few
>> minutes for me. You've had more than enough information from us to pinpoint 
>> the
>> problem; this mailing list is really not for simple programming questions 
>> like
>> this.
>> 
>> James
>> 
>> [1] 
>> https://github.com/AlmuHS/GNUMach_SMP/commit/371df36e565f4408737948ccc3d25acf2e1ccb57
> 
> I removed this macro tonight, to write a better solution.
> 
> https://github.com/AlmuHS/GNUMach_SMP/commit/342b7d62168bcaca944d01c0550b899da5d7f0c5
> 
> I've got to enabled correctly this macro, and feels that CPU_NUMBER assembly 
> macro is enabled, but compiler shows another error
> 
> ../i386/i386/cswitch.S: Mensajes del ensamblador:
> ../i386/i386/cswitch.S:46: Error: operandos inválidos (secciones *UND* y 
> *UND*) para «+»
> ../i386/i386/cswitch.S:64: Error: operandos inválidos (secciones *UND* y 
> *UND*) para «+»
> ../i386/i386/cswitch.S:116: Error: operandos inválidos (secciones *UND* y 
> *UND*) para «+»

This is now getting really tiring. It's complaining about both operands to +
being undefined, on lines where you're using CPU_NUMBER. CPU_NUMBER is defined
by you as:

#define CPU_NUMBER(reg) \
movzbl  APIC_LOCAL_VA+APIC_LOCAL_UNIT_ID+3,reg

Which of those operands for + look like they could be undefined symbols to you?
Seriously, you need to learn to fix these things for yourself.

James




Re: mapped-time interface

2019-07-19 Thread James Clarke
On 19 Jul 2019, at 23:15, Almudena Garcia  wrote:
> 
> Forwarded to bug-hurd maillist 
> 
> -- Forwarded message -
> De: Andrew Eggenberger 
> Date: vie., 19 jul. 2019 a las 20:11
> Subject: mapped-time interface
> To: 
> 
> 
> This gnu Mach reference manual page [1] refers to a “mapped-time interface” 
> for accessing the current time. A type is given and a usage example, but I 
> haven’t found a way to get a pointer to the value. Am I missing something? Is 
> the interface not available in user space?

See hurd's libshouldbeinlibc/maptime.[ch]; it's exposed through /dev/time and/or
the "time" mach device.

James

> 
> 1: https://www.gnu.org/software/hurd/gnumach-doc/Host-Time.html
> -- 
> Andrew Eggenberger




Re: [PATCH 3/4] pci-arbiter: Fix a -Wstringop-truncation warning

2019-11-03 Thread James Clarke
On 3 Nov 2019, at 16:20, Samuel Thibault  wrote:
> 
> Hello,
> 
> Joan Lledó via Bug reports for the GNU Hurd, le dim. 03 nov. 2019 10:38:28 
> +0100, a ecrit:
>> * pci-arbiter/pcifs.c:
>>* create_dir_entry:
>>  Limit to NAME_SIZE-1 when calling strncpy().
>>  Finish entry->name with '\0'.
>>* create_fs_tree:
>>  memset() to 0 the directory entry.
>>  Limit to NAME_SIZE-1 all calls to
>>   snprintf() and strncpy().
> 
> Applied, thanks!
> 
>> @@ -206,7 +208,7 @@ create_fs_tree (struct pcifs * fs)
>>e_stat = list->stat;
>>e_stat.st_mode &= ~S_IROOT;   /* Remove the root mode */
>>memset (entry_name, 0, NAME_SIZE);
>> -  snprintf (entry_name, NAME_SIZE, "%04x", device->domain);
>> +  snprintf (entry_name, NAME_SIZE - 1, "%04x", device->domain);
> 
> Perhaps replace the whole memset with just setting
> entry_name[NAME_SIZE-1] = 0
> ? and ditto below.

snprintf guarantees NUL termination, so this now over-truncates.

James




Re: Hurd user survey

2000-03-07 Thread James Gibson




>From: Gordon Matzigkeit <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
>Subject: Hurd user survey
>Date: 06 Mar 2000 11:48:12 -0600
>
>I'm taking an informal survey of people who use the Hurd, to get some
>idea of how things are progressing.  Please reply to me privately, or
>to [EMAIL PROTECTED] as appropriate.
>
>1) Have you successfully gotten the Hurd running?
>
Yes.
>2) If so, is your Hurd box currently running as you expect it to?
>
Yes-- but then again, I don't have it connected to a network, and I expect 
to run out of swap after a few hours of compiling.

>3) If it is not running, what appears to be the problem?
>
>I'll post the results after a week or so has elapsed,
>
A question-- would it be helpful to ask for some config information along 
with the survey, so you could correlate the successes and failures with the 
system their running on?

For the record, here's mine:
hurd-2130
P-166, 64MB physical, 150MB swap, Hurd on 540MB partition

James

__
Get Your Private, Free Email at http://www.hotmail.com



RE: GRUB problem installing menu.lst when e2fs_stage1_5 is present

2001-02-19 Thread James Franklin

Hi folks,
 I have rerun the test below twice with the following solution and learned
something interesting. It is possible to enter e2fs_stage1_5 and use
menu.lst by using the following method. As it works now it is not possible
to install GRUB in the hd0 with stage1, stage2, e2fs_stage1_5 and menu.lst
all at the same time. First run the GRUB install with stage1, stage2 and
menu.lst in the /boot/grub/ partitition from the boot floppy containing
stage1 and stage2. The install will verify that stage1, stage2 and menu.lst
have been installed in /grub/ (remember I am using a 10Meg partition for a
boot partition so it is recognized by GRUB as the root (hd0,5)in this case
rather than as /boot/). Then reboot and the boot screen appears. Boot into
the OS containing your GRUB program. Copy e2fs_stage1_5 into the /boot/grub/
directory. In the next step you need to reboot with the GRUB floppy in place
or as I do with a section of menu.lst that allows you to reinstall GRUB from
the boot screen. A copy of that section of menu.lst is given below:

# for installing the GRUB bootloader in the MBR
title=Install the GRUB bootloader in the MBR(DANGEROUS)
pause=Esc to exit, Enter to continue...
root=(hd0,5)
setup (hd0)

You will recieve verification from the program that stage1, stage2 and
e2fs_stage1_5 have been installed. On reboot the boot screen appears even
though there was no verification that it was indeed installed in the
previous step.

Jim

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of James Franklin
Sent: Saturday, February 17, 2001 12:57 AM
To: [EMAIL PROTECTED]
Subject: GRUB problem installing menu.lst when e2fs_stage1_5 is present


Hi folks,
 I was installing GRUB 0.5.96.1 on my new setup. This is a couple of 30 Gig
IDE hard drives. The main debian GNU/Linux OS that I am installing GRUB from
is located in the first 1024 cylinders so that is not a consideration. I
have a boot floppy with stage1 and stage2 on it. The installation is from a
/boot partition ~10M in size. Since I am installing from a /boot partition,
when installing with setup (hd0) GRUB recognizes /grub/stage1,
/grub/e2fs_stage1_5, and /grub/stage2 and ends by telling me that
installation succeeded. Reboot and the grub prompt returns rather than the
boot screen. Reboot again and the grub prompt returns again rather than the
boot screen.
 To check that the error is repeatable I reinstalled grub using the same
procedure above. Rebooting twice I received the same results as above again.
 I manually booted into the main debian GNU/Linux OS and removed
e2fs_stage1_5 from /boot/grub/.
I rebooted and reinstalled GRUB with the above procedure. Installing with
setup (hd0) GRUB recognizes /grub/stage1, and /grub/stage2 and ends by
telling me that installation succeeded. On reboot the boot screen appears
and I can boot into any of the OSes I wish.
 Has anyone come up against this problem as well?
 Could someone forward a copy of this to the grub mail list for me as I am
not currently a member of that mail list.

Jim


___
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd


___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



/include/bits/sigaction.h:35: parse error

2001-09-20 Thread James Morrison

  Hi,
   I tried to compile uw-imap today and go this error:
/include/bits/sigaction.h:35: parse error before siginfo_t

the section is

union { 
  __sighandler_t sa_handler;
  void (*sa_sigaction)(int,siginfo_t *, void *);
} __sigaction_handler


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op

__
Terrorist Attacks on U.S. - How can you help?
Donate cash, emergency relief information
http://dailynews.yahoo.com/fc/US/Emergency_Information/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: I'm a bit pouched

2001-09-23 Thread James Morrison


--- Marcus Brinkmann <[EMAIL PROTECTED]> wrote:
> On Sat, Sep 22, 2001 at 10:15:52AM -0700, James Morrison wrote:
> >   Here is the error I am getting on boot: 
> > 
> > 1 multiboot modules   
> 
> You get this?  I get
> 
> Loading single multiboot module in compat mode: /boot/serverboot.gz
> 

I'm not sure what actually happend, but I got the serverboot.gz off
the F2 cd and used it and it works.  I did notice a size difference
in the modules though.

242210 /boot/serverboot.broken.gz
239520 /boot/serverboot.gz



=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



More about being pouched

2001-09-23 Thread James Morrison


 Well, I had another severe crash, this time from the ext2fs
translater dying.  Again I could not use serverboot.gz as a module. 
I got the same error as before.  However, I was able to use the F2 cd
again and fsck the filesystem.  Then voila both my original
serverboot and the one from
the F2 cd worked.  My question is why this would happen?  serverboot
is only used on boot right?  So how would it change while the system
is running? 


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



I'm a bit pouched

2001-09-22 Thread James Morrison

  Here is the error I am getting on boot: 

1 multiboot modules   
 [I press a key(enter)]
Kernel page fault at address 0x0, eip = 0x11ad88
kernel Page fault trap, eip 0x11ad88
kernel trap, type 13, code 0
Dump of i386_saved_state 002a1c80:
EAX 002a226c EBX 002a226c ECX ...
 nothing appears if I do not touch the keyboard. 

I am now getting this error after my proc server crashed and took
down the system.  I don't know how many processes I had had but
I'm sure it was fairly large since I compiled most of mh, and
heimdal.
and bunches other stuff.  I also had around 6 days uptime.

I have upgraded gnumach and hurd since I last rebooted.  Could
this be causing my problem?
hw config: Pentium 200 MMX   1 3c509 NIC
   1 TLAN NIC
32 megs of ram.



=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op

__
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: Cannot su or sudo

2001-10-25 Thread James Morrison


 I have had this problem.  Marcus said pflocal is messed.  If you 
login as root, kill pflocal then restart the translator it should
work 
again.

 I think su similar to the linux su since it doesn't directly talk
to the auth server yet, IIRC.

--- Jeff Bailey <[EMAIL PROTECTED]> wrote:
> While I'm waiting for the other problems to recur, I've got another
> fun one:
> 
> buildd@hurd:~$ su
> Password:
> (Wait forever)
> 
> ^C still works.
> 
> buildd@hurd:~$ gdb su
> GNU gdb 5.0.90-cvs (MI_OUT)
> Copyright 2001 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License,
> and you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "i386-unknown-gnu0.2"...
> (no debugging symbols found)...
> (gdb) run
> Starting program: /usr/bin/su 
> Can't fetch registers from thread 3: No such thread
> (gdb) info threads
> Segmentation fault
> buildd@hurd:~$ 
> 
> 
> I can't set a breakpoint on main...  Perhaps my gdb is screwed up.
> I'll try building a new one tommorow.
> 
> `Oskuro' reported the same problem earlier today, so I suspect it's
> probably eventually reproducable.  I noticed it when the build hung
> on
> an sudo.
> 
> I don't actually know what happens during an 'su' on the Hurd, so
> I'm
> not sure what to check after this.
> 
> I just checked: From the console I can login as root, and I can
> login
> as buildd.  However, I cannot su - so I don't think this is just my
> ssh session that's screwed up.  I'll try to leave the box in this
> state for as longas I can.  If it's just gdb screwing up, maybe a
> new
> one will tell me more.
> 
> I'll keep you posted.
> 
> -- 
> Abandon the search for truth; settle for a good fantasy.
> 
> 
> 
> 
> ___
> Bug-hurd mailing list
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/bug-hurd


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



tail -f seg faults

2001-10-31 Thread James Morrison

When I have 'tail -f /var/log/apache/access_log' going then
ssh
into a box tail seg faults.

Here is the output from gdb:

Program received signal EXC_BAD_ACCESS, Could not access memory.
[Switching to thread 18009.2]
0x010bd983 in stpcpy () from /lib/libc.so.0.2
(gdb) info stack
#0  0x010bd983 in stpcpy () from /lib/libc.so.0.2
#1  0x0106bb0c in _hurd_port_cleanup () from /lib/libc.so.0.2
#2  0x0106c315 in _S_msg_report_wait () from /lib/libc.so.0.2
#3  0x011bbc37 in pfinet_siocgifconf () from /lib/libhurduser.so.0.0
#4  0x011bbe07 in _S_msg_server () from /lib/libhurduser.so.0.0
#5  0x01056fb9 in get_privileged_ports () from /lib/libc.so.0.2
#6  0x0104b52b in mach_msg_server_timeout () from /lib/libc.so.0.2
#7  0x0104b614 in mach_msg_server () from /lib/libc.so.0.2
#8  0x0105705b in get_privileged_ports () from /lib/libc.so.0.2
(gdb)

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: tail -f seg faults

2001-10-31 Thread James Morrison


--- Roland McGrath <[EMAIL PROTECTED]> wrote:
> Please install a version of libc with debugging symbols (libc-dbg
> package),
> and then show "bt" in gdb.
> 

Ok, I'll do that.  Now for a larger problem: after getting the stack
I tried taking a couple steps through tail. One my second 'next'
gdb froze.  It is no longer taking keyboard signals C-c or C-\ and
I can't change screens to try externel signals.  My system seems to
be up, but I can't use it.

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Python2.1

2001-11-01 Thread James Morrison

 I have got python2.1 to compile with cthreads enabled, however, when
I try to use said binary, it seg faults.  Here is backtrace:

Program received signal SIGSEGV, Segmentation fault.
__libc_calloc (n=1, elem_size=20) at malloc.c:3832
3832malloc.c: No such file or directory.
in malloc.c
(gdb) bt
#0  __libc_calloc (n=1, elem_size=20) at malloc.c:3832
#1  0x0108b2e5 in PyThread_allocate_lock () at
Python/thread_cthread.h:112
#2  0x010864e5 in PyInterpreterState_New () at Python/pystate.c:36
#3  0x01086be7 in Py_Initialize () at Python/pythonrun.c:108
#4  0x0108c736 in Py_Main (argc=3, argv=0x1025c30) at
Modules/main.c:275
#5  0x08048654 in main (argc=3, argv=0x1025c30) at
Modules/python.c:10
#6  0x0112920b in __libc_start_main (main=0x8048640 , argc=3,
ubp_av=0x1025c30, init=0x80484a4 <_init>, fini=0x80486b0 <_fini>,
rtld_fini=0xca7070 <_dl_fini>, stack_end=0x1025c2c)
at ../sysdeps/generic/libc-start.c:129
(gdb)

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



My understanding of python2.1 and cthreads

2001-11-02 Thread James Morrison

Hello,
I've been trying to get python2.1 to run on GNU/Hurd with
cthreads
enabled.  python1.5 'worked' with cthreads on GNU/Hurd.  However,
python2.1
tries to use threads on startup if they are available.  One of the
very first
things python2.1 does is try to allocate a lock.  When allocating 
this lock
it checks if threads are initialized or not.  They are not so
cthread_init()
is run then mutex_alloc() is run.  calling mutex_alloc() is a macro
for
calloc(1,sizeof(struct mutex_t)).  Somewhere in calling calloc the
program
seg faults.  I seeing what happens when I do not run cthread_init();


I have made a simple program that does what I think python2.1
is
doing but it has no problems.

The back trace has not changed from my posting yesterday.

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



sethostname()

2001-11-03 Thread James Morrison

 It seems anytime I use sethostname(), in hostname or in my own
program.

int main() {
  sethostname("me",3);
  printf("%i:%s\n",errno,strerror(errno));
}

sethostname always returns bad file descriptor.

I've got python2.1 working, I didn't link to threads at the right
place.  Now I've got python2.2 going ;)

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



What I know of sethostname()

2001-11-03 Thread James Morrison


Hello,
from what I can get from the sources and gdb

sethostname(name,len) calls
_hurd_set_host_config("/etc/hostname",name,len)

then
_hurd_set_host_config gets the port of /etc, creates a port
for
hostname if neccesary, or gets the old port for
/etc/hostname.
Then __io_write is called, with as (new,name,len,0,&nwrote)
I noticed nwrote a mach_msg_type_number_t didn't change from
before io_write was called and after.  Also it's this
io_write
that is finding the bad file descriptor.  I haven't found the
sources for the __io_write function yet.  This __io_write
finds a bad file descriptor no matter if /etc/hostname exists
or
not.

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



heimdal on GNU HURD

2001-09-28 Thread James Morrison

  I'm posting this message from a heimdal developer to bug-hurd
for discussion on the topic of HOST_NAME_MAX.  I don't have a 
draft of POSIX so I can't verify this.

  However, your 1st note is something I don't agree with.  For
example
MAXPATHLEN is defined on many systems, but is not the best way
to find the limitations of the system because different filesystems
could have different limits.  For example if a GNU/Linux system
has an nfs filesystem mounted from a GNU/Hurd system or any system
with a larger MAXPATHLEN, the program would break when retrieving
a file off the nfs mount when it really shouldn't.  This is a 
simple plee for the use of pathconf. 

  A note on defined constants, I think FILENAME_MAX is too small on
GNU/Hurd at only 1024.  I think something large, as implied by the
documentation of glibc, like 65667 should be used.  


--- "Jacques A. Vidrine" <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Thanks for the report.  I do not think the answer is to add a new
> API.
> 
> Almost  all  versions of  UNIX  specify  MAXHOSTNAMELEN (see 
> [Stevens
> UNPv1]).  The Hurd probably should, too.
> 
> Regardless,  the next  version of  POSIX specifies  HOST_NAME_MAX. 
> We
> should probably  be using  HOST_NAME_MAX instead of  MAXHOSTNAMELEN
> in
> the Heimdal sources, or at least do something such as
> 
>  #if !defined(MAXHOSTNAMELEN) && defined(HOST_NAME_MAX)
>  #define MAXHOSTNAMELEN HOST_NAME_MAX
>  #endif
> 
> IMHO a system that defines neither MAXHOSTNAMELEN nor HOST_NAME_MAX
> is
> broken [1].
> 
> Cheers,
> -- 
> Jacques A. Vidrine <[EMAIL PROTECTED]>  
> http://www.nectar.com/
> Verio Web Hosting   =  FreeBSD UNIX  =Heimdal
> Kerberos
> [EMAIL PROTECTED]  =   [EMAIL PROTECTED]   =  
> [EMAIL PROTECTED]
> 
> [1]  I'm ignoring  the  fact that  HOST_NAME_MAX is  one  of the 
> many
> `possibly  indeterminate  run-time   invariant  values'.   Any 
> system
> designer  that requires  use  of sysconf()  for  such basic 
> constants
> should be drawn-and-quartered :-)
> 
> [Stevens UNPv1] Stevens, W. Richard. _Unix Network Programming
> Volume 1, 2nd Edition_.  Upper Saddle River, NJ: Prentice Hall,
> 1998.  Of course :-)
> 
> On Fri, Sep 28, 2001 at 11:15:01AM +1000, Brian May wrote:
> > Hello,
> > 
> > I received this bug report against Heimdal, with patches
> > that will allow it to compile on the Hurd.
> > 
> > I suggested that putting xgethostname in libroken but be more
> > appropriate then libkrb5, but apart from that everything else
> looks
> > OK (not tested thoroughly yet, as I do not have the latest
> automake
> > required).
> > 
> > Thanks.
> > -- 
> > Brian May <[EMAIL PROTECTED]>
> 
> > Date: Sun, 23 Sep 2001 20:16:27 -0700 (PDT)
> > From: James Morrison <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: Bug#113317: [patch] heimdal on GNU HURD
> > Delivered-To: [EMAIL PROTECTED]
> > Delivered-To: [EMAIL PROTECTED]
> > 
> > PACKAGE: heimdal
> > VERSION: 0.4c-2
> > SEVERITY: important
> > 
> >  This patch removes the need for MAXHOSTNAMELEN by using the
> > function xgethostname by Neal Walfield.  Removing MAXHOSTNAMELEN
> > and conditionalizing the use of ARG_MAX, which is not defined on
> GNU
> > (HURD), allows heimdal to compile on GNU (HURD).
> > 
> >  xgethostname is not in the patch, but a separate attachment.
> > I but it in lib/krb5.  In the patch xgethostname is excepted to
> > be in lib/krb5 because I have added it to Makefile.am
> > 
> > 
> > =
> > James Morrison
> >University of Waterloo
> >Computer Science - Digital Hardware
> >2A co-op
> > 
> > __
> > Do You Yahoo!?
> > Get email alerts & NEW webcam video instant messaging with Yahoo!
> Messenger. http://im.yahoo.com
> 
> 
> 
> 
> 


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op

__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



snprintf

2001-11-28 Thread James Morrison

 Hello,
I've noticed that on GNU/Hurd snprintf doesn't work if
the expanded template exceeds the size given.

eg
char limited[5];
snprintf(limited,5,"12345");

On GNU/Linux with libio snprintf sets limited to "1234" and returns
5.

This same code on GNU/Hurd with stdio sets limited[0] to '\0'
but does not touch any other characters.  snprintf returns 5
on GNU/Hurd as well.

If the template string is extended the results say the same with the
return value changing appropriatly. snprintf works fine on GNU/Hurd
if the resulting string is less than maxsize passed to snprintf.

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: ssh as user: setrlimit failed

2001-10-07 Thread James Morrison

--- Roland McGrath <[EMAIL PROTECTED]> wrote:
> > For now at least for RLIMIT_CORE I think we should just accept
> any hard
> > maximum.  However, to implement core dumps would that be a core
> server
> > that actually implemented limits on core sizes and such?
>
> Yes.  If the limit is zero, then you don't call the crash server at
> all (we
> don't call it the "core server" because then we'd want to use names
> like
> /servers/core and /hurd/core, and we're afraid of well-meaning cron
> jobs).
> For a limit of another finite size, it's just like the RLIMIT_FSIZE
> limits
> that we also don't implement--it would be arranged somehow with the
> filesystem server.
>
Well, now I know something else the crash server does ;)

Ok, but what you said, it seems you have to tell the crash server it
should
allow core dumps as opposed to a core dump, which is not implemented,
being
the normal case.

 It would be nice for this to be implemented but I know I'm no where
near
touching the crash server yet.

 Off the current topic I've been looking at the symlink server
recently
and there are two mach_port_t 's that I noticed.  One is realnode and
the
other is realnodenoauth.  What is the difference between these port_t's.

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: ports in symlink server

2001-10-08 Thread James Morrison


Thanks for the help, The filemux translator is now available on my
website.  It's basically symlink with the options to randomly choose
files or sequencially choose files.  I'm having trouble attaching gdb
to the translator for some reason.  I can attach gdb to the process
but I can't seem to use the translator when gdb is attached.

I've been looking through the processes run when hurd boots and I
have
a process with pid 3 but there is no cmdline for it.  What is this
process.



=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



symlinks and filemux'ers

2001-10-08 Thread James Morrison

 Well, I've kept at this file multiplexer.  However something
is confusing me.  I canonize all the file names thus when someone
tries
to access the retry method is always FS_RETRY_MAGICAL but it selects
the
third file everytime.

 So here is a sample run through:
showtrans manyfiles
 /home/jim/filemux file1 file2 file3 file4

less manyfiles

S_fsys_getroot tries file2
S_fsys_getroot tries file3
S_fsys_getroot tries file4 and gives back this node.

less manyfiles
S_fsys_getroot tries file1
S_fsys_getroot tries file2
S_fsys_getroot tries file3 and gives back this node

Perhaps there is a magic retry variable?

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: PowerPC port

2001-10-11 Thread James Morrison

--- Peter Bruin <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have ported the Hurd to OSF Mach (in fact, I haven't done
> anything with
> Mach, I just use the version that comes with MkLinux). You can
> indeed run
> the Hurd from within MkLinux, but it can't read from the console
> because Linux
> also has the console open; it might be possible to fix that. Maybe
> the Hurd
> can also be made to run within MacOS X, but Apple has replaced OSF
> Mach's device
> interface with a completely different one.
>
> Peter
>
> [EMAIL PROTECTED]
>

When I extracted osf Mach from MkLinux I noticed that it had
3
architextures, i386, PowerPC, and HP700.  I'm wondering how well i386
and
HP700 source still builds.  Do you know anyone who has used osf mach
on these
architextures?

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



running system, can't exec programs.

2001-12-02 Thread James Morrison

 Hello, 
   I've come to an interesting problem.  I can't run any programs,
but
I my system is still running, 15 days.  This is what I did:
  cp /bin/ls ~/bin; gzip ~/bin/ls
  ~/bin/ls.gz
  ---nothing happens---
  C-c
  ---nothing happens, but I can't switch screens now---
  
  So I login from another machine,
  ps -x
  kill 
  ---nothing happens---
  C-c
  ---nothing happens, and I can't use the terminal anymore--

  So I login again via telnet
  kill -9 

  It works, both unless terminal are recovered.

  now I can't run any new programs. apache is still running, I've
  still got irc, but no new processes.  Is there anything I can do
  to get the exec server working again without rebooting?




=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: running system, can't exec programs.

2001-12-02 Thread James Morrison

--- Roland McGrath <[EMAIL PROTECTED]> wrote:
> > Is exec still running? At least in theory, I think it should work
> to
> > just kill it, and then a new one should be started automatically
> when
> > needed.
>
> So let's think about how that works.  A passive translator is
> started by
> the parent calling file_exec, which works in the filesystem by
> calling
> exec_exec on its port to the exec server.  This is why the exec
> server is a
> special part of the bootstrap process: it's the only thing that can
> load a
> program into another task!
>
> > If possible, it might be even better to use settrans to detach
> exec
> > from its node, so that you can get a new one, and attach gdb to
> the
> > old one.
>
> Using settrans to install a new active translator on /servers/exec
> ought to
> work, but there might be some problems with things not getting a
> new port
> when their old one dies.  Try it and debug it.  But note that it
> will only
> ever work right if the old translator dies so that the open ports
> to it die.
>
>
 now for the obvious, if exec isn't doing anything, how can one run settrans?

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



libc_cv_gcc_unwind_find_fde

2001-12-17 Thread James Morrison

 Recently Jeff Bailey reported that he needed to set 
libc_cv_gcc_unwind_find_fde to yes in order to get glibc with libio
to compile with with gcc3 on GNU/Hurd.  

 However, here is the cvs changelog

Log message:
2001-12-10  Roland McGrath  <[EMAIL PROTECTED]>
* sysdeps/mach/hurd/configure.in (libc_cv_gcc_unwind_find_fde):
Fix conditionals so this is set by default for stdio and not for
libio.
* sysdeps/mach/hurd/configure: Regenerated.

which shows that libio should always set this value to no.

The only thing I can say is this seems to be a contradiction.  Is
there any explaination for this contradiction?



=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: httpfs, tarfs --help

2001-12-21 Thread James Morrison

--- Adam Olsen <[EMAIL PROTECTED]> wrote:
> There's two ways for an app to support gzipped files:
> a) within the app itself, by recognising files with a .gz extension

This is bad, extensions should not be trusted.  Magic can
be used to determine if a file is compressed, and if so what library
function
to call to decompress it.  There probably should be a hurd library to
do this
stuff so at some point we would be able to run both gzipped binaries
and bzip2'd
binaries.

> b) using a translator
>
> You can't use the translator *all* the time, because you may want
> to
> manipulate the gzipped file itself.  And doing it in the app has to
> be
> duplicated for every app.  Therefore there IS no "right way".  Do
> whatever is most convenient.
>
> >
> I agree.  Btw, naming a non-gzipped file .gz breaks opening them
> with
> vim, and presumably every other app that already supports gzipped
> files.  Being compatable is very important.

  Humm, it seems vim is broken.

> --
> Adam Olsen, aka Rhamphoryncus
>

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: realtek 8029

2001-12-30 Thread James Morrison


--- Patrick Strasser <[EMAIL PROTECTED]> wrote:
> > mah wrote:
> > 
> > i have a realtek 8029 card along with its linux drivers.
> 
> The 8029 is compatible to the NE2000. Regarding the GNU Hurd
> Hardware
> Compatibility Guide (
> http://www.urbanophile.com/arenn/hacking/hurd/hurd-hardware.html ) 
> GNUMach supports the PCI NE2000.
> 

That HCL is old.  The new HCL is at
http://www.freesoftware.fsf.org/thug/gnumach_hardware.html .



=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



assertion failure at line 47 of libfshelp/lock-acquire.c

2002-01-21 Thread James Morrison

 As the name suggests I have managed to get this assertion failure.
In fshelp_acquire_lock, using LOCK_UN flags, *user is supposed to
equal
box->type.  This assertion comes up while booting GNU/Hurd machine at
the UW csc.  The machine was working fine, then it got turned off,
somehow, and now this assertion appears after the login shell prints
/etc/motd, and before any login shell comes up.  I haven't found. the
exact problem. But Even if I remove Apache, and sshd from the startup
and use an ext2fs.static translator that I know works, eg mine I
still
get the assertion failure.  Sub-Hurd's are
SSSWETT.

Also in a sub-hurd, is there a way not to have an e2fsck occur?
 Eg.  My root partition is hd0s3, I am booting a sub-hurd off of
hd3s1
so I settrans -a /mnt /hurd/ext2fs /dev/hd3s1; boot -I -D/mnt
/mnt/boot/servers.boot hd3s1


Thanks for any help ;)
 

=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



hostname again.

2002-01-30 Thread James Morrison

 I finally got to understanding the change that was made in 
libc/hurd/set-host.c by Roland a couple months ago.  However, his fix
still has the same problem.  I have the debian libc0.2 package
installed which is from Jan 04 so I assume it has Rolands fix.  

Before I get to the patch, here is an interesting error:

Fatal error, aborting.
load average of 17 is too high

Anyway, I think this should fix the problem:

Index: set-host.c
===
RCS file: /cvs/glibc/libc/hurd/set-host.c,v
retrieving revision 1.7
diff -u -r1.7 set-host.c
--- set-host.c  2001/11/04 10:31:13 1.7
+++ set-host.c  2002/01/31 06:08:40
@@ -34,7 +34,7 @@
 return -1;

   /* Create a new node.  */
-  err = __dir_mkfile (dir, O_WRONLY, 0644, &new);
+  err = __dir_mkfile (dir, O_CREAT|O_WRITE, 0644, &new);
   if (! err)
 { 
   /* Write the contents.  */



=====
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: hostname again.

2002-01-31 Thread James Morrison


--- "Thomas Bushnell, BSG" <[EMAIL PROTECTED]> wrote:
> James Morrison <[EMAIL PROTECTED]> writes:
> 
> > Before I get to the patch, here is an interesting error:
> > 
> > Fatal error, aborting.
> > load average of 17 is too high
> 
> From where?
> 

I tried to run cvs diff -u and I got that error once.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: hostname again.

2002-02-01 Thread James Morrison


It seems my assumption of Rolands patch being in the debian tree is
wrong.

--- "Thomas Bushnell, BSG" <[EMAIL PROTECTED]> wrote:
> James Morrison <[EMAIL PROTECTED]> writes:
> 
> > -  err = __dir_mkfile (dir, O_WRONLY, 0644, &new);
> > +  err = __dir_mkfile (dir, O_WRITE, 0644, &new);
> 
> Hrm.  
> 
> O_WRITE is surely better than O_WRONLY, but they are equal in fact.
> 
> And the implementation of dir-mkfile.c in libdiskfs always turns on
> O_READ, O_WRITE, and O_EXEC anyway, regardless of what you asked
> for.

Actually, O_READ, O_WRITE, O_EXEC are the only things that can be
turned on.  So O_CREAT, O_TRUNC are ignorned.  Should libnetfs be
change to limit the usable flags to O_READ, O_WRITE, and O_EXEC as
well?  In libnetfs flags are directly passed down to make_peropen()
and then put into po->openstat .  libtrivfs doesn't support
dir_mkfile
so that shouldn't make a difference ;).

So a change from O_WRONLY and O_WRITE is completly cosmetic.

> I'm not sure why it does this (is it really the right Posix
> semantics??).  
> 
> O_CREAT is entirely ignored here.  The flags are used only to
> initialize the peropen for the returned port.
> 
> So if this fixes anything, I'm entirely mystified why.  I'd rather
> not
> see the change checked in without understanding it.
> 
> Thomas
> 
> ___
> Bug-hurd mailing list
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/bug-hurd


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: hostname again.

2002-02-05 Thread James Morrison


--- "Thomas Bushnell, BSG" <[EMAIL PROTECTED]> wrote:
> James Morrison <[EMAIL PROTECTED]> writes:
> 
> > Actually, O_READ, O_WRITE, O_EXEC are the only things that can be
> > turned on.  
> 
> No, O_APPEND, the O_*SYNC flags, and so forth, are all meaningfull.
> 

 Humm, I seem to be missing something.  The flags are passed to the
glibc function __dir_mkfile which makes an RPC dir_mkfile call to
the proper translator.  In the case of lib diskfs/dir-mkfile.c the
flags are untouched until line 70: 

  flags &= (O_READ | O_WRITE | O_EXEC);

Then the flags are passed to diskfs_make_peropen.

  flags &= (O_READ | O_WRITE | O_EXEC);
should removed all options that are turned on but O_READ, O_WRITE,
and O_EXEC right?



=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



boot scripts

2002-02-13 Thread James Morrison

 G'day

 I know grub doesn't support scripts yet, but scripts probably would
be useful for booting the Hurd.  Anyway, I'm wondering what the
syntax of the grub scripts would be.

 I was thinking a couple scripting commands, eg

script /boot/grub-boot

 script would read the file specified and use each line in the file
as a command.

modulescript /boot/servers.boot

 modulescript would read the file using each line as a module line
for grub.  Having modulescript would allow a sysadmin to use the
same boot script for sub-hurds as well as the main hurd.

For any script # would denote comments.

Does this make sense?


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



bad news for libtrivfs/libthread

2002-02-23 Thread James Morrison

 I've managed to get the same problem as Justin Langer.

Here is a backtrace, it's the same as Justin's:

(gdb) info thread
  2 thread 17065.2  0x0105528c in evc_wait () from /lib/libc.so.0.2
* 1 thread 17065.1  0x011dec1c in cthread_fork_child ()
   from /lib/libthreads.so.0.2
(gdb) bt 
#0  0x011dec1c in cthread_fork_child () from /lib/libthreads.so.0.2
#1  0x011ded1d in alloc_stack () from /lib/libthreads.so.0.2
#2  0x011dd4e1 in cproc_create () from /lib/libthreads.so.0.2
#3  0x011de70d in cthread_fork () from /lib/libthreads.so.0.2
#4  0x0119bec6 in ports_manage_port_operations_one_thread ()
   from /lib/libports.so.0.2
#5  0x01055e7b in mach_msg_server_timeout () from /lib/libc.so.0.2
#6  0x0119c0b6 in ports_manage_port_operations_one_thread ()
   from /lib/libports.so.0.2
#7  0x0119c1a6 in ports_manage_port_operations_multithread ()
   from /lib/libports.so.0.2
#8  0x08048fcd in main (argc=2, argv=0x1024c70) at firmlink.orig.c:91
#9  0x01077b5b in __libc_start_main () from /lib/libc.so.0.2

I compiled the stock firmlink source with this line:

 gcc -ggdb -D_GNU_SOURCE -I. -o firmlink firmlink.orig.c -ltrivfs
-lfshelp

I'm going to compile a new cvs checkout of the Hurd tonight, this is
of course assuming a new checkout will compile natively.

changing ports_manage_port_operations_multithread to 
ports_manage_port_operations_one_thread fixes the SIGILL.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: bad news for libtrivfs/libthread

2002-02-23 Thread James Morrison


--- Neal H Walfield <[EMAIL PROTECTED]> wrote:
> > I compiled the stock firmlink source with this line:
> > 
> >  gcc -ggdb -D_GNU_SOURCE -I. -o firmlink firmlink.orig.c -ltrivfs
> > -lfshelp
> 
> You need to link with the cthread library.
> 

Thanks, linking to libthreads fixed it.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: hostmux patch

2002-03-03 Thread James Morrison


--- Neal H Walfield <[EMAIL PROTECTED]> wrote:
> > Hey, 
> > 
> >   Guess what?  It's time for my weekly patch ;)  This stuff is
> mostly
> > out of the glibc manual ;)
> > 
> > 2002-03-03  James A. Morrison  <[EMAIL PROTECTED]>
> > 
> >  * mux.c (lookup_host): removed arbitrary limit on host name
> >  size.
> 
> This is a good start.
> 
> Perhaps we should have a function in libshouldbeinlibc that does
> this.
> ftpfs and ping also need to be fixed.
> 
> Consider using realloc instead of a free followed by a malloc.
> 

Ok, I've done this in my version, it saves a few lines.
Any ideas as to what you would call these functions in
libshouldbeinlibc ?  Perhaps gethostbyname_a for alloc?

> Please conform more closely to the GNU coding standards.  For
> instance, you cast too much (no need to cast the return result of
> malloc; in fact it is wrong), parentheses are wrong, some
> indentation
> and spacing also look incorrect.
> 

 Humm, I do cast the return value of malloc, but any of the examples
in the libc manual or the GCS also cast the return value of malloc
The GCS only says not to cast to void * .  I will beat it into my
brain to run my code through indent on of these days.  I'm not sure
what you mean by the parentheses are wrong.  I have added spaces
before parentheses if that is what you meant.

 I've also, hopefully, fixed the style in my multiple firmlink patch,
so I'll mail those patches in next weekend.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



I am slowly going crazy 1,2,3,4,5,6 switch

2002-03-06 Thread James Morrison

 Ok, I've changed hostmux to use getaddrinfo, but I am having a
problem.

I CAN'T hostmux to WORK.  Anyway, I can't give any useful debugging
information because I can't get any.  I get the same results when I
compile hostmux from within the Hurd sources and as a standalone
program,  a bit of makefile fun made this possible.  I try to debug
the translator using settrans -aP ~/myhostmux /hurd/ftpfs /
attached gdb on another screen window, continue in gdb and press
enter in the translator window and the translator dies with unknown
exit status, using SIGKILL.  I have tried setting break points in
gdb, but the translator always dies before it hits any of them,
including mach_task_self.

 Here is the output of ldd:
jim@lazarus:~/hostmux$ ldd hostmux
libnetfs.so.0.2 => /lib/libnetfs.so.0.2 (0x0102b000)
libfshelp.so.0.2 => /lib/libfshelp.so.0.2 (0x0103b000)
libiohelp.so.0.2 => /lib/libiohelp.so.0.2 (0x0104)
libthreads.so.0.2 => /lib/libthreads.so.0.2 (0x01043000)
libports.so.0.2 => /lib/libports.so.0.2 (0x01049000)
libihash.so.0.2 => /lib/libihash.so.0.2 (0x0105)
libshouldbeinlibc.so.0.2 => /lib/libshouldbeinlibc.so.0.2
(0x01054000)
libc.so.0.2 => /lib/libc.so.0.2 (0x0105e000)
libmachuser.so.1 => /lib/libmachuser.so.1 (0x011bc000)
libhurduser.so.0.0 => /lib/libhurduser.so.0.0 (0x011cc000)
/lib/ld.so => /lib/ld.so (0x1000)

hostmux --help|--usage still work and ./hostmux /hurd/ftpfs still
says hostmux must be started as a translator.


Any hints would be appriciated.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: I am slowly going crazy 1,2,3,4,5,6 switch

2002-03-08 Thread James Morrison


--- Marcus Brinkmann <[EMAIL PROTECTED]> wrote:
> On Wed, Mar 06, 2002 at 09:02:07PM -0800, James Morrison wrote:
> > I CAN'T hostmux to WORK.
> 
> You have linked it with libthreads?  The ldd output is not enough
> to tell us
> this.  Even the order of libraries on the command line of gcc might
> matter.
> 
> Thanks,
> Marcus
> 

 Well, I'm working on the manual bootstrap, but the output of ldd
gives the same order as the order of the libraries on the gcc command
line, excluding libc, hurduser, and machuser.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: added an error_t to netfs_startup

2002-03-09 Thread James Morrison


--- Neal H Walfield <[EMAIL PROTECTED]> wrote:
> >   This patch is cosmetic, but it helped me debug since I couldn't
> get
> > gdb to print errno, where it would print error.
> > 
> >   Is this the better way to return the error?
> 
> The current code is wrong.  This is the Right Way.
> 

 Ok, next week's patch will contains the rest of these fixes.

> > * init-startup: Changed errno to err.
> 
> This is better:
> 
>   * init-startup (netfs_startup): Use err, not errno.
> 
> 

 And look, my changelog entry is already written for me.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



feeping creaturism

2002-03-10 Thread James Morrison

> >   This firmlink patch should conform to the GCS, and the time
mode works
> > nicely.
> >
> > 2002-03-09  James A. Morrison <[EMAIL PROTECTED]>
> >
> >   * firmlink.c: Added the functionality for multiple targets
decided
> >   on by a command line option choosing randomly,
sequencially, or
> >   based on the date/time.

> I am glad to see that you have taken the time to play with some of 
the
> code and begun to understand it.  However, I am not convinced of
the
> general utility of this patch: in my opinion, it is better to avoid
> freeping creaturism.

 Well, this is quite a feature to add.  Personally, I intend on using

this in conjunction with a transdir translator to store my apache
logs.  Transdir[1] will be a stripped down hostmux, that doesn't mux
anything.  So I'll do this
settrans /var/log/apache /hurd/transdir /hurd/filemux --date="%Y-%W"
/home/jim/apache '${file}'

This will store my apache logs in /home/jim/apache, and
/var/log/apache will just be a reference to this weeks logs.  Now if
I can figure out a way to add transparent gunzip to filemux, I will
have found a way to replace all the things I know logrotate does with
translators that do the job better and more accurately.

[1] If anyone has a better name for this idea, I would be happy to
here it.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: feeping creaturism

2002-03-11 Thread James Morrison


--- Oystein Viggen <[EMAIL PROTECTED]> wrote:
> * [Adam Olsen] 
> 
> > Just one question.  Does apache keep the log open long term, or
> does
> > it open and close it for each item it writes?  If it keeps it
> open
> > you'll have the problem that the log never rotates (it'd keep the
> old
> > file open), unless you split out individual lines, but then you'd
> need
> > special handling to keep apache's pairs of lines together.
> 
> In Debian's /etc/cron.daily/apache that currently does log
> rotating,
> the program is sent a SIGHUP to reopen its log file.  The easiest
> way of
> getting the filemuxing to work would probably be to use cron to HUP
> the
> server (but that kind of defeats the point of the whole translator
> setup).
> 

 Having a cron job HUP apache whenever I need is isn't completely
against the point, but is not the ideal solution.  The advantage of
only having cron HUP apache is that if the machine goes down, the
logs still rotate anyway.  My other option is to write a patch for
apache that creates an option to open the file each time the file is
written to, or some optimized version of this.

It seems gopherd, smbd, and nmbd all would need a SIGHUP as well.

At least I can feel comfortable that this will work for my changelogs
when I am working this summer ;)  It will also work as my ogg
playlist, but that will require an nfsd on my machine as well.  So
many fun things to do, so little time.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: patch: use err, not errno

2002-03-14 Thread James Morrison


--- "Thomas Bushnell, BSG" <[EMAIL PROTECTED]> wrote:
> James A Morrison <[EMAIL PROTECTED]> writes:
> 
> > Ok, I've grep'd through the hurd source looking for instances of
> errno being
> > assigned directly.  These seem to be the places where setting
> errno isn't 
> > right.  
> 
> What's the reason for this?
> 

Roland had a good answer for this. I noticed it last week when I
tried to step through part of libnetfs, see last weeks patch.

> > I've also changed !var to var == MACH_PORT_NULL where appropriate
> 
> > because some documentation, mach.texi, says MACH_PORT_NULL is not
> assumed to
> > be 0 in the Hurd system.
> 
> This is always fine.
> 

 Yes, but I wanted to be consistant with the documentation.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: patch: use err, not errno

2002-03-14 Thread James Morrison


--- Roland McGrath <[EMAIL PROTECTED]> wrote:
> Several of those instances used perror and you didn't change them.
> Changing them to use `error' instead of perror or perror and exit
> is fine.
> I'd have to examine all the surrounding code more closely to be
> sure there
> aren't other cases where the code calls something that uses errno.
> 

I figured the code would need a second look, I tried to be as
conscientious as I could.  I hadn't thought of perror to error, but
it would make things more consistant.  Are there any more consistancy
things I should look for while reading through more code?


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: patch: use err, not errno

2002-03-14 Thread James Morrison


--- "Thomas Bushnell, BSG" <[EMAIL PROTECTED]> wrote:
> James Morrison <[EMAIL PROTECTED]> writes:
> 
> > > > I've also changed !var to var == MACH_PORT_NULL where
> > > > appropriate because some documentation, mach.texi, says
> > > > MACH_PORT_NULL is not assumed to be 0 in the Hurd system.
> > > 
> > > This is always fine.
> 
> >  Yes, but I wanted to be consistant with the documentation.
> 
> By "this is always fine" I meant "making the change you suggest
> here
> is always fine".
> 
> 

Oh, Ok, thanks.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



oskit-mach success

2002-03-17 Thread James Morrison

 Well, I compiled the newest version of oskit today, I added the tlan driver to
oskit and oskit-mach compiled and run with the following patch.

However, I did notice that my oskit-mach kernel did not boot the Hurd directly.
I had to go back to using serverboot.

2002-03-17  James A. Morrison  <[EMAIL PROTECTED]>

 * Makefile.in: Remove dependency on liboskit_smp.
 Ensure OSKIT_LIBDIR/.. always precedes OSKIT_LIBS.

Index: Makefile.in
===
RCS file: /cvsroot/hurd/gnumach/Makefile.in,v
retrieving revision 1.22.2.17
diff -u -r1.22.2.17 Makefile.in
--- Makefile.in 4 Mar 2002 19:18:10 -   1.22.2.17
+++ Makefile.in 18 Mar 2002 00:13:46 -
@@ -269,7 +269,7 @@
 
 
 OSKIT_LIBDIR = @OSKIT_LIBDIR@
-OSKIT_LIBS = -loskit_kern -loskit_lmm -loskit_com -loskit_smp \
+OSKIT_LIBS = -loskit_kern -loskit_lmm -loskit_com \
 -loskit_exec -loskit_unsupp \
 -loskit_dev -loskit_linux_dev -loskit_diskpart \
 
@@ -327,7 +327,7 @@
 
 kernel-%.o: $(OSKIT_LIBDIR)/multiboot.o $(objfiles) init-%.o
$(CC) $(CFLAGS) -nostdlib -nostartfiles $(LDFLAGS) -r -o $@ \
- -Wl,-\( $^ $(OSKIT_LIBS) -Wl,-\) -lgcc
+ -Wl,-\( $^ $(OSKIT_LIBDIR)/.. $(OSKIT_LIBS) -Wl,-\) -lgcc
 
 #
 # Installation


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: oskit-mach success

2002-03-18 Thread James Morrison


--- Jeroen Dekkers <[EMAIL PROTECTED]> wrote:
> On Sun, Mar 17, 2002 at 04:18:27PM -0800, James Morrison wrote:
> >  Well, I compiled the newest version of oskit today, I added the tlan
> driver to
> > oskit and oskit-mach compiled and run with the following patch.
> 
> That's nice. I don't know if it's possible to just change all the
> Linux driver code to 2.2.0. That would be a lot nicer I think.
>  

 Most of the linux drivers probably haven't changed from 2.2.12 to 2.2.20 but
I'm sure it wouldn't be too hard to update them.

> > However, I did notice that my oskit-mach kernel did not boot the Hurd
> directly.
> > I had to go back to using serverboot.
> 
> Are you sure you have put the "--" at the end of the kernel line? This
> is an annoying thing and we should change the way the command line
> code works IMHO.
> 
> Jeroen Dekkers

Thanks, I fixed this.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: oskit-mach (oskit-20010214/oskit-20020317) and ping -f

2002-03-18 Thread James Morrison


--- Daniel Wagner <[EMAIL PROTECTED]> wrote:
> I've been playing around with some ping flooding. As it seems
> oskit-mach is not stable enough for these kind of torturing.
> Here are some things I tried and what happened. I didn't have
> analyzed the problems more deeply. I just wanted them to report
> right now. I used for this test the newest oskit snapshot (20020317).
> 
> Daniel Wagner   "Don't drink and derive."

 Hi, I'm not trying has hard as you to crash my machine, but here are my
trials:

squirrel GNU/Linux
lazarus GNU/Hurd running OSKIT-Mach, 
oskit-20020317 with the tlan driver I added.  lazarus also has 534mb of ram
and is incredibly stable.

PING 192.168.1.2 (192.168.1.2): 56 data bytes
..
--- 192.168.1.2 ping statistics ---
1513 packets transmitted, 1467 packets received, 3% packet loss
round-trip min/avg/max = 0.7/8.6/21.4 ms

lazarus:~# ping -f localhost
PING localhost (127.0.0.1): 56 data bytes
..^C
--- localhost ping statistics ---
571 packets transmitted, 285 packets received, 50% packet loss
round-trip min/avg/max = 30.0/568.4/1430.0 ms


squirrel:~# ping -f 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
.
--- 192.168.1.2 ping statistics ---
2516 packets transmitted, 2395 packets received, 4% packet loss
round-trip min/avg/max = 0.9/12.0/26.1 ms

lazarus:~# ping -f localhost
PING localhost (127.0.0.1): 56 data bytes
^C
--- localhost ping statistics ---
1094 packets transmitted, 546 packets received, 50% packet loss
round-trip min/avg/max = 30.0/1441.0/3360.0 ms

 What ethernet driver are you using?


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: Linux style /proc filesystem translator && httpfs

2002-03-20 Thread James Morrison


Hey, 

  Thanks, I'll get to testing this.  did you look at any of neal's procfs
code?

 I'm getting a 404 error though.

--- Jon Arney <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> I've been busy the last week or so putting together a first pass at
> a Linux style /proc filesystem translator.  It seems to have barely
> enough smarts in it now to support the 'procps' package (not that
> procps is better than the native Hurd utilities).  The intent here
> was to start with a Linux-2.4 style /proc filesystem and then move
> on to bigger and better by supporting a 'native' Hurd mode /proc
> filesystem which models the Hurd's behavior better rather than
> just emulating a Linux style /proc.  i.e. rather
> than /proc//* we might have /proc/tasks///*
> and /proc/tasks///* and other cool stuff.  
> It would also be possible for /proc to only show processes owned
> or grouped by you so that you can't see other users processes.
> 
> The biggest problem with the Linux-2.4 /proc filesystem emulation
> is that many of the things available under Linux's /proc filesystem
> either have no equivalent under the Hurd, or are not redily
> available through existing data structures/RPCs because it's a
> fundamentally different architecture.
> 
> If anyone's interested, I've put it out at
> http://orac.ensor.org:8080/hurd/hurd-procfs/
> with some documentation on what it is, what it does, etc.
> Let me know if you can't get to it because I've had problems
> from time to time with the network.
> 
> The beauty (and danter) of the Hurd is that it's an entirely
> independent package and doesn't need to be compiled into the
> /hurd tree.  It supports the traditional
> automake;autoconf;./configure;make scheme.

 Thank you, I'm having a slight problem with httpfs because it isn't done
this way.

 Now getting to httpfs:
   1: Please make source tarballs compilable outside the hurd source.
  That is don't include Makeconf until the translator is ready to be part
  of the hurd source.
   2: Please, if you do include Makeconf, please include either Makefile.in,
  with or without a configure script.
   3: Since httpfs is supposed to be compiled as part of the hurd source
  Makeconf needs to be edited to include the appropriate libxml headers.

 If need be I'll make a self-contained tarball of httpfs this weekend, and send
a Makefile patch here.
 Sorry about bitching, I just want to compile and play with cool things out of
the box ;).  Note: libxml2 is compiled for Debian GNU/Hurd.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



fstests and stuff

2002-03-20 Thread James Morrison

 Hi,

 On around line 93 of fstests/fstests.c, there is a malloc of size 0, what
would
be the point of that?

 Humm, fstests/opendisk.c and fstests/fdtests.c don't compile anymore, but I
suppose that is why they are commented out of the makefile.

 Any just a few quick questions.  Thanks.




=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: Linux style /proc filesystem translator

2002-03-20 Thread James Morrison


 Personal Plug:  I have collected on my website all the translators I know of.
I'll the new procfs and httpfs this weekend.  see hurd.dyndns.org

 Once reason I was able to keep my hurd box up for 7 weeks was that I used
neal's proc filesystem which continued to work even after I couldn't use ps -a.
I don't know why I couldn't use ps -a, but I couldn't.




=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: posix shared memory

2002-03-21 Thread James Morrison


--- Jon Arney <[EMAIL PROTECTED]> wrote:
> James,
> 
> Thanks for the links.  One of the difficult things about coming up to
> speed on the Hurd is that there are so many different websites with
> lots of (sometimes conflicting) information.

 Yes, luckily this has gotten a bit better with most stuff on hurd.gnu.org

> One question I had was about your list of planned changes.  On there,
> you list "Posix shared memory".  Is anybody working on this?  If not,
> I'd like to make an attempt at it (I have already started working on
> some of it).  If there's already a project partially completed, that
> would be better than starting from scratch.  I can't seem to get
> my Gimp to work because it lacks shmget/shmat/etc.
> 
> Thanks.
> 
> -Jon.

 The Posix shared memory, as you might have noticed, is under Neal's list.  A
while ago, there was a call for Hurd projects, this was something Neal said
he was working on.

 I found this previous thread on Shared memory implementations:
http://mail.gnu.org/pipermail/help-hurd/2000-November/004282.html
http://mail.gnu.org/pipermail/help-hurd/2000-December/004293.html


 
> 
> James Morrison wrote:
> > 
> >  Personal Plug:  I have collected on my website all the translators I know
> of.
> > I'll the new procfs and httpfs this weekend.  see hurd.dyndns.org
> > 
> >  Once reason I was able to keep my hurd box up for 7 weeks was that I used
> > neal's proc filesystem which continued to work even after I couldn't use ps
> -a.
> > I don't know why I couldn't use ps -a, but I couldn't.
> > 
> > =
> > James Morrison
> >University of Waterloo
> >Computer Science - Digital Hardware
> >2A co-op
> > http://hurd.dyndns.org
> > 
> > Anyone refering this as 'Open Source' shall be eaten by a GNU
> > 
> > __
> > Do You Yahoo!?
> > Yahoo! Movies - coverage of the 74th Academy Awards¥ç
> > http://movies.yahoo.com/
> 
> -- 
> 
> Jonathan S. Arney
> Software Engineer
> (602) - 589 - 6654
> [EMAIL PROTECTED]
> 
> 
> ___
> Bug-hurd mailing list
> [EMAIL PROTECTED]
> http://mail.gnu.org/mailman/listinfo/bug-hurd


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



compiling the hurd under oskit-Mach

2002-03-23 Thread James Morrison

 Hi,

  I'm trying to compile the hurd in the hurd while using oskit-mach, but I'm
getting the following error:
../../libdiskfs/file-syncfs.c:61: Internal compiler error:
../../libdiskfs/file-syncfs.c:61: internal error--unrecognizable insn:
(insn/i 112 111 113 (parallel[
(set (reg/v:SI 42)
(asm_operands/v ("xchgl %0, %1") ("=&r") 0[
(reg:SI 41)
]
[   
(asm_input:SI ("0"))
]  ("/include/machine-lock.h") 53))
(set (mem/v:SI (reg/v:SI 39) 0)
(asm_operands/v ("xchgl %0, %1") ("=m") 1[
(reg:SI 41)
]
[   
(asm_input:SI ("0"))
]  ("/include/machine-lock.h") 53))
] ) -1 (insn_list 106 (insn_list 111 (nil)))
(expr_list:REG_DEAD (reg:SI 41)
(nil)))
make[1]: *** [file-syncfs.o] Error 1
make[1]: Leaving directory `/home/compile/A/cvs/hurd/build/libdiskfs'
make: *** [libdiskfs] Error 2

 machine-lock.h comes from the libc-0.2-dev package.  I have no clue how this
should be fixed.



=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



make check

2002-03-24 Thread James Morrison

 Hi,

  I'm curious what types of checks would be in a make check target for the
hurd.
Would have to be run in a sub-hurd to test all the hurd translators and libc
functions?  Should the test programs be compiled within that test sub-hurd?


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



fetch_boot_time () to libshouldbeinlibc or libhurduser

2002-03-24 Thread James Morrison

  There is a function in utils/w.c called fetch_boot_time ().  Moving this
function to a hurd libraries would make it much simpler for people to write
there
own uptime programs for GNU Hurd and any other application that might want to
get the systems boot time, like procfs.


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



Re: zealous use of error

2002-03-24 Thread James Morrison


--- "Thomas Bushnell, BSG" <[EMAIL PROTECTED]> wrote:
> James A Morrison <[EMAIL PROTECTED]> writes:
> 
> > libnetfs:
> > * make-protid.c (netfs_make_protid): Use err, not errno.
> 
> This one is incorrect; it changes the established interface of
> netfs_make_protid, which is that errno is set on error returns.
> 
> See, for example, libnetfs/fsys-getroot.c which depends on this
> behavior.
> 
> (There are other callers of netfs_make_protid which do not properly
> check for errors, but should.  They would also depend on this
> behavior.)
> 
> 
> Thomas
> 

 Previously netfs_make_protid set errno, no matter what.  So to keep this
behaviour the patch would look like this.

Index: make-protid.c
===
RCS file: /cvsroot/hurd/hurd/libnetfs/make-protid.c,v
retrieving revision 1.6
diff -u -r1.6 make-protid.c
--- make-protid.c   18 Nov 1996 23:51:10 -  1.6
+++ make-protid.c   24 Mar 2002 23:17:25 -
@@ -1,5 +1,5 @@
 /* 
-   Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 2002 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
 
This file is part of the GNU Hurd
@@ -23,17 +23,19 @@
 struct protid *
 netfs_make_protid (struct peropen *po, struct iouser *cred)
 {
+  error_t err;
   struct protid *pi;
 
   if (cred)
-errno = ports_create_port (netfs_protid_class, netfs_port_bucket, 
-  sizeof (struct protid), &pi);
+err = ports_create_port (netfs_protid_class, netfs_port_bucket, 
+sizeof (struct protid), &pi);
   else
-errno = ports_create_port_noinstall (netfs_protid_class,
-netfs_port_bucket, 
-sizeof (struct protid), &pi);
+err = ports_create_port_noinstall (netfs_protid_class,
+  netfs_port_bucket, 
+  sizeof (struct protid), &pi);
 
-  if (errno)
+  errno = err;
+  if (err)
 return 0;
 
   po->refcnt++;


=
James Morrison
   University of Waterloo
   Computer Science - Digital Hardware
   2A co-op
http://hurd.dyndns.org

Anyone refering this as 'Open Source' shall be eaten by a GNU

__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

___
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd



  1   2   3   >