incubator-pagespeed-mod
incubator-pagespeed-mod copied to clipboard
Using automated install for Nginx 1.21.3 - Nginx does not start after successfull build and install - Ubuntu Impish
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
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
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
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
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 ;-)
And then I get the same error about pthread_yield ;-)
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.
@oschaaf Maybe apr must be updated?
Same with 22.04 LTS. I have removed pagespeed now from Nginx due to missing maitenance
see https://github.com/apache/incubator-pagespeed-ngx/issues/1743
https://github.com/apache/incubator-pagespeed-ngx/issues/1760
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