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

Re: shared library problem



Wichert Akkerman wrote:
> I've encountered a slight problem while working on dpkg-db that I don't
> know how to fix. Here is the situation: I have an executable that loads a
> library, which uses libgdbm. Here is how I compile it:
> 
> [thunder;~/cm]-18> make
> gcc -Wall -g -shared -o module.so module.c -lc -lgdbm
> chmod a-x module.so
> gcc -Wall -g -o main main.c -ldl
> 
> Now when I run this things go wrong:
> 
> [thunder;~/cm]-19> ./main 
> Initializing
> Segmentation fault (core dumped)
> Exit 139
> 
> What happens is that main calls a function in the module which prints the
> text "Initializing", which works. Then it calls another function that uses
> something from libgdbm. And then the shit hits the fan..

Are you using ldopen() to open your module with on a libc6 system (not
libc6.1) ?


 -Remco


Reply to: