Michael Felt <aixto...@felt.demon.nl> added the comment:

OK, I have gone as far back as "where" in dbx can bring me.

Could this, somehow, be related with changes made in issue-33015 ?

In any case, does it seem correct that "pthread_wrapper(void *arg) can be 
correct if arg is nil?

  +155  /* bpo-33015: pythread_callback struct and pythread_wrapper() cast
  +156     "void func(void *)" to "void* func(void *)": always return NULL.
  +157
  +158     PyThread_start_new_thread() uses "void func(void *)" type, whereas
  +159     pthread_create() requires a void* return value. */
  +160  typedef struct {
  +161      void (*func) (void *);
  +162      void *arg;
  +163  } pythread_callback;
  +164
  +165  static void *
  +166  pythread_wrapper(void *arg)
  +167  {
  +168      /* copy func and func_arg and free the temporary structure */
  +169      pythread_callback *callback = arg;
  +170      void (*func)(void *) = callback->func;
  +171      void *func_arg = callback->arg;
  +172      PyMem_RawFree(arg);
  +173
  +174      func(func_arg);
  +175      return NULL;
  +176  }

(dbx) print boot
0x2030cab0
(dbx) which boot
_threadmodule.t_bootstrap.boot
(dbx) print boot
0x2030cab0
(dbx) print *boot
(interp = 0x2030cb00, func = 0xcbcbcbcb, args = 0x1018c460, keyw = 0xcbcbcbcb, 
tstate = 0xcbcbcbcb)
(dbx) which arg
thread.pythread_wrapper.arg
(dbx) print arg
(nil)
(dbx) print *arg
reference through nil pointer
(dbx) which callback
thread.pythread_wrapper.callback
(dbx) print callback
0x2030cb00
(dbx) print *callback
(func = 0x2030cb50, arg = 0x35000000)

I am "nervous" when it comes to accepting a value such as 0xcbcbcbcb or 
0xdbdbdbdb as values for pointers to objects - or even "int" or unsigned values 
- look so "specific pattern" like.

Suggestions on how to look at this "better" would be appreciated.

Michael

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35828>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to