Hi all!

I have a problem with hugin outputting data to cerr when I use it from
Python, but it may point to a general problem. Hugin uses a set of
macros to produce warning and error output when in debug mode.
Recently I've experienced two occasions when these macros weren't made
dependent on the setting of the DEBUG define but just activated
anyway; currently this is the case in src/hugin_base/hugin_utils/
utils.h., line 87-94.This wouldn't be a great problem, if the output
to cerr didn't crash Python when it uses hugin or other programs
linking to libhuginbase.so the very moment the first string is out.
Assume the C++ code does something like

cerr << "WARN:" << "blah blah" << endl ;

All I get to see in Python is

WARN: Speicherzugriffsfehler

(that is, memory error.) - so I get to see the first string 'WARN:'
but then the crash happens, which looks like an error in
cerr.operator<<(). The strange thing is that this only occurs with
output to cerr, cout is unaffected. Does anyone have any ideas if
maybe something is done to cerr which is incompatible - like some evil
trickery to make it do things it's not supposed to? I've managed to
reduce the problem to the linking in of libhugin.so - If I run an
ordinary C++ program from Python as a subprocess, using cerr is just
fine, even mixed with stdio routines, but as soon as I link in
libhugin.so, the call to cerr shows the erroneous behaviour. For now,
I'll modify utils.h back to only do output when DEBUG is set. I'd be
grateful if, whoever unleashes the DEBUG_ macros outside DEBUG mode
would only do these changes locally. Any ideas about the cerr problem
would be welcome, though, because there definitely is a problem, and
just avoiding it isn't a good strategy.

Kay

-- 
You received this message because you are subscribed to the Google Groups 
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

Reply via email to