Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Using automated install for Nginx 1.21.3 - Nginx does not start after successfull build and install - Ubuntu Impish #2083

Open
nemihome opened this issue Oct 4, 2021 · 11 comments

Comments

@nemihome
Copy link

nemihome commented Oct 4, 2021

sudo nginx -t
nginx: [emerg] dlopen() "/usr/lib/nginx/modules/ngx_pagespeed.so" failed (/usr/lib/nginx/modules/ngx_pagespeed.so: undefined symbol: pthread_mutex_consistent_np) in /etc/nginx/modules-enabled/50-mod-pagespeed.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

Content of /etc/nginx/modules-enabled/50-mod-pagespeed.conf
load_module modules/ngx_pagespeed.so;

Nginx Error log:
2021/10/04 15:52:07 [emerg] 68172#0: dlopen() "/usr/lib/nginx/modules/ngx_pagespeed.so" failed (/usr/lib/nginx/modules/ngx_pagespeed.so: undefined symbol: pthread_mutex_consistent_np) in /etc/nginx/modules-enabled/50-mod-pagespeed.conf:1

@Lofesa
Copy link
Contributor

Lofesa commented Oct 4, 2021

Hi
As far as I can see, pthread_mutex_consistent_np is defined in pthread.h file, provided by OS.
In a Centos 7 distro the path is /usr/include/pthread.h

@nemihome
Copy link
Author

nemihome commented Oct 4, 2021

Hi, ok, the error message sounds like it is included in pagespeed.so. So what's the problem? Is pagespeed.so using something which is depreciated or is this a bug in the new pthread.h version?

Ubuntu 21.10 (relevant part):

extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
     __THROW __nonnull ((1));
# ifdef __USE_GNU
#  ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *),
			   pthread_mutex_consistent) __nonnull ((1))
  __attribute_deprecated_msg__ ("\
pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent");
#  else
#   define pthread_mutex_consistent_np pthread_mutex_consistent
#  endif
# endif
#endif

Ubuntu 20.04:

/* Declare the state protected by MUTEX as consistent.  */
extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
     __THROW __nonnull ((1));
# ifdef __USE_GNU
extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
     __THROW __nonnull ((1));
# endif
#endif

@Lofesa
Copy link
Contributor

Lofesa commented Oct 4, 2021

Hi
Pagespeed uses #includes <pthread.h> and maybe (I don´t know) uses this function, if in new version is deprecated.... maybe @oschaaf must take a look

P.D. Have you tried to compile in an older Ubuntu version?

P.D 1: Seems is deprecated in GNU C Library version 2.34 released 1/08/2021

@eilandert
Copy link

If the function is just renamed from pthread_mutex_consistent_np to pthread_mutex_consistent you should be able to do
sed -i s/"pthread_mutex_consistent_np"/"pthread_mutex_consistent"/g third_party/apr/src/locks/unix/proc_mutex.c

It seems I have the same problem, I can't compile PSOL on Impish, so I am going to try this ;-)

@eilandert
Copy link

And then I get the same error about pthread_yield ;-)

@eilandert
Copy link

Ok, on modern libc you can execute the following when building PSOL:
sed -i -r 's/sys_siglist[signum]/strsignal(signum)/g' third_party/apr/src/threadproc/unix/signals.c
sed -i s/"pthread_mutex_consistent_np"/"pthread_mutex_consistent"/g third_party/apr/src/locks/unix/proc_mutex.c
sed -i s/"define HAVE_PTHREAD_YIELD 1"/"define HAVE_PTHREAD_YIELD 0"/g third_party/apr/gen/arch/linux/x64/include/apr_private.h

Got a running Impish NGINX with pagespeed now.

@Lofesa
Copy link
Contributor

Lofesa commented Oct 14, 2021

@oschaaf Maybe apr must be updated?

@nemihome
Copy link
Author

nemihome commented Apr 9, 2022

Same with 22.04 LTS. I have removed pagespeed now from Nginx due to missing maitenance

@eilandert
Copy link

@eilandert
Copy link

@fredddie91
Copy link

Hello Guys, any help in fixing the problem?

"nginx: [emerg] dlopen() "/usr/share/nginx/modules/ngx_pagespeed.so" failed (/usr/share/nginx/modules/ngx_pagespeed.so: undefined symbol: pthread_mutex_consistent_np) in /etc/nginx/nginx.conf:2
nginx: configuration file /etc/nginx/nginx.conf test failed"

I am running nginx version: nginx/1.22.1 and ubuntu version 22.04.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants