nm-openswan dev update - debugging properties library help needed

Hi all,

Just thought I should post a quick update, and post a request for help at the same time.

I'm almost at 0.1a code level. I have several major bugs to fix before I reach that milestone, but once reached, that will be first release.

NM Registers my new DBUS path for the openswan service on startup and the nm-openswan-service handler appears to be stable (finally).

My first and biggest problem has to do with debugging shared libraries with Anjuta/gdb: How do you do it?

I wrote my library to implement the UI to configure a connection, but even though it builds no problem, it won't load for some reason...

The situation is this: when nm-vpn-properties loads, it parses my service file (from /etc/NetworkManager/VPN) and
then tries to load /usr/local/lib/libnm-os-properties.so

but I get this nm_warning output:
Cannot open module '/usr/local/lib/libnm-os-properties'

--> yes I checked for type-o's and spelling mistakes ;)

--> I ran 'strace nm-vpn-properties' to find out what's failing, and it does find the library and opens it succesfully:

brk(0x9599000)                          = 0x9599000
open("/etc/NetworkManager/VPN/nm-openswan-service.name", O_RDONLY|O_LARGEFILE) = 14
fstat64(14, {st_mode=S_IFREG|0644, st_size=220, ...}) = 0
read(14, "[VPN Connection]\nname=openswan\ns"..., 4096) = 220
read(14, "", 4096)                      = 0
close(14)                               = 0
stat64("/usr/local/lib/libnm-os-properties", 0xbfe45d4c) = -1 ENOENT (No such file or directory) stat64("/usr/local/lib/libnm-os-properties.so", {st_mode=S_IFREG|0755, st_size=84578, ...}) = 0
open("/usr/local/lib/libnm-os-properties.so", O_RDONLY) = 14
read(14, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340 \0"..., 512) = 512
fstat64(14, {st_mode=S_IFREG|0755, st_size=84578, ...}) = 0

mmap2(NULL, 29652, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 14, 0) = 0x4f6000 mmap2(0x4fd000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 14, 0x7) = 0x4fd000

^-> here's the problem I think... but that's as close as I can get.

My instincts tell me this is a memory allocation error where I'm not initializing or declaring some var before I use it... but that would come back to being able to debug my shared lib.

The mapped memory addresses seem kinda small to me compared with those of the openvpn and vpnc shared libs loaded in the same stack trace. Here's the rest of the relevant trace:

close(14)                               = 0
mprotect(0x4f6000, 28672, PROT_READ|PROT_WRITE) = 0
munmap(0x4f6000, 29652)                 = 0
write(2, "\n** (nm-vpn-properties:7763): WA"..., 98
** (nm-vpn-properties:7763): WARNING **: Cannot open module '/usr/local/lib/libnm-os-properties'
) = 98

So how can I debug my shared-lib and figure out why it's failing to load?

All help appreciated as I've been banging my head against the key-board for days (soon time for a new one).

I've got everything else for basic functionality coded, building and installing fine, but until I can define a connection, testing cannot proceed.

If anyone has any suggestions, please send them asap before I go crazy with this one ;)



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