snmpd: Bus error on m68k coldfire platform

2005-11-01 Thread sabina sayeed
Hi 

I have managed to cross compile net-snmp-5.0.9 for m68k plaform. Following is my configure option and build flags.

export CURDIR=/root/october/Linux/sb_linuxexport CROSSCOMPILER=/root/october/Linux/sb_linux/toolchain/m68k-linux/gcc-3.4.0-glibc-2.3.2
export CROSSCOMPILERPREFIX=m68k-linux-export CROSSCOMPILER=${CURDIR}/toolchain/m68k-linux/gcc-3.4.0-glibc-2.3.2export LD=${CROSSCOMPILER}/bin/${CROSSCOMPILERPREFIX}ldexport AR=${CROSSCOMPILER}/bin/${CROSSCOMPILERPREFIX}arexport AS=${CROSSCOMPILER}/bin/${CROSSCOMPILERPREFIX}asexport STRIP=${CROSSCOMPILER}/bin/${CROSSCOMPILERPREFIX}stripexport OBJCOPY=${CROSSCOMPILER}/bin/${CROSSCOMPILERPREFIX}objcopyexport RANLIB=${CROSSCOMPILER}/bin/${CROSSCOMPILERPREFIX}ranlibexport LD_LIBRARY_PATH=${CROSSCOMPILER}/i686-host_pc-linux-gnu/m68k-linux/lib

export CC=${CROSSCOMPILER}/bin/${CROSSCOMPILERPREFIX}gcc 
export CFLAGS=-mcfv4e 

./configure --target=m68k-linux --host=m68k-linux --build=i686-unknown-linux --with-endianness=big --with-logfile=/tmp/snmp.log --with-default-snmp-version=2 --with-sys-contact="[EMAIL PROTECTED]" --with-sys-location="unknown" --with-persistent-directory="/tmp" --disable-debugging --enable-mini-agent 

make

When I run the snmpd in my coldfire board, I get a bus error. I went and added a debug printf on the first line of main function in snmpd.c and recompiled the code. Even then when I run snmpd it doesn't show any of my debug output and gives me BUS error.

-snmpd -help
-Bus error

or

-snmpd -Dmib_init -L –C -c /etc/snmpd.conf
-Bus error

Also currently I am running code from RAMDISK. I have only RW access to my /tmp directory. Does snmpd needs access to some other directory before hitting main???


Just to verify the compile flags I have compiled a simple hello.c with same flags run it on my platform without any error.

/root/october/Linux/sb_linux/toolchain/m68k-linux/gcc-3.4.0-glibc-2.3.2/bin/m68k-linux-gcc -mcfv4e -Dlinux -fPIC -DPIC hello.c

./a.out
Could anyone suggest me what could be wrong?

Thanks,

Sabina


		 Yahoo! FareChase - Search multiple travel sites in one click.

 

 

RE: mib2c.iterate.conf table implementation problem

2004-07-30 Thread Sabina Sayeed
That was it. I had to return NULL once I reached the max no of entries. It is working 
now.

Thanks a lot for your prompt reply.

Sabina

-Original Message-
From: Dave Shield [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 12:00 PM
To: s sayeed
Cc: [EMAIL PROTECTED]; Sabina Sayeed
Subject: Re: mib2c.iterate.conf table implementation problem 



 I am trying to implement a table using net-snmp5.1. I
 have a  simple array that I want to rertieve from this
 table. When I do a walk on this table it loops forever
 in my get_next entry function.

The 'lnbCustom2Table_get_next_data_point' routine needs to return NULL
when it gets to the end of your table:

 netsnmp_variable_list *
 lnbCustom2Table_get_next_data_point(
  void **my_loop_context,
  void **my_data_context,
  netsnmp_variable_list *put_index_data,
  netsnmp_iterator_info *mydata)
 {
 int i = (int)*my_loop_context;
 DEBUGMSGTL((lnbCustom2Table,
  lnbCustom2Table_get_next_data_point \n));

I'd be tempted for this debug statement to include the current index
value.  I.e.

   DEBUGMSGTL((lnbCustom2Table,
   lnbCustom2Table_get_next_data_point %d\n, i ));

 netsnmp_variable_list *vptr;
 vptr = put_index_data;
 
 snmp_set_var_value(vptr, 
  (u_char *)custom2table[i].loBand,
  sizeof(custom2table[i].loBand) );

How big is custom2table ?
What happens when you run off the end of it?

You probably need something like:

  if ( i  MAX_custom2table_INDEX )
  return NULL;


(coming *before* the snmp_set_var_value statement above)


 DEBUGMSGTL((lnbCustom2Table,
  lnbCustom2Table_get_next_data_point loBand\n));
 
 *my_data_context = (void*)custom2table[i];
 *my_loop_context =  (void*)++i;
 
 DEBUGMSGTL((lnbCustom2Table,
  lnbCustom2Table_get_next_data_point end\n));

I probably wouldn't bother with those two debug statements either.
A single debug output, containing all of the useful information about
this particular run is likely to prove clearer.

 return put_index_data;
 }




Dave



---
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
___
Net-snmp-users mailing list
[EMAIL PROTECTED]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users