Earnie Boyd | 1 May 2003 20:20
Picon
Favicon

errno.cc (_sys_nerr) patch

This patch leaves newlib/libc/include/sys/errno.h file as is.  The 
importance of this patch is that currently _sys_nerr is marked as 
imported because ``extern __declspec(dllexport)'' is converted to 
__declspec(dllimport).

Earnie.
2003.05.01  Earnie Boyd  <earnie <at> users.sf.net>

	* errno.cc: Remove macro definition kludges for _sys_nerr and sys_nerr.
	(_sys_nerr): Remove extern, const and NO_COPY modifiers to remove a
	section type conflict and to allow the variable to really be marked as
	exported instead of marked as imported.

Index: errno.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/errno.cc,v
retrieving revision 1.33
diff -u -3 -p -r1.33 errno.cc
--- errno.cc	27 Apr 2003 03:14:02 -0000	1.33
+++ errno.cc	1 May 2003 18:05:48 -0000
 <at>  <at>  -8,16 +8,12  <at>  <at>  This software is a copyrighted work lice
 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
 details. */

-#define _sys_nerr FOO_sys_nerr
-#define sys_nerr FOOsys_nerr
 #include "winsup.h"
 #define _REENT_ONLY
(Continue reading)

Igor Pechtchanski | 2 May 2003 00:50
Picon

[PATCH] cygcheck parsing of id output

Hi,

The attached patch allows cygcheck to handle spaces, commas, and
*matching* parentheses in user and group names in the "id" output.
There's some code sharing in parsing the user and group names, but that
could be refactored in a later cleanup.

One issue that also came up is the old "run a cygwin program from a
non-cygwin program from an xterm" issue -- when running cygcheck from an
xterm, id pops up a separate window and cygcheck gets no output from id...
I'm not sure how to fix this.  One thing that comes to mind is making
cygcheck aware of Cygwin ptys, but I don't know how hard that would be...
	Igor
==============================================================================
ChangeLog:
2003-05-01  Igor Pechtchanski  <pechtcha <at> cs.nyu.edu>

	* cygcheck.cc (pretty_id): Parse id output without
	using strtok.
	(match_paren): New static function.

--

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha <at> cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor <at> watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II
(Continue reading)

Earnie Boyd | 3 May 2003 15:02
Picon
Favicon

Re: errno.cc (_sys_nerr) patch

Ping.

Earnie Boyd wrote:
> This patch leaves newlib/libc/include/sys/errno.h file as is.  The 
> importance of this patch is that currently _sys_nerr is marked as 
> imported because ``extern __declspec(dllexport)'' is converted to 
> __declspec(dllimport).
> 
> Earnie.
> 
> 
> ------------------------------------------------------------------------
> 
> 2003.05.01  Earnie Boyd  <earnie <at> users.sf.net>
> 
> 	* errno.cc: Remove macro definition kludges for _sys_nerr and sys_nerr.
> 	(_sys_nerr): Remove extern, const and NO_COPY modifiers to remove a
> 	section type conflict and to allow the variable to really be marked as
> 	exported instead of marked as imported.
> 
> Index: errno.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/errno.cc,v
> retrieving revision 1.33
> diff -u -3 -p -r1.33 errno.cc
> --- errno.cc	27 Apr 2003 03:14:02 -0000	1.33
> +++ errno.cc	1 May 2003 18:05:48 -0000
>  <at>  <at>  -8,16 +8,12  <at>  <at>  This software is a copyrighted work lice
>  Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
>  details. */
(Continue reading)

Chris January | 4 May 2003 11:52

RE: hostid patch

> On Wed, Apr 30, 2003 at 11:04:43AM +1000, Robert Collins wrote:
> >On Wed, 2003-04-30 at 11:00, Christopher Faylor wrote:
> >
> >> Three runs, two different results:
> >
> >I count three runs, three result there.
>
> Hmm.  You're right.  I thought the last two hostids were the same but
> they obviously weren't.
>
> >Interestingly, the PSN was different on every case..
>
> Running under strace the PSN stayed the same for a long time.  I thought
> it was going to be one of those "runs fine under strace" scenarios.
>
> >Is this a real box, or VMWare / bochs etc?
>
> It's an FreeBSD box running VMWare, running linux.  I'm running
> cygwin under
> wine on linux.  I can't see how that could be a problem. :-)
>
> >How many cpus are in it?
>
> cygcheck attached.  Hmm.  Cygcheck doesn't say how many CPUs, does it?
>
> /proc/cpuinfo attached, too.
>
> Two CPUs.  Different steppings for each.  The Dell BIOS kindly informs
> me of that fact on each reboot.

(Continue reading)

Thomas Pfaff | 6 May 2003 15:24
Picon

[PATCH] Fix nanosleep


While i am investigating some problems with threads and signals i have
found a bug in nanosleep where signal_arrived is unnecessary checked
twice. This will lead to problems if the event is reset between the two
checks. I can provide a testcase if someone is interested in details.
AFAICT this problem occurs only in multithreaded apps.

2002-05-06  Thomas Pfaff  <tpfaff <at> gmx.net>

	* signal.cc (nanosleep): Do not wait twice for signal arrival.

--- signal.cc.org	2003-05-06 15:10:03.000000000 +0200
+++ signal.cc	2003-05-06 15:11:04.000000000 +0200
 <at>  <at>  -88,7 +88,7  <at>  <at>  nanosleep (const struct timespec *rqtp, 
   int rc = pthread::cancelable_wait (signal_arrived, req);
   DWORD now = GetTickCount ();
   DWORD rem = (rc == WAIT_TIMEOUT || now >= end_time) ? 0 : end_time - now;
-  if (WaitForSingleObject (signal_arrived, 0) == WAIT_OBJECT_0)
+  if (rc == WAIT_OBJECT_0)
     {
       (void) thisframe.call_signal_handler ();
       set_errno (EINTR);
Christopher Faylor | 6 May 2003 15:34
Picon
Favicon

Re: [PATCH] Fix nanosleep

On Tue, May 06, 2003 at 03:24:56PM +0200, Thomas Pfaff wrote:
>While i am investigating some problems with threads and signals

I don't know what you're investigating but the basic problem with threads
and signals is that you can't send a signal to a thread.  I never implemented
that part of signal delivery.

>i have found a bug in nanosleep where signal_arrived is unnecessary
>checked twice.  This will lead to problems if the event is reset
>between the two checks.  I can provide a testcase if someone is
>interested in details.  AFAICT this problem occurs only in
>multithreaded apps.
>
>2002-05-06 Thomas Pfaff <tpfaff <at> gmx.net>
>
>* signal.cc (nanosleep): Do not wait twice for signal arrival.

Please check this in.  Looks like an old bug.

cgf

>--- signal.cc.org	2003-05-06 15:10:03.000000000 +0200
>+++ signal.cc	2003-05-06 15:11:04.000000000 +0200
> <at>  <at>  -88,7 +88,7  <at>  <at>  nanosleep (const struct timespec *rqtp, 
>   int rc = pthread::cancelable_wait (signal_arrived, req);
>   DWORD now = GetTickCount ();
>   DWORD rem = (rc == WAIT_TIMEOUT || now >= end_time) ? 0 : end_time - now;
>-  if (WaitForSingleObject (signal_arrived, 0) == WAIT_OBJECT_0)
>+  if (rc == WAIT_OBJECT_0)
>     {
(Continue reading)

Pierre A. Humblet | 6 May 2003 15:51
Picon

Re: [PATCH] Fix nanosleep

Christopher Faylor wrote:

> >
> >2002-05-06 Thomas Pfaff <tpfaff <at> gmx.net>
> >
> >* signal.cc (nanosleep): Do not wait twice for signal arrival.
> 
> Please check this in.  Looks like an old bug.
> 
> cgf

Looking at the date above, the fix could even be older than the bug. 

Pierre

Thomas Pfaff | 6 May 2003 16:02
Picon

Re: [PATCH] Fix nanosleep

Christopher Faylor wrote:
> I don't know what you're investigating but the basic problem with threads
> and signals is that you can't send a signal to a thread.  I never implemented
> that part of signal delivery.

Indeed you are right:

pthread_kill does not work as expected, instead of sending a signal to 
the specified thread all threads are woken up and the signal handler is 
not called in the context of that particular thread but in the context 
of the main thread. Since all threads are waiting for the same global 
signal_arrived and not for thread specific one it is clear that this 
does not work.

And i would like to know why every thread has its own sigaction 
structure. AFAIK signals are global in the process and not thread 
specific, and only the delivery to a thread can be blocked via 
pthread_sigmask.

Thomas

Christopher Faylor | 6 May 2003 16:26
Picon
Favicon

Re: [PATCH] Fix nanosleep

On Tue, May 06, 2003 at 04:02:23PM +0200, Thomas Pfaff wrote:
>Christopher Faylor wrote:
>>I don't know what you're investigating but the basic problem with threads
>>and signals is that you can't send a signal to a thread.  I never 
>>implemented
>>that part of signal delivery.
>
>Indeed you are right:
>
>pthread_kill does not work as expected, instead of sending a signal to 
>the specified thread all threads are woken up and the signal handler is 
>not called in the context of that particular thread but in the context 
>of the main thread. Since all threads are waiting for the same global 
>signal_arrived and not for thread specific one it is clear that this 
>does not work.
>
>And i would like to know why every thread has its own sigaction 
>structure. AFAIK signals are global in the process and not thread 
>specific, and only the delivery to a thread can be blocked via 
>pthread_sigmask.

I assume it is just pure meanness as usual.

cgf

Joe Buehler | 9 May 2003 17:04

[PATCH] fix for process virtual size display

I offer this trivial patch as a possible fix for "top" displaying
~400 megabytes as the virtual memory size for all processes.  This
happens because the WIN32 info used appears to refer to "reserved"
memory, not "committed", and Cygwin processes have about 400 megabytes
reserved by default (for the stack and/or heap, I forget at the moment).

Whether this is the right thing to do, I don't know.  The sizes
shown by "top" are now slightly smaller than the working set size.
Perhaps due to the way that dlls are counted in the two numbers?

Anyway, I offer this if it looks better than current behavior.

2003-05-09  Joe Buehler  <jhpb <at> draco.hekimian.com>

	* fhandler_process.cc (format_process_stat): use PagefileUsage instead of VirtualSize
	(get_mem_values): Ditto.

Index: fhandler_process.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_process.cc,v
retrieving revision 1.32
diff -u -r1.32 fhandler_process.cc
--- fhandler_process.cc	1 Apr 2003 16:11:41 -0000	1.32
+++ fhandler_process.cc	9 May 2003 14:54:39 -0000
 <at>  <at>  -475,7 +474,7  <at>  <at> 
  	 start_time = (spt.KernelTime.QuadPart + spt.UserTime.QuadPart) * HZ / 10000000ULL;
         priority = pbi.BasePriority;
         unsigned page_size = getpagesize ();
-       vmsize = vmc.VirtualSize;
+       vmsize = vmc.PagefileUsage;
(Continue reading)


Gmane