Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 11th, 2007, 8:42 AM   #11
Eoin
Hobbyist Programmer
 
Eoin's Avatar
 
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3 Eoin is on a distinguished road
Hmm, I'm not sure rwm. You'll really need a debugger so you can tell what exactly is causing the crash. I'd be surprised if it a dll/shared lib issue in the end.
__________________
Visit my website BinaryNotions.
Eoin is offline   Reply With Quote
Old Jul 11th, 2007, 9:13 AM   #12
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
the crash happens when i try to unload the plugin...

no debugger:
Segmentation fault (core dumped)

GDB:
...
(gdb) run
Starting program: /usr/aw/maya7.0/bin/maya.bin
Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xd2b000
[Thread debugging using libthread_db enabled]
[New Thread 9117312 (LWP 9580)]
[New Thread -1218282576 (LWP 9583)]
MAYA_DEBUG_NO_SIGNAL_HANDLERS is set.

Detaching after fork from child process 9588.
Detaching after fork from child process 9611.
Detaching after fork from child process 9612.
Detaching after fork from child process 9613.
Detaching after fork from child process 9614.
Detaching after fork from child process 9615.
Detaching after fork from child process 9616.
Detaching after fork from child process 9617.
Detaching after fork from child process 9618.
Detaching after fork from child process 9619.
Detaching after fork from child process 9620.
*** glibc detected *** /usr/aw/maya7.0/bin/maya.bin: double free or corruption (fasttop): 0x094b7c98 ***
======= Backtrace: =========
/lib/libc.so.6[0x51301e0]
/lib/libc.so.6(__libc_free+0x77)[0x513072b]
/usr/lib/libstdc++.so.5(_ZdlPv+0x23)[0x50a2f53]
/usr/aw/maya/lib/libOpenMaya.so(_ZN17TpluginTransDBase6removeEP12TpluginTrans+0x
58)[0xb4778d80]
/usr/aw/maya/lib/libOpenMaya.so(_ZN9MFnPlugin24deregisterFileTranslatorERK7MStri
...

valgrind:
...
==9633==
==9633== Invalid free() / delete / delete[]
==9633==    at 0x4005511: operator delete(void*) (vg_replace_malloc.c:244)
==9633==    by 0x12B1FD7F: TpluginTransDBase::remove(TpluginTrans*) (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0x12B11F39: MFnPlugin::deregisterFileTranslator(MString const&) (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0xC4E969C: uninitializePlugin(MObject) (in /root/dev/plug-ins/plug.so)
==9633==    by 0x12B0EB79: Tplugin::unload() (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0x12B41218: TunloadPluginAction::doCommand(TargList&) (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0x5C44C0F: Mel_Command_Dispatch(SphNode*) (in /usr/aw/maya7.0/lib/libCommandEngine.so)
==9633==    by 0x5C692EE: node_exec (in /usr/aw/maya7.0/lib/libCommandEngine.so)
==9633==    by 0x5C7232B: fc_ifelse (in /usr/aw/maya7.0/lib/libCommandEngine.so)
==9633==    by 0x5C692EE: node_exec (in /usr/aw/maya7.0/lib/libCommandEngine.so)
==9633==    by 0x5C73591: f_function_entry_node (in /usr/aw/maya7.0/lib/libCommandEngine.so)
==9633==    by 0x5C692EE: node_exec (in /usr/aw/maya7.0/lib/libCommandEngine.so)
==9633==  Address 0x10B9B890 is 0 bytes inside a block of size 28 free'd
==9633==    at 0x400585F: operator delete[](void*) (vg_replace_malloc.c:256)
==9633==    by 0xC4E9838: Parser::Cleanup() (in /root/dev/plug-ins/plug.so)
==9633==    by 0xC4E98D2: Parser::~Parser() (in /root/dev/plug-ins/plug.so)
==9633==    by 0xC4E9A32: ParserTranslator::~ParserTranslator() (in /root/dev/plug-ins/plug.so)
==9633==    by 0x12B20AA3: THfileConverter::~THfileConverter() (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0x12B1FD7F: TpluginTransDBase::remove(TpluginTrans*) (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0x12B11F39: MFnPlugin::deregisterFileTranslator(MString const&) (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0xC4E969C: uninitializePlugin(MObject) (in /root/dev/plug-ins/plug.so)
==9633==    by 0x12B0EB79: Tplugin::unload() (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0x12B41218: TunloadPluginAction::doCommand(TargList&) (in /usr/aw/maya7.0/lib/libOpenMaya.so)
==9633==    by 0x5C44C0F: Mel_Command_Dispatch(SphNode*) (in /usr/aw/maya7.0/lib/libCommandEngine.so)
==9633==    by 0x5C692EE: node_exec (in /usr/aw/maya7.0/lib/libCommandEngine.so)
...

ive tried using the core dump files, but i cant figure out how to set debugging symbols ive googled all over and cant find out how to set debugging symbols...

gdb maya.bin core.9729
GNU gdb Red Hat Linux (6.3.0.0-1.21rh)
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 "i386-redhat-linux-gnu"...maya.bin: No such file or directory.

Reading symbols from shared object read from target memory...(no debugging symbols found)...done.
Using host libthread_db library "/lib/libthread_db.so.1".
Loaded system supplied DSO at 0x57d000
Core was generated by `/usr/aw/maya/bin/maya.bin'.
Program terminated with signal 6, Aborted.
#0  0x0057d402 in __kernel_vsyscall ()
(gdb) run
warning: cannot close "shared object read from target memory": File in wrong format
Starting program:
No executable file specified.
Use the "file" or "exec-file" command.

ive compiled with the -g flag...

looking at the specific plugin code i wrote


class Parser {
    public:
        Parser() : file(0) {}
	Parser(const Parser &other) {
		*this = other;
	}
	virtual ~Parser() {
		Cleanup();
	}
	Parser &operator=(const Parser &right) {
		if(right.file) {
			file = new char[strlen(right.file)+1];
			strcpy(file,right.file);
		} else
			file = 0;
	}
        void Cleanup() {
        	delete[] file;
        	file = 0;
        }
    private:
        char *file;
};

class ParserTranslator : public Parser,public MPxFileTranslator {
    public:
        ParserTranslator() : Parser() {}
        ~ParserTranslator() {}
        static void *creator() {
            return new ParserTranslator;
        }
};

as you can see in the actual plugin code i wrote, you can see the error occurs outside of my destructor..

==9633==    by 0xC4E9838: Parser::Cleanup() (in /root/dev/plug-ins/plug.so)
==9633==    by 0xC4E98D2: Parser::~Parser() (in /root/dev/plug-ins/plug.so)
==9633==    by 0xC4E9A32: ParserTranslator::~ParserTranslator() (in /root/dev/plug-ins/plug.so)

note that MPxFileTranslator is a maya class...

hope you can help!

thanks!

PS: i understand if you cant help me out with this since you are not a maya API developer (or by chance you are? )

Last edited by rwm; Jul 11th, 2007 at 9:24 AM.
rwm is offline   Reply With Quote
Old Jul 11th, 2007, 10:34 AM   #13
Eoin
Hobbyist Programmer
 
Eoin's Avatar
 
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3 Eoin is on a distinguished road
If the error occurs after you unload you're plugin then some pointer must remain within the Maya code pointing to where your library used to be be loaded. So that does bring you back to it being a shared lib issue actually.

This line in the valgrind output
==9633==  Address 0x10B9B890 is 0 bytes inside a block of size 28 free'd
seems to suggest that delete[] has been called twice for the same pointer. Again not being much of a unix man I'm not familiar with valgrind either

As you guess I don't know much about the Maya plugin interface. But if the error occurs just at the point of unloading your plugin there might still be a small issue with your code. Not sure if I can offer much more help in trying to track it down, it's a tricky one.
__________________
Visit my website BinaryNotions.
Eoin is offline   Reply With Quote
Old Jul 11th, 2007, 10:44 AM   #14
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
aarrrrrrrrrrrrrrrrrrrrggggggggh! im dying!

mmm, it is indeed a tricky bastard! :mad:
rwm is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stuck with a C problem Polaris C++ 8 Aug 19th, 2006 3:30 PM
Changing icons problem Pedja C# 8 Mar 25th, 2006 8:03 AM
cgi/perl script + IE problem joyceshee Perl 2 Jan 24th, 2006 11:10 AM
problem with user defined class mixed with functions willj729 C++ 4 Oct 9th, 2005 3:26 PM
string problem when passing in linked list quantz C++ 0 Feb 27th, 2005 10:11 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:23 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC