incubator-pagespeed-mod icon indicating copy to clipboard operation
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

Open nemihome opened this issue 4 years ago • 11 comments

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

nemihome avatar Oct 04 '21 13:10 nemihome

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

Lofesa avatar Oct 04 '21 17:10 Lofesa

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

nemihome avatar Oct 04 '21 18:10 nemihome

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

Lofesa avatar Oct 04 '21 18:10 Lofesa

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 avatar Oct 13 '21 13:10 eilandert

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

eilandert avatar Oct 13 '21 13:10 eilandert

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.

eilandert avatar Oct 13 '21 14:10 eilandert

@oschaaf Maybe apr must be updated?

Lofesa avatar Oct 14 '21 06:10 Lofesa

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

nemihome avatar Apr 09 '22 14:04 nemihome

see https://github.com/apache/incubator-pagespeed-ngx/issues/1743

eilandert avatar Apr 09 '22 19:04 eilandert

https://github.com/apache/incubator-pagespeed-ngx/issues/1760

eilandert avatar Sep 29 '22 21:09 eilandert

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

fredddie91 avatar Oct 29 '22 05:10 fredddie91