Re: shared library problem
On Sun, Feb 07, 1999 at 12:06:59AM +0100, Wichert Akkerman wrote:
> Previously Andrew Pimlott wrote:
> > It shouldn't--your module should attempt to load libgdbm when it is
> > dlopen()'ed, if it's linked with it.
>
> It seems to load libgdm just fine looking at the strace. What I see
> happening is a whole lot of brk() calls and then the segfault..
>
> > Anyway, if this doesn't help, I'll be happy to compare a sample of your code
> > with my experiments (which I did on an x86 slink system).
>
> I've removed all code that isn't necessary to reproduce this, I'll
> attach it to this message. Now lets hope somebody know how to solve
> this..
Well, here's the first step:
#0 0x300faf10 in malloc ()
#1 0x301d665c in open () at module.c:18
#2 0x3021a7e4 in gdbm_open ()
#3 0x301d665c in open () at module.c:18
#4 0x3021a7e4 in gdbm_open ()
#5 0x301d665c in open () at module.c:18
#6 0x3021a7e4 in gdbm_open ()
#7 0x301d665c in open () at module.c:18
#8 0x3021a7e4 in gdbm_open ()
#9 0x301d665c in open () at module.c:18
#10 0x3021a7e4 in gdbm_open ()
I know exactly what the problem is. Using the names open and close is
not a tremendously good idea - unless, of course, you mark them static.
You're overloading libc's open() call. Marking them static removes the
bug.
Dan
/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| CMU, CS class of 2002 |
| Debian GNU/Linux Developer __ Part-Time Systems Programmer |
| dan@debian.org | | drow@cs.cmu.edu |
\--------------------------------/ \--------------------------------/
Reply to: