[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#204981: libc6: vmware workaround



Package: libc6
Version: 2.3.2-3
Followup-For: Bug #204981

gotom:

Thanks for maintaining this package!
Here's some more information about this problem that might help you solve the problem in glibc (i think there is one there).

After spending hours trying to track this down I thought maybe I could save somebody else some effort ...

Petr Vandrovec posted this in
vmware.for-linux.experimental

>But glibc developers should think about it... I believe that it dies because of part
>of patch/10_cvs.patch which introduces _IO_old_init. Due to this mode & wide_* is now
>uninitialized, and _IO_default_seekpos in libio/genpos.c sigsegvs instead of invoking
>old _IO_old_seekoff.

He suggests this fix

#define _GNU_SOURCE
#include <dlfcn.h>
#include <errno.h>
#include <stdio.h>

FILE* fopen(const char* path, const char* attr) {
         FILE* (*old_fopen)(const char* path, const char* attr) = NULL;

         if (old_fopen == NULL) {
                 old_fopen = dlsym(RTLD_NEXT, "fopen");
                 if (!old_fopen) {
                         errno = ENOSYS;
                         return NULL;
                 }
         }
         return old_fopen(path, attr);
}
ppc:/mnt/vmware/xx# gcc -o fopen.so -shared fopen.c -W -Wall
ppc:/mnt/vmware/xx# cp fopen.so /usr/lib
ppc:/mnt/vmware/xx# LD_PRELOAD=fopen.so vmware

Compiling and running that overrides the fopen call from libc6 I think.
This solution works around the problem for me.

(thanks petr!)

brad

-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux up 2.4.21 #2 Thu Aug 21 22:21:57 EDT 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages libc6 depends on:
ii  libdb1-compat                 2.1.3-7    The Berkeley database routines [gl

-- no debconf information




Reply to: