Skip to contentSkip to conversation

Problem using netsnmp

Buildroot Chris Smith 3 participants 8 messages Jul 28, 2009 – Aug 24, 2009 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

When I build netsnmp the built snmpd doesn't work on the target. All the other snmp stuff works but I get
lib.so.6 not found when trying to run snmpd.

Anyone have any thoughts? It is as if some linkage to host based libraries has crept in.

#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Chris" == Chris Smith <[email protected]> writes:

hi,

Chris> When I build netsnmp the built snmpd doesn't work on the Chris> target. All the other snmp stuff works but I get lib.so.6 not Chris> found when trying to run snmpd.

Sure that's 'lib.so.6'? That's a fairly strange library name.

Chris> Anyone have any thoughts? It is as if some linkage to host Chris> based libraries has crept in.

What arch are you building for?

What does build_*/staging_dir/*-readelf -x <snmpd> | grep NEEDED give?

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

Sorry that should have been libc.so.6.

Building for i486.

I noticed that snmpd is the only thing in the makefile using MAKE1 to build and that it is the only binary with a problem.

readelf shows
0x00000001 (NEEDED) Shared library:
[libnetsnmpagent.so.15]
0x00000001 (NEEDED) Shared library:
[libnetsnmphelpers.so.15]
0x00000001 (NEEDED) Shared library:
[libnetsnmpmibs.so.15]

 0x00000001 (NEEDED)                     Shared library: [libnetsnmp.so.15]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.0]
 0x00000001 (NEEDED)                     Shared library: 

[libcrypto.so.0.9.8]
0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x00000001 (NEEDED) Shared library: [libc.so.0]

Which looks ok to me. But on the target...

/usr/sbin/snmpd: can't load library 'libc.so.6'

Quoted 19 lines · Peter Korsgaard
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Chris" == Chris Smith <[email protected]> writes:

hi,

Chris> When I build netsnmp the built snmpd doesn't work on the Chris> target. All the other snmp stuff works but I get lib.so.6 not Chris> found when trying to run snmpd.

Sure that's 'lib.so.6'? That's a fairly strange library name.

Chris> Anyone have any thoughts? It is as if some linkage to host Chris> based libraries has crept in.

What arch are you building for?

What does build_*/staging_dir/*-readelf -x <snmpd> | grep NEEDED give?

Signature · 5 lines
--------------------------------------------------------------------
TANDBERG Telecom UK Ltd
Registered in England and Wales No: 3390345. 
Registered address: 
Unit 2 Pine Trees, Chertsey Lane, Staines, Middlesex, TW18 3HR
#3 lore raw

Le Wed, 29 Jul 2009 09:06:39 +0100,
Chris Smith <[email protected]> a ?crit :

Quoted 3 lines

Sorry that should have been libc.so.6.

Building for i486.

Ok, so same architecture on the build machine and the target machine.

Quoted 1 line

/usr/sbin/snmpd: can't load library 'libc.so.6'

I suspect that the host toolchain is leaking somewhere in the build. libc.so.6 clearly indicates a glibc-based toolchain, which is the one of your host. Such a mix usually gets detected when the build machine and the target machine have a different architecture, but here, since it's the same, it might remain undetected.

I suspect one of the libraries on which snmpd depends, gets compiled against the host glibc instead of the target uClibc.

Will try to find some time to dig into this.

Sincerly,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

[Buildroot] IPv6 in busybox

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Chris" == Chris Smith <[email protected]> writes:

Chris> There is a problem with IPv6 support in busybox. I think you need to Chris> modify the busybox.mk file to add the CONFIG_FEATURE_IFUPDOWN_IPV6 Chris> lines to allow ipv6 support in 'ifup'

Thanks, committed.

Please send fixes to the BR mailing list instead of directly to me in the future, please.

Chris> ifeq ($(BR2_INET_IPV6),y)
Chris> $(SED) "s/^.*CONFIG_FEATURE_IPV6.*/CONFIG_FEATURE_IPV6=y/;"
Chris> $(BUSYBOX_DIR)/.config
Chris> $(SED)
Chris> "s/^.*CONFIG_FEATURE_IFUPDOWN_IPV6.*/CONFIG_FEATURE_IFUPDOWN_IPV6=y/;" Chris> $(BUSYBOX_DIR)/.config
Chris> else
Chris> $(SED) "s/^.*CONFIG_FEATURE_IPV6.*/CONFIG_FEATURE_IPV6=n/;"
Chris> $(BUSYBOX_DIR)/.config
Chris> $(SED)
Chris> "s/^.*CONFIG_FEATURE_IFUPDOWN_IPV6.*/CONFIG_FEATURE_IFUPDOWN_IPV6=n/;" Chris> $(BUSYBOX_DIR)/.config
Chris> endif

Signature · 1 line
Bye, Peter Korsgaard
#6 lore raw
In reply to Chris Smith

Le Tue, 28 Jul 2009 13:02:57 +0100,
Chris Smith <[email protected]> a ?crit :

Quoted 6 lines

When I build netsnmp the built snmpd doesn't work on the target. All the other snmp stuff works but I get
lib.so.6 not found when trying to run snmpd.

Anyone have any thoughts? It is as if some linkage to host based libraries has crept in.

Could you report a bug for this in our bug tracker
(http://bugs.uclibc.org, product buildroot) ?

I'm currently working on switching this package to Makefile.autotools.in in order to fix the build issue I have, and I will also integrate the fix for
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-6123, which appears to be
http://net-snmp.svn.sourceforge.net/viewvc/net-snmp/branches/V5-4-patches/net-snmp/snmplib/snmpUDPDomain.c?view=patch&r1=17367&r2=17366&pathrev=17367
(thanks to Gustavo for noticing).

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
#7 lore raw
In reply to Chris Smith

Le Tue, 28 Jul 2009 13:02:57 +0100,
Chris Smith <[email protected]> a ?crit :

Quoted 6 lines

When I build netsnmp the built snmpd doesn't work on the target. All the other snmp stuff works but I get
lib.so.6 not found when trying to run snmpd.

Anyone have any thoughts? It is as if some linkage to host based libraries has crept in.

I've converted the package to the Makefile.autotools.in infrastructure. And now it builds for me, with openssl support. However, I've removed the Perl support since it was broken and took too much time to fix.

Could you test the patch I proposed (available at
http://git.buildroot.net/~tpetazzoni/git/buildroot/patch/?id=d96368ad9339edf62aa87890d5cea79bf7ddfc34) ?

It builds for me, and the snmpd daemon runs. But as I have absolutely no knowledge about SNMP, you'll probably have more ideas on how to verify that it is indeed working.

Moreover, I've added a few things in the TODO about netsnmp (see
http://git.buildroot.net/~tpetazzoni/git/buildroot/patch/?id=d7890dd09302bc912cca13d65aa128eb826f9123).
If you're interested in helping for one of them (like telling us how netsnmp should be packaged, what are the different programs, libraries and configuration files useful for), don't hesitate!

Thanks!

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Hello,

[ I'm re-adding the Buildroot list in Cc: ]

Le Tue, 04 Aug 2009 16:59:29 +0100,
Chris Smith <[email protected]> a ?crit :

Quoted 1 line

I tested the patch. Seems to work ok.

Thanks for testing the patch!

Quoted 3 lines

I had some issues with building in parallel, I have set 4 as the
Number of jobs to run simultaneously. I had to try and build a few times before it worked. Just dependency issues I think.

I didn't try with a number of jobs > 1, and before my patch, netsnmp was forced to make -j1 even if a number of jobs > 1 was selected globally in Buildroot.

I will try to provide another fix for this issue.

Quoted 5 lines
Quoted 5 lines

Moreover, I've added a few things in the TODO about netsnmp (see
http://git.buildroot.net/~tpetazzoni/git/buildroot/patch/?id=d7890dd09302bc912cca13d65aa128eb826f9123).
If you're interested in helping for one of them (like telling us how netsnmp should be packaged, what are the different programs, libraries and configuration files useful for), don't hesitate!

Any suggestions about this ?

Thanks again for the report and the test,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com