[2015/05/08 00:02:07] #net-snmp <siptastic> moin
[2015/05/08 09:21:24] #net-snmp <chris2> hi. i'm building net-snmp 5.7.3 on linux with musl libc, and it generates this line: if (should_init("master")) init_master();
[2015/05/08 09:21:32] #net-snmp <chris2> but init_master is nowhere defined
[2015/05/08 09:21:57] #net-snmp <chris2> (in agent/mibgroup/agent_module_inits.h)
[2015/05/08 09:22:45] #net-snmp <chris2> interestingly that line isnt generated on glibc, not sure why this is detected
[2015/05/08 09:35:11] #net-snmp <fenestro> run configure --enable-mib-config-debug, figure out why it decided that "master" was the name of a module?
[2015/05/08 09:44:16] #net-snmp <chris2> ok
[2015/05/08 09:44:59] #net-snmp <chris2> but this is a false positive or something?
[2015/05/08 09:48:04] #net-snmp <chris2> http://sprunge.us/fTQH does that help?
[2015/05/08 09:52:21] #net-snmp <chris2> checking './agent/mibgroup/agentx/master.c' (master/master) C file for init/shutdown
[2015/05/08 09:52:22] #net-snmp <chris2> -adding init_master() to list
[2015/05/08 09:52:28] #net-snmp <chris2> that is the only diff between musl and glibc...
[2015/05/08 09:54:23] #net-snmp <chris2> let me try using a cross-compiler to avoid differences in the configure environment
[2015/05/08 09:55:52] #net-snmp <chris2> ok, it's also not detected when cross-compiling
[2015/05/08 10:07:46] #net-snmp <chris2> $ grep init_master ./agent/mibgroup/agentx/master.c
[2015/05/08 10:07:48] #net-snmp <chris2> Binary file ./agent/mibgroup/agentx/master.c matches
[2015/05/08 10:07:53] #net-snmp <chris2> i guess this is not useful already :)
[2015/05/08 10:13:48] #net-snmp <fenestro> ok so what does "grep init_master agent/mibgroup/agentx/master.c | grep -v _init_master" do on the misbehaving platform?
[2015/05/08 10:14:18] #net-snmp <chris2> Binary file ./agent/mibgroup/agentx/master.c matches
[2015/05/08 10:14:24] #net-snmp <chris2> which is nonzero...
[2015/05/08 10:14:37] #net-snmp <fenestro> neat. but, why is it a binary file?
[2015/05/08 10:14:38] #net-snmp <chris2> but actually it does this on the glibc too
[2015/05/08 10:14:45] #net-snmp <chris2> because there is a stupid copyright symbol in there :P
[2015/05/08 10:15:45] #net-snmp <fenestro> what version of grep is that that makes that decision?
[2015/05/08 10:16:11] #net-snmp <chris2> gnu grep i think
[2015/05/08 10:16:15] #net-snmp <fenestro> neither "grep (BSD grep) 2.5.1-FreeBSD" nor "grep (GNU grep) 2.8" seem to think that for me
[2015/05/08 10:16:18] #net-snmp <chris2> grep (GNU grep) 2.21
[2015/05/08 10:16:59] #net-snmp <fenestro> neat
[2015/05/08 10:17:05] #net-snmp <chris2> great feature, yes :P
[2015/05/08 10:17:09] #net-snmp <chris2> export GREP='grep -a'
[2015/05/08 10:17:12] #net-snmp <chris2> lets try that
[2015/05/08 10:18:38] #net-snmp <chris2> works
[2015/05/08 10:20:34] #net-snmp <fenestro> sweet
[2015/05/08 10:22:42] #net-snmp <chris2> perhaps that regexp should be '(^|[^_])init_...'
[2015/05/08 10:23:18] #net-snmp <fenestro> and use egrep
[2015/05/08 10:23:26] #net-snmp <chris2> yes
[2015/05/08 10:23:54] #net-snmp <fenestro> wanna try that in configure?
[2015/05/08 10:24:08] #net-snmp <fenestro> you could even skip capturing the output (is "egrep -q" portable?) and test the return value
[2015/05/08 10:26:06] #net-snmp <chris2> ok, got the bug
[2015/05/08 10:26:10] #net-snmp <chris2> env - ./masterdir/usr/bin/grep init_master masterdir-musl/builddir/net-snmp-5.7.3/agent/mibgroup/agentx/master.c
[2015/05/08 10:26:12] #net-snmp <chris2> real_init_master(void)
[2015/05/08 10:26:16] #net-snmp <chris2> env - ./masterdir-musl/usr/bin/grep init_master masterdir-musl/builddir/net-snmp-5.7.3/agent/mibgroup/agentx/master.c
[2015/05/08 10:26:21] #net-snmp <chris2> Binary file masterdir-musl/builddir/net-snmp-5.7.3/agent/mibgroup/agentx/master.c matches
[2015/05/08 10:26:35] #net-snmp <chris2> and i think this is because musl hardcodes an utf8 encoding