ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fatal error during acedSSGet

3 REPLIES 3
Reply
Message 1 of 4
cadproman
561 Views, 3 Replies

fatal error during acedSSGet

I get the following:

 

 FATAL ERROR" Unhandled Access Violation Reading 0xec57407d Exception at 7c93729bh

 

at the code "result = acedSSGet(NULL, NULL, NULL, rbFilter, WallSS);"

 

This only happens in the release version. The only way I can tell where is to place a printf statement directly before and after it, and only the one before prints to the command line. The debug version works fine, and even the release version has worked fine for weeks on dozens of drawings. In the offending drawing, the code works on all selected pairs of lines except for the same two specific ones each time. The filter seems to work correctly, as I can see the two lines highlighted as they are selected.

 

Reopening the drawing has not effect. Also, if I erase and redraw the lines snapping to the same points, I continue to get the fatal error. However, moving the lines to a random location and then running the code apparently eliminates the problem every time, although moving them back to the original coords recreates it. Moving the lines directly down or to the side using polar only helps sometimes.

 

Does anyone know what might be causing this, or Is there a safer way to call this function?

 

Code:

// returns a selection set of all lines on a "*_WALL_*" layer,
//	with linetype of "BYLAYER" 
int WallSelSet(ads_name WallSS)
{
	// Build a filter that excludes all except the following:
	// 1. Object type = LINE										DXF code 0
	// 2. Layer contains "_WALL_"									DXF code 8
	// 3. Linetype value = "BYLAYER"								DXF code 6

	int result = RTNORM;
	struct resbuf *rbFilter = NULL;
	rbFilter = acutBuildList(RTDXF0, _T("LINE"),
								8, _T("*_WALL_*"),
								6, _T("BYLAYER"),
								0);
	acutPrintf(_T("SelectionSets.cpp 169"));
	//obtain the filtered selectionset by user selection
	result = acedSSGet(NULL, NULL, NULL, rbFilter, WallSS);
	acutPrintf(_T("SelectionSets.cpp 172"));
	acutRelRb(rbFilter);						//release the result buffer
	return result;
}

 

 

 

 

3 REPLIES 3
Message 2 of 4
owenwengerd
in reply to: cadproman

You need to set the debugger to break on the exception so you can look at the call stack an d determine where the crash occurred.

--
Owen Wengerd
ManuSoft
Message 3 of 4
cadproman
in reply to: owenwengerd

Cool. I thought all you could debug was the debug version.

 

With the exceptions turned on, the error says:

 "First-chance exception at 0x7c93729b in acad.exe: 0xC0000005: Access violation reading location 0x966d0aa5.

 

Call Stack output:

ntdll.dll!7c93729b()  <- yellow arrow

  [Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll] 

  ntdll.dll!7c936dbc()  
> msvcr80.dll!free(void * pBlock)  Line 110 C <- green arrow
  acdb17.dll!6203d356()  
  acdb17.dll!62082007()  
  acdb17.dll!6208e476()  

  MLAWHeaders.arx!08ea311c()  

  MLAWHeaders.arx!08ea28e9()  

  mscorwks.dll!7a0b2de8()  

  mscorwks.dll!7a0b2d8e()  

  acdb17.dll!6208cb4b()  

  acad.exe!00511f43()  

  kernel32.dll!7c80b729()  

  kernel32.dll!7c82ffb1()  










 

Message 4 of 4
owenwengerd
in reply to: cadproman

It looks like your code (assuming MLAWHeaders.arx is yours) is being called from managed code. You can only safely call acedSSGet() from the document fiber, so the crash might be caused by calling into AutoCAD from an unsafe context.

--
Owen Wengerd
ManuSoft

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost