
On Tue, Mar 13, 2007 at 12:08:15PM +0100, Federico wrote:
Hello, remembered of me! I'm a student graduating in Computer science Engineering and I'm leading a thesis on the Vectorial Diagrams Animated in Inkscape.
I had successful to insert of inkscape a "parallel" Thread to the main program, that it reads of the regarding data the characteristics of an object and then assigns them to the object by means of the endured function
sp_repr_set_attr(nodes[i],style.c_str(),attrib.c_str());
nodes[i] -> it is a carrier of gunlayers "Node" (std::vector<Inkscape::XML::Node *> nodes;) style & attrib -> are strings.
But after this call, the program crasha and it is closed without some message. By means of the debuggher they are successful to understand that there is an error of Segmentation Fault:
Program received signal SIGSEGV, Segmentation fault. ---Type <return> to continue, or q <return> to quit--- [Switching to thread 3236.0x6a8] GC_clear_stack_inner (arg=0x47429a0 "", limit=2284336) at misc.c:293 293 misc.c: No such file or directory. in misc.c Current language: auto; currently c
You can help me to resolve this problem being given to me some council to follow?
When you are in the debugger, issue the command 'bt'; this should give you a backtrace to show the functions that were being called to reach this crash. You will probably also need to specify which thread you're debugging; since Inkscape is single threaded we don't have directions on this, however they can be found on the internet - Ubuntu has good directions for debugging multithreaded applications.
A technique that I find useful to help identify bugs like this is to set a break point in the code somewhere prior to the segmentation fault, and then step through the lines until the segmentation fault, and look at the values of some variables that might be causing the problem.
Generally segmentation faults are caused by mis-used pointers. For instance, trying to use a pointer with a NULL or undefined value.
Regarding adding multi-threaded capabilities to Inkscape, this is something which we have avoided. In part, it makes debugging more complex, and it opens a large class of bugs that are challenging to deal with. We've also heard that some of the libraries we use may not behave as well when used in a multithreaded app. If it is very important for you to have the multithreaded capabilities, please explain why; otherwise you may wish to go single threaded to save yourself a lot of difficult work. Either way though, it's exciting to hear of your work on animated diagrams in Inkscape! I'd love to hear more about it.
Bryce