D-Bus was driving me crazy but I got this annoying thing to work after all!
It's not perfect yet, but here you are:
*dbus-monitor --system*
>
signal sender=:1.97 -> dest=(null destination) serial=3
> path=/org/netfilter/pgl; interface=org.netfilter.pgl; member=pgld_message
> string "ERROR: Error during nfq_unbind_pf(): Operation not permitted"
> signal sender=:1.97 -> dest=(null destination) serial=4
> path=/org/netfilter/pgl; interface=org.netfilter.pgl; member=pgld_message
> string "ERROR: ERROR binding to queue!"
>
Greetings
Jim
On Wed, Apr 27, 2011 at 11:29 AM, jre <jre-phoenix@...:
> I made backtraces. With dbus.o as prerequisite it segfaults related to
> "strlen". I can't find this though anywhere related to dbus code.
>
> Then I changed to dbus.so (instead of dbus.o) as prerequite of the pgld
> target. Compiles fine, but gives a new error code: 0177
> Here you are right, it can't find the dbus.so. I can't find where this
> is specified in the code (only once mentioned in a commented part).
> I compile with -DPLUGINDIR=\"/usr/lib/pgl\" and install dbus.so to this
> path.
>
> I use "make clean && make && sudo make install"
>
>
> backtrace with dbus.so as prerequisite (error 0177)
> ======================================
> $ sudo gdb --args /usr/sbin/pgld -d -s -l /var/log/pgl/pgld.log -p
> /var/run/pgld.pid -q 92 -r 10 -a 20
> /var/lib/pgl/pglcmd_premerged_blocklist.p2p
> GNU gdb (GDB) 7.2-debian
> Copyright (C) 2010 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /usr/sbin/pgld...done.
> (gdb) run
> Starting program: /usr/sbin/pgld -d -s -l /var/log/pgl/pgld.log -p
> /var/run/pgld.pid -q 92 -r 10 -a 20
> /var/lib/pgl/pglcmd_premerged_blocklist.p2p
> /usr/sbin/pgld: error while loading shared libraries: src/dbus.so:
> cannot open shared object file: No such file or directory
>
> Program exited with code 0177.
> (gdb) quit
>
>
>
> backtrace with dbus.o as prerequisite (error 139 if started without gdb)
> =====================================
> $ sudo gdb --args /usr/sbin/pgld -d -s -l /var/log/pgl/pgld.log -p
> /var/run/pgld.pid -q 92 -r 10 -a 20
> /var/lib/pgl/pglcmd_premerged_blocklist.p2p
> GNU gdb (GDB) 7.2-debian
> Copyright (C) 2010 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>...
> Reading symbols from /usr/sbin/pgld...done.
> (gdb) run
> Starting program: /usr/sbin/pgld -d -s -l /var/log/pgl/pgld.log -p
> /var/run/pgld.pid -q 92 -r 10 -a 20
> /var/lib/pgl/pglcmd_premerged_blocklist.p2p
> [Thread debugging using libthread_db enabled]
>
> Program received signal SIGSEGV, Segmentation fault.
> __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:31
> 31 ../sysdeps/x86_64/multiarch/../strlen.S: No such file or directory.
> in ../sysdeps/x86_64/multiarch/../strlen.S
> (gdb) quit
> A debugging session is active.
>
> Inferior 1 [process 5277] will be killed.
>
> Quit anyway? (y or n) y
>
>
>
>
>
> On 04/27/2011 03:15 AM, JPV wrote:
> > Sorry, I should have said dynamic loading instead of dynamic linking.
> > Let me know if that helps.
> >
> > On 27-Apr-11 2:10, JPV wrote:
> >> Error 139 is kind of cryptic, but I would hazard a guess that it means
> >> pgld can't find dbus.so for dynamic linking at runtime.
> >>
> >> On 27-Apr-11 1:12, jre wrote:
> >>> Thanks, that helped.
> >>>
> >>> I still need to add dbus.o as prerequisite of the target src/pgld and
> >>> also CFLAGS to the command. Then pgld and dbus.so both compile fine.
> >>>
> >>> But then, if I start pgld with the option "-d" (enable dbus), pgld
> fails
> >>> to start (error 139). I hope this is just because not all dbus code is
> >>> reenabled. It works flawless without the option "-d".
> >>>
> >>> When I don't add dbus.o and CFLAGS, the binary pgld fails to build with
> >>> the old error.
> >>>
> >>> Code commited to branch dbus.
> >>>
> >>> On 04/26/2011 09:31 PM, JPV wrote:
> >>>> You need to pass the --libs flags to pkg-config to link the object
> >>>> code.
> >>>>
> >>>> Regards,
> >>>>
> >>>> jpv
> >>>>
> >>>> On 26-Apr-11 19:07, jre wrote:
> >>>>> [Public answer]
> >>>>>
> >>>>> Help!
> >>>>>
> >>>>> jim and I tried to reenable dbus for pgld, but we are just stuck :-/
> >>>>> The code is on the new dbus branch.
> >>>>> (just do a "git pull" and then "git checkout dbus")
> >>>>>
> >>>>> Somehow the dbus functions don't get linked. This happens
> >>>>> independently
> >>>>> whether we compile a dbus.o directly or as shared object dbus.so and
> >>>>> although IMHO they seem to be correctly referenced in the header
> >>>>> files.
> >>>>>
> >>>>> Any help welcome!
> >>>>>
> >>>>> For dbus.so (current commit on dbus branch) we get:
> >>>>> peerguardian/pgl$ make
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/pgld.o -c src/pgld.c
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/stream.o -c src/stream.c
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/blocklist.o -c src/blocklist.c
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/parser.o -c src/parser.c
> >>>>> gcc -o src/pgld -ggdb3 src/pgld.o src/stream.o src/blocklist.o
> >>>>> src/parser.o -lnetfilter_queue -lnfnetlink -lz -ldl
> >>>>> /usr/bin/ld: src/pgld.o: in function do_log:src/pgld.c:84: error:
> >>>>> undefined reference to 'pgl_dbus_send'
> >>>>> collect2: ld returned 1 exit status
> >>>>>
> >>>>>
> >>>>> For dbus.o (previous commit on dbus branch) we get:
> >>>>> peerguardian/pgl$ make
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/pgld.o -c src/pgld.c
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/stream.o -c src/stream.c
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/blocklist.o -c src/blocklist.c
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/parser.o -c src/parser.c
> >>>>> gcc -Wall -DVERSION=\"git\" -DPACKAGE_NAME=\"pgl\"
> >>>>> -DPIDFILE=\"/var/run/pgld.pid\" -DHAVE_ZLIB -DHAVE_DBUS `pkg-config
> >>>>> dbus-1 --cflags` -fPIC -DPLUGINDIR=\"/usr/lib/pgl\" -ggdb3 -O0 -o
> >>>>> src/dbus.o -c src/dbus.c
> >>>>> gcc -o src/pgld -ggdb3 src/pgld.o src/stream.o src/blocklist.o
> >>>>> src/parser.o src/dbus.o -lnetfilter_queue -lnfnetlink -lz -ldl
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_init:src/dbus.c:37:
> >>>>> error:
> >>>>> undefined reference to 'dbus_error_init'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_init:src/dbus.c:38:
> >>>>> error:
> >>>>> undefined reference to 'dbus_bus_get'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_init:src/dbus.c:39:
> >>>>> error:
> >>>>> undefined reference to 'dbus_error_is_set'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_init:src/dbus.c:41:
> >>>>> error:
> >>>>> undefined reference to 'dbus_error_free'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_init:src/dbus.c:50:
> >>>>> error:
> >>>>> undefined reference to 'dbus_bus_request_name'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_init:src/dbus.c:52:
> >>>>> error:
> >>>>> undefined reference to 'dbus_error_is_set'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_init:src/dbus.c:54:
> >>>>> error:
> >>>>> undefined reference to 'dbus_error_free'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_send:src/dbus.c:74:
> >>>>> error:
> >>>>> undefined reference to 'dbus_message_new_signal'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_send:src/dbus.c:80:
> >>>>> error:
> >>>>> undefined reference to 'dbus_message_iter_init_append'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_send:src/dbus.c:81:
> >>>>> error:
> >>>>> undefined reference to 'dbus_message_iter_append_basic'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_send:src/dbus.c:85:
> >>>>> error:
> >>>>> undefined reference to 'dbus_connection_send'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_send:src/dbus.c:89:
> >>>>> error:
> >>>>> undefined reference to 'dbus_connection_flush'
> >>>>> /usr/bin/ld: src/dbus.o: in function pgl_dbus_send:src/dbus.c:90:
> >>>>> error:
> >>>>> undefined reference to 'dbus_message_unref'
> >>>>> collect2: ld returned 1 exit status
> >>>>>
> >>>>>
> ------------------------------------------------------------------------------
> >>>>>
> >>>>>
> >>>>> WhatsUp Gold - Download Free Network Management Software
> >>>>> The most intuitive, comprehensive, and cost-effective network
> >>>>> management toolset available today. Delivers lowest initial
> >>>>> acquisition cost and overall TCO of any competing solution.
> >>>>> http://p.sf.net/sfu/whatsupgold-sd
> >>>>> _______________________________________________
> >>>>> Peerguardian-devel mailing list
> >>>>> Peerguardian-devel@...
> >>>>> https://lists.sourceforge.net/lists/listinfo/peerguardian-devel
> >>>
> >>>
> ------------------------------------------------------------------------------
> >>>
> >>> WhatsUp Gold - Download Free Network Management Software
> >>> The most intuitive, comprehensive, and cost-effective network
> >>> management toolset available today. Delivers lowest initial
> >>> acquisition cost and overall TCO of any competing solution.
> >>> http://p.sf.net/sfu/whatsupgold-sd
> >>> _______________________________________________
> >>> Peerguardian-devel mailing list
> >>> Peerguardian-devel@...
> >>> https://lists.sourceforge.net/lists/listinfo/peerguardian-devel
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > WhatsUp Gold - Download Free Network Management Software
> > The most intuitive, comprehensive, and cost-effective network
> > management toolset available today. Delivers lowest initial
> > acquisition cost and overall TCO of any competing solution.
> > http://p.sf.net/sfu/whatsupgold-sd
> > _______________________________________________
> > Peerguardian-devel mailing list
> > Peerguardian-devel@...
> > https://lists.sourceforge.net/lists/listinfo/peerguardian-devel
>
>
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today. Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Peerguardian-devel mailing list
> Peerguardian-devel@...
> https://lists.sourceforge.net/lists/listinfo/peerguardian-devel
>
--
"The man who trades freedom for security does not deserve nor will he ever
receive either."
-Benjamin Franklin
|