← All bug reports

FS#295SEGFAULT in Plugin.prototype.initDoc()

Type
Bug
Status
Closed
Resolution
Won't fix
Category
QCAD (main)
Severity
Low
Priority
Very Low
Reported version
3 Beta 2
Operating system
Linux (All / Other)
Reported
2011-10-06 by anonymous
Closed
2012-01-21 by andrew
Related
FS#57

Plugin.js:

/**
 * \internal Called once on startup.
 */
Plugin.prototype.initDoc = function() {
    // TODO crashes under OpenSUSE 11.4
    return;
    ...    

Backtrace:

Thread [1] 31002 (Suspended : Signal : SIGSEGV:Segmentation fault)	
	strncmp() at 0xb505089a	
	__xmlParserInputBufferCreateFilename() at xmlIO.c:2,525 0x92c27b9	
	xmlParserInputBufferCreateFilename() at xmlIO.c:2,559 0x92c284a	
	xmlNewInputFromFile() at parserInternals.c:1,549 0x9285697	
	xmlDefaultExternalEntityLoader() at xmlIO.c:3,881 0x92c45fd	
	xmlLoadExternalEntity() at xmlIO.c:3,941 0x92c46f6	
	xsltDocDefaultLoaderFunc() at documents.c:85 0x922b0d9	
	xsltParseStylesheetFile() at xslt.c:6,726 0x9224da3	
	RXslt::parseStylesheet() at RXslt.cpp:14 0x9212ce7	
	REcmaXslt::parseStylesheet() at REcmaXslt.cpp:196 0x8dff0e4	
	0xb6bd813c	
	0xb6ac1f68	
	0xb6a9164c	
	0xac23d732	
	0xb6a44262	
	0xb6a445f7	
	0xb6bb0f92	
	QScriptEngine::evaluate() at 0xb6bba46f	
	RScriptHandlerEcma::eval() at RScriptHandlerEcma.cpp:775 0x87d1bf4	
	RScriptHandlerEcma::doScript() at RScriptHandlerEcma.cpp:771 0x87d1ad8	
	RScriptHandler::init() at RScriptHandler.cpp:31 0x8f9bf9e	
	main() at main.cpp:218 0x87cb5bf	

/rsframework/src/xml/xml/libxml2/xmlIO.c:

#ifdef HAVE_ZLIB_H
	if ((xmlInputCallbackTable[i].opencallback == xmlGzfileOpen) &&
		(strcmp(URI, "-") != 0)) {
	    if (((z_stream *)context)->avail_in > 4) {
	        char *cptr, buff4[4];
		cptr = (char *) ((z_stream *)context)->next_in;
		if (gzread(context, buff4, 4) == 4) {
		    if (strncmp(buff4, cptr, 4) == 0)
===>		        ret->compressed = 0;
		    else
		        ret->compressed = 1;
		    gzrewind(context);
		}
	    }
	}
#endif

Closure comment

Doc is not generated on startup anymore.