Re: unnamed function586 $$ AMDRadeon X4000GLDriver

2016-06-23 Thread Jonathan Mitchell

> On 23 Jun 2016, at 21:39, Ken Thomases  wrote:
> 
> O
> 
> Are there any logs generated from the above call (other than your app's crash 
> log)?  Browse around within Console.app's log list to see.
Had a poke around but nothing significant that I can see.
> 
>>   CIFilter *colorFilter = [CIFilter filterWithName:@"CIColorControls"];
>>   [colorFilter setDefaults];
>>   [colorFilter setValue:image forKey:kCIInputImageKey];
>>   [colorFilter setValue:[NSNumber numberWithFloat:saturationValue]  
>> forKey:kCIInputSaturationKey];
>>   [colorFilter setValue:[NSNumber numberWithFloat:brightnessValue] 
>> forKey:kCIInputBrightnessKey];
>>   [colorFilter setValue:[NSNumber numberWithFloat:contrastValue] 
>> forKey:kCIInputContrastKey];
> 
> Any chance these values are out of valid range?
No. Everything looks sane. The range of arguments passed into the method is 
very small so there isn’t much variation.
> 
>> 
>>   CIImage *filterImage = [colorFilter valueForKey:kCIOutputImageKey];
>> 
>>   [filterImage drawAtPoint:NSZeroPoint // << this is the call site that 
>> eventually aborts
>>   fromRect:bounds
>>  operation:NSCompositeCopy
>>   fraction:alphaValue]; 
> 
> What does it mean to use a potentially non-1.0 fraction for a copy to an 
> as-yet-uninitialized image?  No idea if that might contribute to the problem. 
>  Maybe clearing the image to some background color first would help.
> 
> Also, have you considered using -[CIContext createCGImage:fromRect:] to 
> create the image instead of drawing into a focus-locked NSImage?  To get an 
> NSImage from the CGImage, you can use [[NSImage alloc] initWithCGImage:… 
> size:NSZeroSize].

Thanks for the suggestions I will give them a go.

J


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: unnamed function586 $$ AMDRadeon X4000GLDriver

2016-06-23 Thread Ken Thomases
On Jun 23, 2016, at 2:56 PM, Jonathan Mitchell  wrote:
> 
> On a rare occasion I encounter the following abort while rendering an image 
> in an NSImage category.
> The method (shown below) gets called frequently to render resources as 
> grayscale.
> Looks like the driver has issues but beyond that I am stuck.
> Any ideas?
> 
> Thread 1 (main-thread)
> #00x7fff9972ef06 in __pthread_kill ()
> #10x00010183642d in pthread_kill ()
> #20x7fff8d3426e7 in abort ()
> #30x7fff9b3ace5c in gpusGenerateCrashLog ()

Are there any logs generated from the above call (other than your app's crash 
log)?  Browse around within Console.app's log list to see.

> #40x0001127259dc in 
> ___lldb_unnamed_function586$$AMDRadeonX4000GLDriver ()
> #50x7fff9b3ae204 in gpusSubmitDataBuffers ()
> #60x000112762813 in 
> ___lldb_unnamed_function1027$$AMDRadeonX4000GLDriver ()
> #70x000112778d37 in 
> ___lldb_unnamed_function1175$$AMDRadeonX4000GLDriver ()
> #80x7fff91a1f22f in glReadPixels_Exec ()
> #90x7fff91f0ceb9 in CI::GLContext::readback_bitmap(CI::Bitmap*, 
> CI::swizzle_info) ()
> #10   0x7fff91dd43d9 in CI::image_get_cgimage(CI::Context*, CI::Image*, 
> CGRect, CGColorSpace*, CI::PixelFormat) ()
> #11   0x7fff91db606a in -[CIContext 
> createCGImage:fromRect:format:colorSpace:] ()
> #12   0x7fff91db476e in -[CIContext drawImage:inRect:fromRect:] ()
> #13   0x7fff9ba09801 in -[CIImage(NSAppKitAdditions) 
> drawInRect:fromRect:operation:fraction:] ()
> #14   0x7fff9ba09914 in -[CIImage(NSAppKitAdditions) 
> drawAtPoint:fromRect:operation:fraction:] ()
> #15   0x000100028f47 in -[NSImage(Test) 
> bp_grayscaleImageWithAlphaValue:saturationValue:brightnessValue:contrastValue:]
>  at 
> 
> NSImage category:
> 
> - (NSImage *)bp_grayscaleImageWithAlphaValue:(CGFloat)alphaValue
>  saturationValue:(CGFloat)saturationValue
>  brightnessValue:(CGFloat)brightnessValue
>contrastValue:(CGFloat)contrastValue
> {
>NSSize size = [self size];
>NSRect bounds = { NSZeroPoint, size };
>NSImage *tintedImage = [[NSImage alloc] initWithSize:size];
> 
>[tintedImage lockFocus];
> 
>CIImage *image = [CIImage imageWithData:[self TIFFRepresentation]];
> 
>CIFilter *colorFilter = [CIFilter filterWithName:@"CIColorControls"];
>[colorFilter setDefaults];
>[colorFilter setValue:image forKey:kCIInputImageKey];
>[colorFilter setValue:[NSNumber numberWithFloat:saturationValue]  
> forKey:kCIInputSaturationKey];
>[colorFilter setValue:[NSNumber numberWithFloat:brightnessValue] 
> forKey:kCIInputBrightnessKey];
>[colorFilter setValue:[NSNumber numberWithFloat:contrastValue] 
> forKey:kCIInputContrastKey];

Any chance these values are out of valid range?

> 
>CIImage *filterImage = [colorFilter valueForKey:kCIOutputImageKey];
> 
>[filterImage drawAtPoint:NSZeroPoint // << this is the call site that 
> eventually aborts
>fromRect:bounds
>   operation:NSCompositeCopy
>fraction:alphaValue]; 

What does it mean to use a potentially non-1.0 fraction for a copy to an 
as-yet-uninitialized image?  No idea if that might contribute to the problem.  
Maybe clearing the image to some background color first would help.

Also, have you considered using -[CIContext createCGImage:fromRect:] to create 
the image instead of drawing into a focus-locked NSImage?  To get an NSImage 
from the CGImage, you can use [[NSImage alloc] initWithCGImage:… 
size:NSZeroSize].

Regards,
Ken


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

unnamed function586 $$ AMDRadeon X4000GLDriver

2016-06-23 Thread Jonathan Mitchell
On a rare occasion I encounter the following abort while rendering an image in 
an NSImage category.
The method (shown below) gets called frequently to render resources as 
grayscale.
Looks like the driver has issues but beyond that I am stuck.
Any ideas?

Thread 1 (main-thread)
#0  0x7fff9972ef06 in __pthread_kill ()
#1  0x00010183642d in pthread_kill ()
#2  0x7fff8d3426e7 in abort ()
#3  0x7fff9b3ace5c in gpusGenerateCrashLog ()
#4  0x0001127259dc in 
___lldb_unnamed_function586$$AMDRadeonX4000GLDriver ()
#5  0x7fff9b3ae204 in gpusSubmitDataBuffers ()
#6  0x000112762813 in 
___lldb_unnamed_function1027$$AMDRadeonX4000GLDriver ()
#7  0x000112778d37 in 
___lldb_unnamed_function1175$$AMDRadeonX4000GLDriver ()
#8  0x7fff91a1f22f in glReadPixels_Exec ()
#9  0x7fff91f0ceb9 in CI::GLContext::readback_bitmap(CI::Bitmap*, 
CI::swizzle_info) ()
#10 0x7fff91dd43d9 in CI::image_get_cgimage(CI::Context*, CI::Image*, 
CGRect, CGColorSpace*, CI::PixelFormat) ()
#11 0x7fff91db606a in -[CIContext 
createCGImage:fromRect:format:colorSpace:] ()
#12 0x7fff91db476e in -[CIContext drawImage:inRect:fromRect:] ()
#13 0x7fff9ba09801 in -[CIImage(NSAppKitAdditions) 
drawInRect:fromRect:operation:fraction:] ()
#14 0x7fff9ba09914 in -[CIImage(NSAppKitAdditions) 
drawAtPoint:fromRect:operation:fraction:] ()
#15 0x000100028f47 in -[NSImage(Test) 
bp_grayscaleImageWithAlphaValue:saturationValue:brightnessValue:contrastValue:] 
at 

NSImage category:

- (NSImage *)bp_grayscaleImageWithAlphaValue:(CGFloat)alphaValue
  saturationValue:(CGFloat)saturationValue
  brightnessValue:(CGFloat)brightnessValue
contrastValue:(CGFloat)contrastValue
{
NSSize size = [self size];
NSRect bounds = { NSZeroPoint, size };
NSImage *tintedImage = [[NSImage alloc] initWithSize:size];

[tintedImage lockFocus];

CIImage *image = [CIImage imageWithData:[self TIFFRepresentation]];
   
CIFilter *colorFilter = [CIFilter filterWithName:@"CIColorControls"];
[colorFilter setDefaults];
[colorFilter setValue:image forKey:kCIInputImageKey];
[colorFilter setValue:[NSNumber numberWithFloat:saturationValue]  
forKey:kCIInputSaturationKey];
[colorFilter setValue:[NSNumber numberWithFloat:brightnessValue] 
forKey:kCIInputBrightnessKey];
[colorFilter setValue:[NSNumber numberWithFloat:contrastValue] 
forKey:kCIInputContrastKey];

CIImage *filterImage = [colorFilter valueForKey:kCIOutputImageKey];

[filterImage drawAtPoint:NSZeroPoint // << this is the call site that 
eventually aborts
fromRect:bounds
   operation:NSCompositeCopy
fraction:alphaValue]; 

[tintedImage unlockFocus];

return tintedImage;
}


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com