I've run across a ptex file that I feel sheds some light on the pixel
corruption issue. The ptex contains a single subimage so I can discount any
problems due to some sort of error building up as I read subimages. Here's
a link to the image after converting to a TIFF:

https://drive.google.com/open?id=1MfJqeLp-v_pKB4nBhVmcvooKeec11Edy


The areas that have corruption appear to be tiles that contain a constant
color. I don't know what the connection might be but that's what it looks
like, especially after converting an image with lines added for the tile
boundaries:

https://drive.google.com/open?id=1q6f_iwV-ScS4Ligo49T3tr7FpMZyiNq-


Perhaps this provides a starting place for figuring out what's going on.

I haven't made any progress on fixing the ACCESS_VIOLATION crash.


On Wed, Jul 25, 2018 at 2:16 AM, Darby Edelen <[email protected]> wrote:

> Hello,
>
> I've just recently joined the list because I'm having some trouble. I'm
> trying to use OpenImageIO to convert several hundred Ptex files into UDIM
> textures. I am doing this with the OpenImageIO python bindings inside of
> Cinema 4D.
>
> The process currently searches a single directory where Ptex files for a
> group of meshes reside. There is 1 Ptex file for each mesh. I have an outer
> loop over each mesh in the file and an inner loop over the faces of the
> mesh. I'm storing the image associated with the current face into a section
> of a large ImageBuf and generating UV coordinates for the mesh. Once the
> ImageBuf is full I'm writing it out to file and resetting it for the next
> batch of faces.
>
> Here's a link to one of the output textures:
>
> https://drive.google.com/open?id=1p2OdBqg4Z-vpZdnGFYslFRLp7q587IPY
>
>
> This leads me to my first issue. You'll probably notice that there are
> several faces that contain garbage data and I have not found anyway to get
> around this. It always appears in the same pixels of the same faces, but
> the garbage takes on subtly different qualities (i.e. different colors).
>
> Here's a link to one of the problematic source ptex files in case anyone
> wants to try their luck:
>
> https://drive.google.com/open?id=17kmmJppm4jWKPW9bDq5kcOBqpZoiTUNp
>
>
> The second issue I'm running into is fairly consistent crashing. Some of
> the meshes/Ptex files don't have this issue at all and others seem to crash
> almost every time. I've narrowed down the moment of the crash to this call:
>
> src_pixels = ptex_img.read_image("uint8")
>
> But the logs I've been able to pull from Cinema 4D seem to indicate a
> memory problem, which means there may be something happening
> godonlyknowswhere to cause it. I should add that this is not a Python
> exception being raised so I can't catch it or handle it in my own code.
>
> Here's the pertinent part of the log files:
>
>
> CINEMA_4D_Crash_Report_WINDOWS
> {
> Call_Stacks
> {
> Call_Stack_Thread_14392
> {
> VCRUNTIME140.dll: memcpy + 0x57 (SP: 0x000000FA07BD9408, PC:
> 0x00007FFF6A1ACAA7)
> OpenImageIO.dll: OpenImageIO_v1_9::ptex_input_imageio_create + 0x132 (SP:
> 0x000000FA07BD9410, PC: 0x00007FFEE7752832)
> OpenImageIO.dll: OpenImageIO_v1_9::ImageInput::read_native_tiles + 0x1ea
> (SP: 0x000000FA07BD9470, PC: 0x00007FFEE765347A)
> OpenImageIO.dll: OpenImageIO_v1_9::ImageInput::read_tiles + 0x431 (SP:
> 0x000000FA07BD95F0, PC: 0x00007FFEE76557C1)
> OpenImageIO.dll: OpenImageIO_v1_9::ImageInput::read_tiles + 0x14a (SP:
> 0x000000FA07BD9880, PC: 0x00007FFEE76551EA)
> OpenImageIO.dll: OpenImageIO_v1_9::ImageInput::read_image + 0x3a1 (SP:
> 0x000000FA07BD9950, PC: 0x00007FFEE7652271)
> OpenImageIO.pyd: 0x00007FFF4E561D0C (SP: 0x000000FA07BD9B60, PC:
> 0x00007FFF4E561D0C)
> OpenImageIO.pyd: 0x00007FFF4E5609A3 (SP: 0x000000FA07BD9CD0, PC:
> 0x00007FFF4E5609A3)
> OpenImageIO.pyd: 0x00007FFF4E554B2A (SP: 0x000000FA07BD9D40, PC:
> 0x00007FFF4E554B2A)
> OpenImageIO.pyd: 0x00007FFF4E554179 (SP: 0x000000FA07BD9D90, PC:
> 0x00007FFF4E554179)
> OpenImageIO.pyd: 0x00007FFF4E560F6F (SP: 0x000000FA07BD9DE0, PC:
> 0x00007FFF4E560F6F)
> OpenImageIO.pyd: 0x00007FFF4E551476 (SP: 0x000000FA07BD9E50, PC:
> 0x00007FFF4E551476)
> OpenImageIO.pyd: 0x00007FFF4E56CA53 (SP: 0x000000FA07BD9E80, PC:
> 0x00007FFF4E56CA53)
> python27.dll: PyCFunction_Call + 0x76 (SP: 0x000000FA07BDA1A0, PC:
> 0x000000001E0BED36)
> python27.dll: Py_CheckRecursiveCall + 0xde9 (SP: 0x000000FA07BDA1D0, PC:
> 0x000000001E10FBC9)
> python27.dll: Py_CheckRecursiveCall + 0x939 (SP: 0x000000FA07BDA210, PC:
> 0x000000001E10F719)
> python27.dll: PyEval_EvalFrameEx + 0x2500 (SP: 0x000000FA07BDA270, PC:
> 0x000000001E10DB00)
> python27.dll: Py_CheckRecursiveCall + 0x18d8 (SP: 0x000000FA07BDA370, PC:
> 0x000000001E1106B8)
> python27.dll: Py_CheckRecursiveCall + 0x92c (SP: 0x000000FA07BDA3E0, PC:
> 0x000000001E10F70C)
> python27.dll: PyEval_EvalFrameEx + 0x2500 (SP: 0x000000FA07BDA440, PC:
> 0x000000001E10DB00)
> python27.dll: Py_CheckRecursiveCall + 0x18d8 (SP: 0x000000FA07BDA540, PC:
> 0x000000001E1106B8)
> python27.dll: Py_CheckRecursiveCall + 0x92c (SP: 0x000000FA07BDA5B0, PC:
> 0x000000001E10F70C)
> python27.dll: PyEval_EvalFrameEx + 0x2500 (SP: 0x000000FA07BDA610, PC:
> 0x000000001E10DB00)
> python27.dll: PyEval_EvalCodeEx + 0x786 (SP: 0x000000FA07BDA710, PC:
> 0x000000001E10B5E6)
> python27.dll: PyEval_EvalCode + 0x29 (SP: 0x000000FA07BDA7B0, PC:
> 0x000000001E10AE59)
> python.cdl64: 0x00007FFF0C4F9EC7 (SP: 0x000000FA07BDA810, PC:
> 0x00007FFF0C4F9EC7)
>
> ...snip...
>
>
> Exception
> {
> ExceptionNumber = 0xC0000005
> ExceptionText = "ACCESS_VIOLATION"
> Address = 0x00007FFF6A1ACAA7
> Thread = 0x0000000000003838
> Last_Error = 0x00000000
> }
>
> I'm not much good at trying to decode this sort of stuff. My limited
> Googling has indicated that this is a problem of attempting to access
> memory that isn't ready or available to be accessed. I noticed in the log
> that the VCRUNTIME140.dll being used by Cinema 4D is not the same one that
> I built, but I don't know if that's an issue. I also don't know what else
> to do on my end.  I'm running out of ideas so I'm looking for any help. Is
> this a bug report that should be filed? User error? Stray gamma rays
> bombarding my work and home PCs?!
>
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to