Thomas Pfaff | 3 Nov 08:35 2003
Picon
Picon

Re: [PATCH] suspend all thread on SIGSTOP

Christopher Faylor wrote:
> On Fri, Oct 31, 2003 at 10:17:37PM +0100, Thomas Pfaff wrote:
> 
>>This time with attachment.
>>
>>This patch suspends all threads on SIGSTOP and resumes them on SIGCONT. 
>>The corresponding functions in the pthread class are already committed.
>>
>>Thomas
>>
>>2003-10-31  Thomas Pfaff  <tpfaff <at> gmx.net>
>>
>>	* exceptions.cc (sig_handle_tty_stop): Suspend all
>>	threads on SIGSTOP, resume them on SIGCONT.
> 
> 
> You can't suspend threads like this because SuspendThread can
> hang in some situations, like when a thread is doing I/O.  That's why
> there is a WaitForSingleObject here rather than just suspending the
> thread.

Too bad.

Thomas

Thomas Pfaff | 3 Nov 08:35 2003
Picon
Picon

Re: [PATCH] Fix debugger attach for threads

Christopher Faylor wrote:
> On Fri, Oct 31, 2003 at 10:11:46PM +0100, Thomas Pfaff wrote:
> 
>>This patch allows a debugger to attach when an exception occurs in a 
>>thread other than the mainthread.
>>
>>I am not happy about the wait in handle_exceptions, but it works on my 
>>machine. I think that a waitloop until the debugger is attached is 
>>cleaner, but there must be a reason why the debbugging loop is 
>>implemented this way.
> 
> 
> The intent is for an attached debugger to immediately see the location
> that died.  If you loop in the try_to_debug code then it is a pain to
> figure out exactly where the exception occurred.
> 
> I don't understand why this code is needed.  Why do threads need to
> be suspended and resumed specially?
> 

Because otherwise the debugger does not get enough CPU time until the 
debugging counter exceeds the limit and the process terminates before 
the debugger is attached.

If you think that suspending and resuming threads is a dangerous thing 
than i would at least change the condition to

   if (debugging && !being_debugged ())
     {
       /*
(Continue reading)

Thomas Pfaff | 4 Nov 09:41 2003
Picon
Picon

Re: [PATCH] Fix debugger attach for threads

Christopher Faylor wrote:
> On Fri, Oct 31, 2003 at 10:11:46PM +0100, Thomas Pfaff wrote:
> 
>>This patch allows a debugger to attach when an exception occurs in a 
>>thread other than the mainthread.
>>
>>I am not happy about the wait in handle_exceptions, but it works on my 
>>machine. I think that a waitloop until the debugger is attached is 
>>cleaner, but there must be a reason why the debbugging loop is 
>>implemented this way.
> 
> 
> The intent is for an attached debugger to immediately see the location
> that died.  If you loop in the try_to_debug code then it is a pain to
> figure out exactly where the exception occurred.
> 

I never see immediately the location, i must always continue the program 
to get it.

Anyway, attached is new attempt that does not make use of 
Suspend/ResumeThread and keeps the process running until the debugger is 
attached.

2003-11-04  Thomas Pfaff  <tpfaff <at> gmx.net>

	* exceptions.cc (handle_exceptions): Keep process running when
	debugger is attaching. Give debugger CPU time to attach.
(Continue reading)

Madeline Poe | 5 Nov 17:36 2003

Cygwin-patches Good news regarding the economy minmq

Cygwin-patches Don't let time run out

http://www.eloanquote.net/freequote.aspx?siteid=netmarketing-110

Cease:

http://freeloanquote.net/opt-out/

vunnq nghvdokzzcpsgmbhlp i qegmwc k tit
hvxroiwomme hjgmfwj jnlvy
Pierre A. Humblet | 6 Nov 02:02 2003
Picon

Re: [Patch]: Fixing the PROCESS_DUP_HANDLE security hole (part 1).

Ping? 

This has been pending for a while. See also
<http://cygwin.com/ml/cygwin-patches/2003-q4/msg00003.html>

Pierre

At 09:55 PM 9/29/2003 -0400, Pierre A. Humblet wrote:
>Here is a patch that allows to open master ttys without giving
>full access to the process, at least for access to the ctty. 
>
>It works by snooping the ctty pipe handles and duplicating them
>on the cygheap, for use by future opens in descendant processes.
>
>It passes all the tests I tried, but considering my lack of knowledge
>about ttys, everything is possible.
>
>Pierre
>
>
>2003-09-29  Pierre Humblet <pierre.humblet <at> ieee.org>
>
>	* cygheap.h (class cygheap_ctty): Create.
>	(struct init_cygheap): Add inherited_ctty member.
>	* cygheap.cc: Include pinfo.h.
>	(cygheap_ctty::acquire): Create.
>	(cygheap_ctty::pass): Ditto.
>	(cygheap_ctty::close): Ditto.
>	* fhandler_tty.cc (fhandler_tty_slave::open): Call
>	cygheap->inherited_ctty.pass and cygheap->inherited_ctty.acquire.
(Continue reading)

Ian Ray | 6 Nov 14:15 2003
Picon

[Patch] fhandler_disk_file::opendir memory leak

The attached patch fixes possible memory leak in
fhandler_disk_file::opendir.

Blue skies,
Ian

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk
2003-11-06  Ian Ray  <ran_iay <at> yahoo.com>

	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Guard against
	memory leak.

--- fhandler_disk_file.1.67	2003-11-06 14:48:48.959065000 +0200
+++ fhandler_disk_file.cc	2003-11-06 14:48:18.543510000 +0200
 <at>  <at>  -605,7 +605,7  <at>  <at>  fhandler_disk_file::lock (int cmd, struc
 DIR *
 fhandler_disk_file::opendir ()
 {
-  DIR *dir;
+  DIR *dir = NULL;
   DIR *res = NULL;
   size_t len;

 <at>  <at>  -613,26 +613,14  <at>  <at>  fhandler_disk_file::opendir ()
     set_errno (ENOTDIR);
(Continue reading)

Ian Ray | 6 Nov 14:29 2003
Picon

Re: [Patch] fhandler_disk_file::opendir memory leak

Oops. Typo. Retry.

________________________________________________________________________
Want to chat instantly with your online friends?  Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk
2003-11-06  Ian Ray  <ran_iay <at> yahoo.com>

	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Guard against
	memory leak.

--- fhandler_disk_file.1.67	2003-11-06 14:48:48.959065000 +0200
+++ fhandler_disk_file.cc	2003-11-06 15:28:21.081920000 +0200
 <at>  <at>  -605,7 +605,7  <at>  <at>  fhandler_disk_file::lock (int cmd, struc
 DIR *
 fhandler_disk_file::opendir ()
 {
-  DIR *dir;
+  DIR *dir = NULL;
   DIR *res = NULL;
   size_t len;

 <at>  <at>  -613,26 +613,14  <at>  <at>  fhandler_disk_file::opendir ()
     set_errno (ENOTDIR);
   else if ((len = strlen (pc))> MAX_PATH - 3)
     set_errno (ENAMETOOLONG);
-  else if ((dir = (DIR *) malloc (sizeof (DIR))) == NULL)
+  else if ((dir = (DIR *) calloc (1, sizeof (DIR))) == NULL)
(Continue reading)

Christopher Faylor | 6 Nov 16:19 2003
Picon

Re: [Patch] fhandler_disk_file::opendir memory leak

On Thu, Nov 06, 2003 at 01:29:23PM +0000, Ian Ray wrote:
>Oops. Typo. Retry.

Thanks for the patch.  I noticed this yesterday when I was hacking on
this function and I fixed it in a different way after I checked in my
access_worker change.  I haven't checked it in yet since I can't check
my changes right now as I'm away from my system.

cgf

>2003-11-06  Ian Ray  <ran_iay <at> yahoo.com>
>
>	* fhandler_disk_file.cc (fhandler_disk_file::opendir): Guard against
>	memory leak.
>

Christopher Faylor | 6 Nov 16:32 2003

Re: [Patch]: Fixing the PROCESS_DUP_HANDLE security hole (part 1).

On Wed, Nov 05, 2003 at 08:02:01PM -0500, Pierre A. Humblet wrote:
>Ping? 
>
>This has been pending for a while. See also
><http://cygwin.com/ml/cygwin-patches/2003-q4/msg00003.html>

I haven't forgotten about it.  Unfortunately, in quick scans, the
implementation gives me heartburn.  That doesn't mean that this isn't
the correct way to do this, it just means that my initial gut feeling
is negative.

So, I haven't had much time to give this the attention it deserves and
either accept it or offer another alternative.  If it was in anything
other than tty code, it probably wouldn't have languished this long.

Mark Blackburn | 6 Nov 17:57 2003
Picon

[PATCH] : make cygpath use multiple filename arguments

This patch will allow you to do this.

$ ./cygpath.exe -w -a cygpath.cc cygpath.exe
E:\cygwin\usr\src\cygwin-cvs\src\winsup\utils\cygpath.cc
E:\cygwin\usr\src\cygwin-cvs\src\winsup\utils\cygpath.exe

I don't know if this is desired behaviour or not. Personally, I would
find it useful.

Mark Blackburn

Index: src/winsup/utils/cygpath.cc
===================================================================
RCS file: /cvs/src/src/winsup/utils/cygpath.cc,v
retrieving revision 1.31
diff -u -p -r1.31 cygpath.cc
--- src/winsup/utils/cygpath.cc	17 Oct 2003 17:20:06 -0000	1.31
+++ src/winsup/utils/cygpath.cc	6 Nov 2003 15:36:05 -0000
 <at>  <at>  -675,11 +675,13  <at>  <at>  main (int argc, char **argv)
       if (output_flag)
 	dowin (o);

-      if (optind != argc - 1)
+      if (optind > argc - 1)
 	usage (stderr, 1);

-      filename = argv[optind];
-      doit (filename);
(Continue reading)


Gmane