Project

General

Profile

Bug #15072

thread.c:4356:5: error: implicit declaration of function ‘ubf_list_atfork’

Added by duerst (Martin Dürst) 8 months ago. Updated 7 months ago.

Status:
Open
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-08-01 trunk 64156) [x86_64-cygwin]
[ruby-core:88844]

Description

When compiling on cygwin, I get the following error:

compiling thread.c
thread.c: In function ‘rb_thread_atfork_internal’:
thread.c:4356:5: error: implicit declaration of function ‘ubf_list_atfork’ [-Werror=implicit-function-declaration]
     ubf_list_atfork();
     ^~~~~~~~~~~~~~~

The ubf_list_atfork function was introduced by issue #15013 in r64485.

The problem is that the function is defined as static in thread_pthread.c, but is used in thread.c. Not being an expert on threads, I thought that maybe ubf_list_atfork is a function that's available on some OSes, but that can't be the case. I only got empty results when searching for it.

There's also a macro for ubf_list_atfork in thread_win32.c, but that doesn't seem to be related here.

[below it says my Ruby version is trunk 64156, but I'm compiling on HEAD.]


Related issues

Related to Ruby trunk - Bug #15130: Nested Timeouts hang on cygwinClosedActions

History

Updated by normalperson (Eric Wong) 8 months ago

duerst@it.aoyama.ac.jp wrote:

https://bugs.ruby-lang.org/issues/15072

I think copying the macro for win32 for the !USE_UBF_LIST
case should work(*). Can you test and commit if it works?
(too tired and might not be back online soon)

 diff --git a/thread_pthread.c b/thread_pthread.c
 index 0159b65291..2fc8f1d681 100644
 --- a/thread_pthread.c
 +++ b/thread_pthread.c
 @@ -1379,7 +1379,8 @@ ubf_wakeup_all_threads(void)
  #define ubf_select 0
 static void ubf_wakeup_all_threads(void) { return; }
 static int ubf_threads_empty(void) { return 1; }
 +#define ubf_list_atfork() do {} while (0)
  #endif /* USE_UBF_LIST */

  #define TT_DEBUG 0
  #define WRITE_CONST(fd, str) (void)(write((fd),(str),sizeof(str)-1)<0)

Something similar for ubf_timer_disarm() might be needed, too.

(*) Because ubf_list stuff is disabled on Cygwin (Not sure why,
it's always been that way):

#if defined(SIGVTALRM) && !defined(CYGWIN)
# define USE_UBF_LIST 1
#endif

Updated by duerst (Martin Dürst) 8 months ago

  • Status changed from Open to Closed

That fix worked, thanks! Committed with r64635, okay on travis, not sure about other CIs.

#3

Updated by duerst (Martin Dürst) 7 months ago

  • Related to Bug #15130: Nested Timeouts hang on cygwin added

Updated by duerst (Martin Dürst) 7 months ago

  • Status changed from Closed to Open

duerst (Martin Dürst) wrote:

That fix worked, thanks! Committed with r64635, okay on travis, not sure about other CIs.

Sorry for reopening. It seemed to work, but it left #15130. So I'm reopening this.

The issue here started with the commit at r64485.

Any help appreciated!

Also available in: Atom PDF