Problems with ResultBuffer

Problems with ResultBuffer

ZoltanFerenczy
Advocate Advocate
539 Views
2 Replies
Message 1 of 3

Problems with ResultBuffer

ZoltanFerenczy
Advocate
Advocate

I have had some interesting problems sending data from Lisp to .NET applications with ResultBuffers, so I decided to be a simple test:

 

I created the following powerfull and complex application:

 

[LispFunction("Bounce")]
public static ResultBuffer Bounce(ResultBuffer args)
{
   return args;
}

 

When I send it certain lists of integers from AutoCAD's Lisp Console, funny things happen:

 

 

_$ (Bounce '(2001 0 0))
((2001.0 0.0 0.0))


_$ (Bounce '(2002 0 0))
((2002.0 0.0 0.0))


_$ (Bounce '(2003 0 0))
((2003.0 0.0 0.0))


...


_$ (Bounce '(2009 0 0))
((2009.0 0.0 0.0))

So far so good...well, kinda, except it is turning a list of three integers into a 3D Point, but this is a known issue. It get's better:

 

_$ (Bounce '(2010 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2011 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2012 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2013 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2014 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2015 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2016 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2017 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2018 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(2019 0 0))
; error: LsAdsInvoke Internal Error

It get's funnier still:

 

_$ (Bounce '(3010 0 0))
(nil)

_$ (Bounce '(3011 0 0))
(nil)

_$ (Bounce '(3012 0 0))
(nil)

_$ (Bounce '(3013 0 0))
(nil)

_$ (Bounce '(3014 0 0))
(nil)

_$ (Bounce '(3015 0 0))
(nil)

_$ (Bounce '(3016 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(3017 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(3018 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(3019 0 0))
; error: LsAdsInvoke Internal Error

_$ (Bounce '(3020 0 0))
((3020.0 0.0 0.0))

And finally:

 

_$ (Bounce '(3010 1 0))
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on exception
; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Exception occurred: 0xC0000005 (Access Violation)

_$ (Bounce '(3011 1 0))
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on exception
; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Exception occurred: 0xC0000005 (Access Violation)

_$ (Bounce '(3012 1 0))
; error: Exception occurred: 0xC0000005 (Access Violation)
; warning: unwind skipped on exception
; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Exception occurred: 0xC0000005 (Access Violation)
; error: Exception occurred: 0xC0000005 (Access Violation)

Does anyone know what is causing this and how to get around it?

540 Views
2 Replies
Replies (2)
Message 2 of 3

dgorsman
Consultant
Consultant

Maybe check the values against DXF codes?  There is a known issue when it receives certain value/patterns it will attempt to process them as DXF code lists just as it does with a list of three reals as a point.  Rather than bouncing the ResBuff contents directly back, I'd recommend stepping through the code and inspecting the values.  Then construct a new ResBuff, fill it with appropriate value types and values, and see how that gets passed back.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 3 of 3

ZoltanFerenczy
Advocate
Advocate

There are no DXF codes above 1000 - 1071, which are the Extended Entity Data codes. I can't step through the code, becuase the crash happens even before the ResultBuffer makes it to the Bounce function.

0 Likes