Ben Lovett
2007-Aug-29 05:34 UTC
[netflow-tools] Python flowd module causing SIGBUS on OpenBSD/sparc64
I''m trying to get some network monitoring going, and am revisiting flowd with pfflowd. To try and make things a little more interesting I''m looking at using the python interface to flowd, but am running into a rather major problem, namely SIGBUS. This is only happening for me on my sparc64, i386 causes no troubles. Below is a backtrace generated after building the module with debugging symbols. Ideas? Ben --- Python 2.4.4 (#1, Aug 9 2007, 09:29:02) [GCC 3.3.5 (propolice)] on openbsd4 Type "help", "copyright", "credits" or "license" for more information.>>> import flowd >>> flows = flowd.FlowLog("/var/log/flowd", "rb") >>> for flow in flows:... print flow.format() ... Program received signal SIGBUS, Bus error. 0x00000000501a3f1c in object_to_u64 (o=0x4e126150, u64=0x500230cc) at flowd_python.c:162 162 if (PyErr_Occurred()) (gdb) bt #0 0x00000000501a3f1c in object_to_u64 (o=0x4e126150, u64=0x500230cc) at flowd_python.c:162 #1 0x00000000501a3f7c in flowobj_normalise (f=0x50023000) at flowd_python.c:174 #2 0x00000000501a4560 in flow_format (self=0x50023000, args=0x50023000, kw_args=0x0) at flowd_python.c:271 #3 0x00000000455f7498 in PyCFunction_Call () from /usr/local/lib/libpython2.4.so.0.0 #4 0x0000000045639520 in call_function () from /usr/local/lib/libpython2.4.so.0.0 #5 0x0000000045636938 in PyEval_EvalFrame () from /usr/local/lib/libpython2.4.so.0.0 #6 0x00000000456375cc in PyEval_EvalCodeEx () from /usr/local/lib/libpython2.4.so.0.0 #7 0x0000000045634170 in PyEval_EvalCode () from /usr/local/lib/libpython2.4.so.0.0 #8 0x000000004565c91c in run_node () from /usr/local/lib/libpython2.4.so.0.0 #9 0x000000004565b230 in PyRun_InteractiveOneFlags () from /usr/local/lib/libpython2.4.so.0.0 #10 0x000000004565af80 in PyRun_InteractiveLoopFlags () from /usr/local/lib/libpython2.4.so.0.0 #11 0x000000004565aec8 in PyRun_AnyFileExFlags () from /usr/local/lib/libpython2.4.so.0.0 #12 0x0000000045663ccc in Py_Main () from /usr/local/lib/libpython2.4.so.0.0 #13 0x0000000000101118 in ___start () #14 0x000000004f802f24 in _dl_start () from /usr/libexec/ld.so #15 0x000000004f802f24 in _dl_start () from /usr/libexec/ld.so Previous frame identical to this frame (corrupt stack?) (gdb)
Damien Miller
2007-Sep-03 10:49 UTC
[netflow-tools] Python flowd module causing SIGBUS on OpenBSD/sparc64
On Tue, 28 Aug 2007, Ben Lovett wrote:> I''m trying to get some network monitoring going, and am revisiting > flowd with pfflowd. To try and make things a little more > interesting I''m looking at using the python interface to flowd, but > am running into a rather major problem, namely SIGBUS. > > This is only happening for me on my sparc64, i386 causes no > troubles. Below is a backtrace generated after building the module > with debugging symbols. > > Ideas?You could try running with env MALLOC_OPTIONS=AFGJP python It looks like something is hosing memory, but the crash doesn''t seem to be proximal to the actual corruption. Turning on those malloc options might expose the corruption closer to where it occurs. -d
Ben Lovett
2007-Sep-07 04:29 UTC
[netflow-tools] Python flowd module causing SIGBUS on OpenBSD/sparc64
On Sep 3, 2007, at 3:49 AM, Damien Miller wrote:> It looks like something is hosing memory, but the crash doesn''t seem > to be proximal to the actual corruption. Turning on those malloc > options > might expose the corruption closer to where it occurs.Rebuilt python with debugging symbols for good measure. It doesn''t make much sense to me that it would be crashing in a return.. But I suppose that is just another indication that something is going terribly wrong. selenium:~ % env MALLOC_OPTIONS=AFGJP python2.4 Python 2.4.4 (#1, Sep 3 2007, 13:24:30) [GCC 3.3.5 (propolice)] on openbsd4 Type "help", "copyright", "credits" or "license" for more information. >>> import flowd >>> flows = flowd.FlowLog("flowd-blah.log", "rb") >>> for flow in flows: ... print flow.format() ... zsh: 19122 bus error (core dumped) env MALLOC_OPTIONS=AFGJP python2.4 selenium:~ % gdb /usr/local/bin/python2.4 GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc64-unknown-openbsd4.2"... (no debugging symbols found) (gdb) core-file python2.4.core Core was generated by `python2.4''. Program terminated with signal 10, Bus error. Reading symbols from /usr/local/lib/libpython2.4.so.0.0...done. Loaded symbols for /usr/local/lib/libpython2.4.so.0.0 Reading symbols from /usr/lib/libutil.so.11.0...done. Loaded symbols for /usr/lib/libutil.so.11.0 Reading symbols from /usr/lib/libstdc++.so.42.0...done. Loaded symbols for /usr/lib/libstdc++.so.42.0 Reading symbols from /usr/lib/libm.so.2.3...done. Loaded symbols for /usr/lib/libm.so.2.3 Reading symbols from /usr/lib/libpthread.so.8.0...done. Loaded symbols for /usr/lib/libpthread.so.8.0 Reading symbols from /usr/lib/libc.so.41.0...done. Loaded symbols for /usr/lib/libc.so.41.0 Reading symbols from /usr/libexec/ld.so...done. Loaded symbols for /usr/libexec/ld.so Reading symbols from /usr/local/lib/python2.4/lib-dynload/ readline.so...done. Loaded symbols for /usr/local/lib/python2.4/lib-dynload/readline.so Reading symbols from /usr/lib/libreadline.so.3.0...done. Loaded symbols for /usr/lib/libreadline.so.3.0 Reading symbols from /usr/lib/libncurses.so.10.0...done. Loaded symbols for /usr/lib/libncurses.so.10.0 Reading symbols from /usr/local/lib/python2.4/site-packages/ flowd.so...done. Loaded symbols for /usr/local/lib/python2.4/site-packages/flowd.so #0 0x00000000481c4024 in object_to_u64 (o=0x4eb44150, u64=0x4281a4cc) at flowd_python.c:159 159 return (0); (gdb) bt #0 0x00000000481c4024 in object_to_u64 (o=0x4eb44150, u64=0x4281a4cc) at flowd_python.c:159 #1 0x00000000481c409c in flowobj_normalise (f=0x4281a400) at flowd_python.c:174 #2 0x00000000481c4680 in flow_format (self=0x4281a400, args=0x4281a400, kw_args=0x0) at flowd_python.c:271 #3 0x000000004b9af5b8 in PyCFunction_Call (func=0x4eb5fbd8, arg=0x4c086050, kw=0x4281a400) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Objects/ methodobject.c:77 #4 0x000000004b9f1640 in call_function (pp_stack=0xffffffffffffabf8, oparg=0) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ ceval.c:3568 #5 0x000000004b9eea58 in PyEval_EvalFrame (f=0x4c1ab420) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ ceval.c:2167 #6 0x000000004b9ef6ec in PyEval_EvalCodeEx (co=0x4eb3fdc0, globals=0x4eb5fd8c, locals=0x4c1ab400, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ ceval.c:2741 #7 0x000000004b9ec290 in PyEval_EvalCode (co=0x4eb3fdc0, globals=0x4c1ab5a8, locals=0x49b5da20) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ ceval.c:484 #8 0x000000004ba14a3c in run_node (n=0x0, filename=0x49b5da20 "", globals=0x49b5da20, locals=0x49b5da20, flags=0x49b5da20) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ pythonrun.c:1285---Type <return> to continue, or q <return> to quit--- #9 0x000000004ba13350 in PyRun_InteractiveOneFlags (fp=0xffffffffffffffff, filename=0x4bb3ea60 "<stdin>", flags=0xffffffffffffb22c) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ pythonrun.c:771 #10 0x000000004ba130a0 in PyRun_InteractiveLoopFlags (fp=0x413217a0, filename=0x4bb3ea60 "<stdin>", flags=0xffffffffffffb22c) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ pythonrun.c:704 #11 0x000000004ba12fe8 in PyRun_AnyFileExFlags (fp=0x413217a0, filename=0x4bb3ea60 "<stdin>", closeit=0, flags=0xffffffffffffb22c) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Python/ pythonrun.c:667 #12 0x000000004ba1bdec in Py_Main (argc=1, argv=0xffffffffffffb428) at /u/obj/ports/Python-2.4.4-no_tkinter/Python-2.4.4/Modules/ main.c:493 #13 0x0000000000101118 in ___start () #14 0x0000000045402f24 in _dl_start () from /usr/libexec/ld.so #15 0x0000000045402f24 in _dl_start () from /usr/libexec/ld.so Previous frame identical to this frame (corrupt stack?)
Damien Miller
2007-Sep-17 06:20 UTC
[netflow-tools] Python flowd module causing SIGBUS on OpenBSD/sparc64
On Thu, 6 Sep 2007, Ben Lovett wrote:> On Sep 3, 2007, at 3:49 AM, Damien Miller wrote: > > It looks like something is hosing memory, but the crash doesn''t seem > > to be proximal to the actual corruption. Turning on those malloc > > options > > might expose the corruption closer to where it occurs. > > Rebuilt python with debugging symbols for good measure. > > It doesn''t make much sense to me that it would be crashing in a > return.. But I suppose that is just another indication that something > is going terribly wrong.Yes, it looks like something has hosed the stack, or gdb is misbehaving. Either way, it doesn''t give much to go on.> selenium:~ % env MALLOC_OPTIONS=AFGJP python2.4 > Python 2.4.4 (#1, Sep 3 2007, 13:24:30) > [GCC 3.3.5 (propolice)] on openbsd4 > Type "help", "copyright", "credits" or "license" for more information. > >>> import flowd > >>> flows = flowd.FlowLog("flowd-blah.log", "rb") > >>> for flow in flows: > ... print flow.format()Could you try printing out the flow fields manually and seeing if you can elicit a crash? -d