Menu

#1709 Possible exception in ScintillaCocoa::StartDrag()

Bug
closed-fixed
5
2015-05-12
2015-03-31
No

I've got a user who's having random crashes that I believe may be related to the discrete GPU on her Macbook Pro and Yosemite. While looking at a few of her crash logs, I traced some of the crashes coming from ScintillaCocoa::StartDrag() at:

NSBitmapImageRep* bitmap = NULL;
if (pixmap)
{
CGImageRef imagePixmap = pixmap->GetImage();
bitmap = [[[NSBitmapImageRep alloc] initWithCGImage: imagePixmap] autorelease];
CGImageRelease(imagePixmap);
pixmap->Release();
delete pixmap;
}

pixmap->GetImage() can return NULL which will cause an exception to terminate the app if you pass that to initWithCGImage:. Like I said, I think she's got other issues but it probably wouldn't hurt to make sure imagePixmap != NULL before creating a bitmap from it. I have determined that the rest of the code functions just fine if bitmap is NULL (you obviously don't see a drag image though).

Related

Bugs: #1709

Discussion

  • Neil Hodgson

    Neil Hodgson - 2015-03-31

    Added a check with [a2ee0b].

    The drag and drop code was recently changed (after 3.5.4 with [81c44d]) to implement NSDraggingSource and use current instead of deprecated APIs. Did the problem start with this change?

     

    Related

    Commit: [81c44d]
    Commit: [a2ee0b]

    • Chinh Nguyen

      Chinh Nguyen - 2015-04-01

      The user was originally crashing in a different spot unrelated to Scintilla. I had been using 3.4.1 but upgraded to 3.5.4 for a future update and that's what she's testing now.

      So yes, this is a new problem but it's not the source of her original problem since she was on 3.4.1. She claims her crashes only start happening after 2-3 hours of use.

      -Chinh Nguyen

      On Mar 31, 2015, at 5:36 PM, Neil Hodgson nyamatongwe@users.sf.net wrote:

      Added a check with [a2ee0b].

      The drag and drop code was recently changed (after 3.5.4 with [81c44d]) to implement NSDraggingSource and use current instead of deprecated APIs. Did the problem start with this change?

      [bugs:#1709] Possible exception in ScintillaCocoa::StartDrag()

      Status: open
      Group: Bug
      Created: Tue Mar 31, 2015 02:45 PM UTC by chinhster
      Last Updated: Tue Mar 31, 2015 02:45 PM UTC
      Owner: nobody

      I've got a user who's having random crashes that I believe may be related to the discrete GPU on her Macbook Pro and Yosemite. While looking at a few of her crash logs, I traced some of the crashes coming from ScintillaCocoa::StartDrag() at:

      NSBitmapImageRep* bitmap = NULL;
      if (pixmap)
      {
      CGImageRef imagePixmap = pixmap->GetImage();
      bitmap = [[[NSBitmapImageRep alloc] initWithCGImage: imagePixmap] autorelease];
      CGImageRelease(imagePixmap);
      pixmap->Release();
      delete pixmap;
      }

      pixmap->GetImage() can return NULL which will cause an exception to terminate the app if you pass that to initWithCGImage:. Like I said, I think she's got other issues but it probably wouldn't hurt to make sure imagePixmap != NULL before creating a bitmap from it. I have determined that the rest of the code functions just fine if bitmap is NULL (you obviously don't see a drag image though).

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/scintilla/bugs/1709/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1709
      Commit: [81c44d]
      Commit: [a2ee0b]

    • Chinh Nguyen

      Chinh Nguyen - 2015-04-01

      Sorry, I mispoke. The problem did not start with the change to implement
      NSDraggingSource.

      On Tue, Mar 31, 2015 at 5:36 PM, Neil Hodgson nyamatongwe@users.sf.net
      wrote:

      Added a check with [a2ee0b]
      http://sourceforge.net/p/scintilla/code/ci/a2ee0bf3f0163f4dd81e853146e518cdb6bf1d43
      .

      The drag and drop code was recently changed (after 3.5.4 with [81c44d]
      http://sourceforge.net/p/scintilla/code/ci/81c44d78aa75ac05b8052b70c399f89e3f4e5efa)
      to implement NSDraggingSource and use current instead of deprecated APIs.
      Did the problem start with this change?


      Status: open
      Group: Bug
      Created: Tue Mar 31, 2015 02:45 PM UTC by chinhster
      Last Updated: Tue Mar 31, 2015 02:45 PM UTC
      Owner: nobody

      I've got a user who's having random crashes that I believe may be related
      to the discrete GPU on her Macbook Pro and Yosemite. While looking at a few
      of her crash logs, I traced some of the crashes coming from
      ScintillaCocoa::StartDrag() at:

      NSBitmapImageRep* bitmap = NULL;
      if (pixmap)
      {
      CGImageRef imagePixmap = pixmap->GetImage();
      bitmap = [[[NSBitmapImageRep alloc] initWithCGImage: imagePixmap]
      autorelease];
      CGImageRelease(imagePixmap);
      pixmap->Release();
      delete pixmap;
      }

      pixmap->GetImage() can return NULL which will cause an exception to
      terminate the app if you pass that to initWithCGImage:. Like I said, I
      think she's got other issues but it probably wouldn't hurt to make sure
      imagePixmap != NULL before creating a bitmap from it. I have determined
      that the rest of the code functions just fine if bitmap is NULL (you
      obviously don't see a drag image though).


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/scintilla/bugs/1709/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #1709
      Commit: [81c44d]
      Commit: [a2ee0b]

  • Neil Hodgson

    Neil Hodgson - 2015-04-01
    • labels: --> scintilla, cocoa
    • status: open --> open-fixed
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2015-05-12
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.