libavg segfaults when loading a simple xml file from a python script

Bug #241808 reported by Daniel Skinner
14
Affects Status Importance Assigned to Milestone
libavg (Ubuntu)
Fix Released
Undecided
Unassigned
openoffice.org (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Happened on Ubuntu Hardy amd64.

I attempted to do the basic example provided on the wiki of libavg.de which consists of a text file containing

<?xml version="1.0"?>
<avg width="640" height="480">
  <words id="ClashText" x="10" y="10" font="arial" text="Should I stay or should I go?"/>
</avg>

saving it as text.avg then from the same directory i start python and type this out as follows

$> python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from libavg import avg
>>> Player = avg.Player()
>>> Player.loadFile('text.avg')
[08-06-20 20:54:38.508] LOGGER: Logging started
Segmentation fault
$> ..

I dont know if its relevant but i am on an intel x3100 graphics adapter, laptop, and using ubuntu 64bit.

Revision history for this message
Venkatraman.S (blizzardz) wrote :

Thank you for taking your time to file this bug and helping to make Ubuntu better.

If you are using Ubuntu 8.04 , then from the libavg site [https://www.libavg.de/wiki/index.php/Libavg_on_Ubuntu], it looks like a known issue.

"
Latest Ubuntu release (8.04 aka Hardy Heron) exposes an issue at each libavg python script termination (a segmentation fault). To avoid that annoying error, this workaround places a rough patch to libselinux, disabling its SETRANS module. It seems to be a safe removal, as long as selinux security enforcing system is not needed.
".

Kindly update the bug if the above hint does not solve your problem, or you are not using Hardy.

Changed in libavg:
status: New → Confirmed
Changed in openoffice.org:
status: New → Invalid
Revision history for this message
Daniel Skinner (dasacc22) wrote :

Hi bliZZardz,

Yes, i was aware of that from the wiki and as far as i can tell, that is in regards to ubuntu 32bit and on exit of a successfully run script, there is a segfault, as was what happened when i successfully ran the script in 32bit ubu. Nevertheless I installed the modified deb package they provided and attempted to run the script and so no difference in output, which lead me to believe the above since they did not specify architecture on the wiki.

I have since reverted the deb package and then even removed 64bit ubuntu so i could work with this library on my laptop. I do have another system with ubuntu that i could do testing with if something comes up though.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Reproduced here in gdb, here is the backtrace.

(gdb) bt
#0 0x00007f50d97023a9 in std::uncaught_exception ()
   from /usr/lib/libstdc++.so.6
#1 0x00007f50d96d9745 in std::__ostream_insert<char, std::char_traits<char> >
    () from /usr/lib/libstdc++.so.6
#2 0x00007f50ddfa77d4 in avg::Logger::trace ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#3 0x00007f50ddfa7ab5 in avg::Logger::get ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#4 0x00007f50ddf4b65d in avg::Player::loadFile ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#5 0x00007f50ddee7a11 in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (avg::Player::*)(std::string const&), boost::python::default_call_policies, boost::mpl::vector3<void, avg::Player&, std::string const&> > >::operator() () from /usr/lib/python2.5/site-packages/libavg/avg.so
#6 0x00007f50d9215abe in boost::python::objects::function::call ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#7 0x00007f50d9215de8 in ?? ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#8 0x00007f50ddbf7537 in boost::function0<void, std::allocator<boost::function_base> >::operator() () from /usr/lib/libboost_thread-gcc42-mt-1_34_1.so.1.34.1
#9 0x00007f50d921db48 in boost::python::detail::exception_handler::operator()
    () from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#10 0x00007f50ddedb460 in boost::detail::function::function_obj_invoker2<boost::---Type <return> to continue, or q <return> to quit---
_bi::bind_t<bool, boost::python::detail::translate_exception<avg::Exception, void (*)(avg::Exception const&)>, boost::_bi::list3<boost::arg<1> (*)(), boost::arg<2> (*)(), boost::_bi::value<void (*)(avg::Exception const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void, std::allocator<boost::function_base> > const&>::invoke ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#11 0x00007f50d921de27 in boost::function2<bool, boost::python::detail::exception_handler const&, boost::function0<void, std::allocator<boost::function_base> > const&, std::allocator<boost::function_base> >::operator() ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#12 0x00007f50d921d9eb in boost::python::handle_exception_impl ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#13 0x00007f50d9213127 in ?? ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#14 0x0000000000417e73 in PyObject_Call ()
#15 0x00000000004860ea in PyEval_EvalFrameEx ()
#16 0x000000000048a376 in PyEval_EvalCodeEx ()
#17 0x000000000048a492 in PyEval_EvalCode ()
#18 0x00000000004ac459 in PyRun_InteractiveOneFlags ()
#19 0x00000000004ac664 in PyRun_InteractiveLoopFlags ()
#20 0x00000000004ac76a in PyRun_AnyFileExFlags ()
#21 0x00000000004145ad in Py_Main ()
#22 0x00007f50deb261c4 in __libc_start_main () from /lib/libc.so.6
---Type <return> to continue, or q <return> to quit---
#23 0x0000000000413b29 in _start ()

Revision history for this message
Pierre Ferrari (piferrari) wrote :

Also reproduced here in gdb, here is the backtrace.

#0 0x00007f4fbd7c1565 in avg::Words::removeExcessSpaces ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#1 0x00007f4fbd7c1837 in avg::Words::initText () from /usr/lib/python2.5/site-packages/libavg/avg.so
#2 0x00007f4fbd7ae182 in avg::Player::createNodeFromXml ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#3 0x00007f4fbd7add33 in avg::Player::createNodeFromXml ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#4 0x00007f4fbd7b5ac9 in avg::Player::loadFile () from /usr/lib/python2.5/site-packages/libavg/avg.so
#5 0x00007f4fbd751a11 in boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (avg::Player::*)(std::string const&), boost::python::default_call_policies, boost::mpl::vector3<void, avg::Player&, std::string const&> > >::operator() ()
   from /usr/lib/python2.5/site-packages/libavg/avg.so
#6 0x00007f4fb898fabe in boost::python::objects::function::call ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#7 0x00007f4fb898fde8 in ?? () from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#8 0x00007f4fbd461537 in boost::function0<void, std::allocator<boost::function_base> >::operator() ()
   from /usr/lib/libboost_thread-gcc42-mt-1_34_1.so.1.34.1
#9 0x00007f4fb8997b48 in boost::python::detail::exception_handler::operator() ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#10 0x00007f4fbd745460 in boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool, boost::python::detail::translate_exception<avg::Exception, void (*)(avg::Exception const&)>, boost::_bi::list3<boost::arg<1> (*)(), boost::arg<2> (*)(), boost::_bi::value<void (*)(avg::Exception const&)> > >, bool, boost::python::detail::exception_handler const&, boost::function0<void, std::allocator<boost::function_base> > const&>::invoke () from /usr/lib/python2.5/site-packages/libavg/avg.so
#11 0x00007f4fb8997e27 in boost::function2<bool, boost::python::detail::exception_handler const&, boost::function0<void, std::allocator<boost::function_base> > const&, std::allocator<boost::function_base> >::operator() () from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#12 0x00007f4fb89979eb in boost::python::handle_exception_impl ()
   from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#13 0x00007f4fb898d127 in ?? () from /usr/lib/libboost_python-gcc42-1_34_1.so.1.34.1
#14 0x0000000000417e73 in PyObject_Call ()
#15 0x00000000004860ea in PyEval_EvalFrameEx ()
#16 0x000000000048a376 in PyEval_EvalCodeEx ()
#17 0x000000000048a492 in PyEval_EvalCode ()
#18 0x00000000004ac459 in PyRun_InteractiveOneFlags ()
#19 0x00000000004ac664 in PyRun_InteractiveLoopFlags ()
---Type <return> to continue, or q <return> to quit---
#20 0x00000000004ac76a in PyRun_AnyFileExFlags ()
#21 0x00000000004145ad in Py_Main ()
#22 0x00007f4fbe3901c4 in __libc_start_main () from /lib/libc.so.6
#23 0x0000000000413b29 in _start ()

Revision history for this message
Pierre Ferrari (piferrari) wrote :

Attached is a debdiff to fix that issue.
It's planned for Intrepid but can probably then be sent as SRU to Hardy.

Changed in libavg:
status: Confirmed → In Progress
status: In Progress → Confirmed
description: updated
Revision history for this message
Michael Bienia (geser) wrote :

I've tried the patch on intrepid AMD64 but it still segfaults for me.

Revision history for this message
ovoskeuiks (ovoskeuiks) wrote :

I've got the same issue and have been trying to track down a solution for some time.
I think it may be related to this bug
https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/259219

Revision history for this message
Ulrich von Zadow (uzadow) wrote :

There are at least two bugs being discussed here in parallel.

The segfault in comment #4 is fixed upstream (svn rev. 2384, 2007-10-31 probably fixes it. I additionally committed a change today (libavg rev. 4549) that makes these lines of code conform to the C++ standard.)
The segfault in comment #3 is definitely a duplicate of Bug #259219.

Revision history for this message
Ulrich von Zadow (uzadow) wrote :

As per my last comment, the various bugs here have been fixed and the fixes are in the current Ubuntu libavg package.

Changed in libavg (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.