psgi_plugin.so: undefined symbol: boot_DynaLoader

Bug #1024528 reported by Janne Snabb
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
uwsgi (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
Unassigned

Bug Description

Impact:
It appears that uwsgi-plugin-psgi does not load libperl.so and therefore the package is unusable.

Fix: the psgi plugin uses LDFLAGS to link with libraries so they are ordered wrong on the command line (due to ld --as-needed) so it ends up not linking against them at all.
the fix is to add the libraries to LIBS
The same fix is applied in upstream and quantal.

TESTCASE:

1. # apt-get install uwsgi uwsgi-plugin-psgi

2. # vi /etc/uwsgi/apps-available/test.yaml
Put the following contents there:
---cut-here---
uwsgi:
  plugins: psgi
  psgi: /dev/null
---cut-here---

3. # ln -s /etc/uwsgi/apps-available/test.yaml /etc/uwsgi/apps-enabled/

4. # service uwsgi restart

5. # less /var/log/uwsgi/app/test.log
Observe the following error message: /usr/lib/uwsgi/plugins/psgi_plugin.so: undefined symbol: boot_DynaLoader

The problem is obvious when looking at the uwsgi plugin file with ldd:
$ ldd /usr/lib/uwsgi/plugins/psgi_plugin.so
 linux-vdso.so.1 => (0x00007fff395ff000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2f4a70d000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2f4a4f0000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f2f4acfe000)

Compare the ldd output of the fixed plugin:
$ ldd /usr/lib/uwsgi/plugins/psgi_plugin.so
        linux-vdso.so.1 => (0x00007fffa33ff000)
        libperl.so.5.14 => /usr/lib/libperl.so.5.14 (0x00007fbf47482000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fbf47265000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fbf46ea7000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fbf46ca3000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fbf469a9000)
        libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007fbf4676f000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fbf47a13000)

Regression potential:
only a change in the linking of a single plugin and the plugin is unusable without the fix
low risk of regressions

rest of original report:
It does not load the perl shared library!

As a workaround I retrieved the current source package version 1.2.3+dfsg-2~experimental1 from Debian and built it on Ubuntu precise. It works fine (and gives excellent PSGI performance :).

The working version of the plugin depends on libperl.so while the non-working version does not.

I think the problem has been fixed by this upstream commit:
https://github.com/unbit/uwsgi/commit/15aaddb4d306912c2cb570cb47a82a68b900a27a

See the changes in plugins/psgi/uwsgiplugin.py

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: uwsgi-plugin-psgi 1.0.3+dfsg-1
ProcVersionSignature: Ubuntu 3.2.0-25.40-generic 3.2.18
Uname: Linux 3.2.0-25-generic x86_64
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
Date: Sat Jul 14 01:57:46 2012
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110920.2)
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: uwsgi
UpgradeStatus: Upgraded to precise on 2012-04-27 (77 days ago)

Revision history for this message
Janne Snabb (snabb) wrote :
Revision history for this message
Julian Taylor (jtaylor) wrote :

the issue seems fixed in quantals 1.2.3+dfsg-1 too

Changed in uwsgi (Ubuntu):
status: New → Fix Released
Revision history for this message
Julian Taylor (jtaylor) wrote :

thanks for the report and link to the patch.

I have uploaded a fixed package to -proposed
please test it when it has been accepted.

description: updated
description: updated
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Janne, or anyone else affected,

Accepted uwsgi into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/uwsgi/1.0.3+dfsg-1ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in uwsgi (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Janne Snabb (snabb) wrote :

Hi,

I installed 1.0.3+dfsg-1ubuntu0.1 from precise-proposed and looks like it is working fine.

My PSGI app was loaded successfully:

Tue Jul 17 08:12:13 2012 - PSGI app 0 (/www/test/TestApp/bin/app.pl) loaded at 0x176d038

And nginx can successfully request a page from it:

[pid: 28119|app: -1|req: -1/1] 124.248.XXX.XXX () {44 vars in 679 bytes} [Tue Jul 17 08:13:19 2012] GET / => generated 5373 bytes in 139 msecs (HTTP/1.0 200) 4 headers in 143 bytes (0 switches on core 0)

Thank you!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Janne Snabb (snabb) wrote :

I forgot to add a successfull test case result which matches the original simple test case.

The test case in the bug description can be now verified by observing the following in /var/log/uwsgi/app/test.log:

Tue Jul 17 22:06:05 2012 - PSGI app 0 (/dev/null) loaded at 0x105ed18
Tue Jul 17 22:06:05 2012 - *** uWSGI is running in multiple interpreter mode ***
Tue Jul 17 22:06:05 2012 - spawned uWSGI master process (pid: 6590)
Tue Jul 17 22:06:05 2012 - spawned uWSGI worker 1 (pid: 6592, cores: 1)
Tue Jul 17 22:06:05 2012 - spawned uWSGI worker 2 (pid: 6593, cores: 1)

We can see that the PSGI now starts successfully (our test app "/dev/null" is not very useful though :).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package uwsgi - 1.0.3+dfsg-1ubuntu0.1

---------------
uwsgi (1.0.3+dfsg-1ubuntu0.1) precise-proposed; urgency=low

  * psgi-link-fix.patch:
    fix linking of psgi plugin with the perl libraries (LP: #1024528)
 -- Julian Taylor <email address hidden> Sat, 14 Jul 2012 18:21:33 +0200

Changed in uwsgi (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.