Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 212850 - Ebuild : www-plugins/nspluginwrapper-0.9.91.5-r1. Errors in shared libraries cause npviewer and npconfig to segfault.
Summary: Ebuild : www-plugins/nspluginwrapper-0.9.91.5-r1. Errors in shared librarie...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-09 18:08 UTC by Jamal Natour
Modified: 2009-08-21 15:06 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
tarball with ebuild and patch (nspluginwrapper-0.9.91.5-r2.tar.bz2,3.88 KB, application/octet-stream)
2008-03-09 18:12 UTC, Jamal Natour
Details
tarball with ebuild and patch (nspluginwrapper-0.9.91.5-r3.tar.bz2,4.97 KB, application/octet-stream)
2008-03-09 19:17 UTC, Jamal Natour
Details
patch to npw-config.c, to prevent segfaults crashing app (0001-check-allocations-for-failure.patch,3.82 KB, patch)
2008-03-09 19:48 UTC, Jamal Natour
Details | Diff
patch to npw-viewer.c, to prevent segfaults crashing app (0002-prevent-segfaults-in-libraries-crashing-npviewer.patch,2.68 KB, patch)
2008-03-09 19:49 UTC, Jamal Natour
Details | Diff
patch to nspluginwrapper-0.9.91.5-r1.ebuild to update to nspluginwrapper-0.9.91.5-r3.ebuild (ebuild-update-to-r3-nspluginwrapper-0.9.91.5-r1.patch,669 bytes, patch)
2008-03-09 19:53 UTC, Jamal Natour
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jamal Natour 2008-03-09 18:08:09 UTC
Fix to nspluginwrapper, 

Problem
[1] Segfaulting libraries crash nspluginwrapper, the libaries _init function segfaults causing sigsegv to be thrown terminating the application as soon as a dlopen() call is made.

Correct two minor malloc related issues.
[2] Dereferencing malloced pointer without checking for validity.
[3] realloc failure case not handled, leaking memory.

Fix:
[1] Fork a new process to test plugins, treating the segfaulting child as simply an unsuitable plugin.
[2] check malloc returns and exit app if malloc() fails.
[3] Rewrote function to simplfy and avoid use of realloc
Comment 1 Jamal Natour 2008-03-09 18:12:28 UTC
Created attachment 145665 [details]
tarball with ebuild and patch

Tarball with updated ebuild including a patch to fix segfaulting.
Comment 2 Jamal Natour 2008-03-09 19:17:35 UTC
Created attachment 145672 [details]
tarball with ebuild and patch

Same issues exists with npw-viewer as previous attachment corrected, this fixes segfaults in npviewer as well as npconfig
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2008-03-09 19:25:00 UTC
We don't want any tarballs; reopen with a plaintext unified diff and exact ebuild name and version the patch is about.
Comment 4 Jamal Natour 2008-03-09 19:46:32 UTC
(In reply to comment #3)
> We don't want any tarballs; reopen with a plaintext unified diff and exact
> ebuild name and version the patch is about.
> 

Is the above correct?
Comment 5 Jamal Natour 2008-03-09 19:48:22 UTC
Created attachment 145676 [details, diff]
patch to npw-config.c, to prevent segfaults crashing app

0001  Added test for allocation of 'dirs' array in function get_mozilla_plugin_dirs()
0002  Added function process_entry()
0003  Added prototype for function process_entry()
0004  Simplifed function process_plugin_dir() with functionality delegated to process_entry()
      previous implementation of process_plugin_dir() had unchecked allocs and leaks memory if realloc fails
       
0005  rewrote is_wrapper_plugin() to fork a child for plugin library testing, thus preventing segfaulting libraries from crashing the app
Comment 6 Jamal Natour 2008-03-09 19:49:45 UTC
Created attachment 145677 [details, diff]
patch to npw-viewer.c, to prevent segfaults crashing app

0001  fork a child for plugin library testing, thus preventing segfaulting libraries from crashing the app
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2008-03-09 19:52:23 UTC
I see... apparently this doesn't belong here but upstream; please forward similar huge patchsets there, we can't maintain this.
Comment 8 Jamal Natour 2008-03-09 19:53:52 UTC
Created attachment 145678 [details, diff]
patch to nspluginwrapper-0.9.91.5-r1.ebuild to update to nspluginwrapper-0.9.91.5-r3.ebuild

adds two new patches to nspluginwrapper-0.9.91.5-r1.ebuild
Comment 9 Jamal Natour 2008-03-09 19:57:54 UTC
I've forwarded this on to the developer listed on the contact page for nspluginwrapper project.

Is there any thing I can do to make it easier for you guys to accept patches, as I modify quite a bit of the code I run.
  

Comment 10 Jamal Natour 2008-03-09 19:59:11 UTC
I've forwarded this on to the developer listed on the contact page for nspluginwrapper project.
 
 Is there any thing I can do to make it easier for you guys to accept patches,
 as I modify quite a bit of the code I run.
 
 
Comment 11 Patrick McLean gentoo-dev 2008-03-09 23:52:40 UTC
Generally we try to keep as close to upstream as possible, as maintaining large packages is not something that we have time to do.

You could become a Gentoo developer and maintain co-maintain projects that you have large patchsets for.

You could also feel fork the project and maintain your own releases, we would be willing to include a separate project with a well defined maintainer.
Comment 12 Jamal Natour 2008-03-15 19:13:44 UTC
I've received no reply from the upstream developer, I don't really have the time to take on an other project, as it is, I'm involved with another open source project that I'm not spending enough time.
 
(In reply to comment #11)
> Generally we try to keep as close to upstream as possible, as maintaining large
> packages is not something that we have time to do.
> 
> You could become a Gentoo developer and maintain co-maintain projects that you
> have large patchsets for.
> 
> You could also feel fork the project and maintain your own releases, we would
> be willing to include a separate project with a well defined maintainer.
> 

Comment 13 R Bar-On 2008-05-23 14:22:47 UTC
Your ebuild works, but running nspluginwrapper -v -i
/usr/lib32/nsbrowser/plugins/libflashplayer.so doesn't install the plugin on my
machine.
Comment 14 Dave Giesler 2008-06-17 08:40:24 UTC
nspluginwrapper with these patches applied will not allow flash player to be installed. 
nspluginwrapper -i -v as in the comment above doesn't report anything, failed or otherwise. Using the -u option it yeilds the following...

"nspluginwrapper: /usr/lib32/nsbrowser/plugins/libflashplayer.so is not a valid nspluginwrapper plugin"

It is a valid file, it works with the pre-patched version (though it crashes often) but it will not install with the patched version.
Comment 15 Patrick McLean gentoo-dev 2009-08-21 15:06:25 UTC
Please try to convince upstream to take these.