Re: [Mono-list] Re: [Mono-cvs-list] Mono CVS: mono martin

2003-01-18 Thread Martin Baulig
Paolo Molaro [EMAIL PROTECTED] writes:

   Log message:
   2003-01-16  Martin Baulig  [EMAIL PROTECTED]
   
   * jit.c (mono_runtime_install_handlers): Use SYS_sigaction() for
   the mono_thread_get_abort_signal () - this is SIGUSR1 on FreeBSD
   and the LinuxThreads port doesn't allow you to override the handler.
 
 Why should we use the LinuxThreads port on FreeBSD?
 There must be a very compelling reason not to use the native thread
 library on FreeBSD (like, it's impossible to make it work).

You can only debug multi-threaded applications if they're using LinuxThreads.  The 
problem
is that the debugger needs kernel-level threads, not user-space threads.

The native thread library uses user-space threads and it'd be an extremely huge task to
support this in the debugger - and it'd need to be done for each platform.  If you're
using user-space threads, they're just one single process for the kernel.

On the other hand, LinuxThreads is already ported to FreeBSD and OpenBSD and it'll
probably also work on NetBSD and other flavors of BSD, so we get the debugger easily
ported to these platforms.  It's using rfork() to create a new kernel process for each
thread, so the debugger can ptrace(PT_ATTACH) to them.

-- 
Martin Baulig
[EMAIL PROTECTED]
[EMAIL PROTECTED]

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list



Re: [Mono-list] Re: [Mono-cvs-list] Mono CVS: mono martin

2003-01-17 Thread Paolo Molaro
  Log message:
  2003-01-16  Martin Baulig  [EMAIL PROTECTED]
  
  * jit.c (mono_runtime_install_handlers): Use SYS_sigaction() for
  the mono_thread_get_abort_signal () - this is SIGUSR1 on FreeBSD
  and the LinuxThreads port doesn't allow you to override the handler.

Why should we use the LinuxThreads port on FreeBSD?
There must be a very compelling reason not to use the native thread
library on FreeBSD (like, it's impossible to make it work).

lupus

-- 
-
[EMAIL PROTECTED] debian/rules
[EMAIL PROTECTED] Monkeys do it better

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list



[Mono-list] Re: [Mono-cvs-list] Mono CVS: mono martin

2003-01-16 Thread dietmar
I doubt that this is correct, because  libpthreads has its own
implementation of sigaction(), and I think we should call that to ensure
correct behaviour?

- Dietmar

On Thu, 2003-01-16 at 16:38, Martin Baulig wrote:
 CVSROOT:/cvs/public
 Module name:mono
 Changes by: martin  03/01/16 10:38:55
 
 Modified files:
 mono/jit   : ChangeLog jit.c 
 
 Log message:
 2003-01-16  Martin Baulig  [EMAIL PROTECTED]
 
 * jit.c (mono_runtime_install_handlers): Use SYS_sigaction() for
 the mono_thread_get_abort_signal () - this is SIGUSR1 on FreeBSD
 and the LinuxThreads port doesn't allow you to override the handler.
 [FIXME: This avoids an assertion failure on startup, but there's
 still an issue with thread termination.]
 
 
 ___
 Mono-cvs-list maillist  -  [EMAIL PROTECTED]
 http://lists.ximian.com/mailman/listinfo/mono-cvs-list
 


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list



[Mono-list] Re: [Mono-cvs-list] Mono CVS: mono martin

2003-01-16 Thread Martin Baulig
dietmar [EMAIL PROTECTED] writes:

 I doubt that this is correct, because  libpthreads has its own
 implementation of sigaction(), and I think we should call that to ensure
 correct behaviour?

Well, I don't know why this ever worked on Linux without the SYS_sigaction.  From a 
look
at the glibc source code, it should not:

[glibc-2.2.5/linuxthreads/signal.c]=
int __sigaction(int sig, const struct sigaction * act,
  struct sigaction * oact)
{
  struct sigaction newact;
  struct sigaction *newactp;

  if (sig == __pthread_sig_restart ||
  sig == __pthread_sig_cancel ||
  (sig == __pthread_sig_debug  __pthread_sig_debug  0))
{
  __set_errno (EINVAL);
  return -1;
}
  /*  more stuff below  */
}
strong_alias(__sigaction, sigaction)


That's also how it works on FreeBSD - you cannot install a handler for the thread 
restart
and cancel signals.

-- 
Martin Baulig
[EMAIL PROTECTED]
[EMAIL PROTECTED]

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list