From owner-freebsd-questions@FreeBSD.ORG Sat Jun 21 15:09:01 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8107937B401 for ; Sat, 21 Jun 2003 15:09:01 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDBB043FAF for ; Sat, 21 Jun 2003 15:09:00 -0700 (PDT) (envelope-from mbsd@pacbell.net) Received: from atlas (adsl-64-165-199-152.dsl.snfc21.pacbell.net [64.165.199.152]) by mta7.pltn13.pbi.net (8.12.9/8.12.3) with ESMTP id h5LM90Km011036; Sat, 21 Jun 2003 15:09:00 -0700 (PDT) Date: Sat, 21 Jun 2003 15:09:00 -0700 (PDT) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= X-X-Sender: mikko@atlas.home To: Joe Kelsey In-Reply-To: <3EF20AC1.10607@mail.flyingcroc.net> Message-ID: <20030621145149.I10158@atlas.home> References: <3EF20AC1.10607@mail.flyingcroc.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: questions@freebsd.org Subject: Re: flashpluginwrapper for Flash 6 (Shared Library Tools redux) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jun 2003 22:09:01 -0000 On Thu, 19 Jun 2003, Joe Kelsey wrote: > Ok. I hand-modified the linux-flashplugin6 shared library to remove all > of the DT_NEEDED entries. I then modified flashpluginwrapper to add the > following functions: [ ... snip wrapper functions ... ] > I installed this new version of flashpluginwrapper, installed the > linux-flashplugin6 library in browser_plugins. Now, the Flash 6 code > segfaults in pthread_mutex_init(), called from > > Program received signal SIGSEGV, Segmentation fault. > 0x284549d6 in pthread_mutex_init () from /usr/lib/libc_r.so.4 > (gdb) bt > #0 0x284549d6 in pthread_mutex_init () from /usr/lib/libc_r.so.4 > #1 0x298016b0 in MPCriticalSection::MPCriticalSection () > from /usr/X11R6/lib/browser_plugins/libflashplayer.so [ ... snip rest of stack trace ... ] > Anyone familiar enough with Mozilla internals to understand why > pthread_mutex_init segfaults? Has Mozilla started its own threads by > the time it loads the libraries? I don't know where to look to track > this down. Maybe a difference between Linux and FreeBSD in the pthread > semantics? If the flash plugin is making direct calls to pthread functions, you'll probably have to provide some sort of compatibility wrappers for those as well, as the pthreads interface make use of lots of implementation specific data types supplied by the caller. These types are not likely to have the same definitions in Linux and FreeBSD. Check the documentation of all pthread* functions referenced in the plugin, then find out the definitions of the types of their arguments from pthread.h on each platform. For example: pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr); On FreeBSD, pthread_mutex_t and pthread_mutexattr_t are pointers, on Linux they are structs. $.02, /Mikko