Bug 11430 - REGRESSION: Crash when loading PDF using AdobePDFViewer.plugin (Acrobat 7)
Summary: REGRESSION: Crash when loading PDF using AdobePDFViewer.plugin (Acrobat 7)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 420+
Hardware: Macintosh PowerPC OS X 10.4
: P1 Normal
Assignee: Nobody
URL: http://www.hsmv.state.fl.us/forms/711...
Keywords: InRadar, Regression
: 11530 11851 13316 13983 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-27 05:47 PDT by Kevin M. Dean
Modified: 2007-07-09 21:56 PDT (History)
8 users (show)

See Also:


Attachments
Crash log (38.88 KB, text/plain)
2006-10-27 05:48 PDT, Kevin M. Dean
no flags Details
Crash log (36.26 KB, text/plain)
2006-11-12 06:47 PST, Mark Knopper
no flags Details
Crash Log for PDF crash (30.85 KB, text/plain)
2007-03-19 05:26 PDT, Patricia Warwick
no flags Details
Yet another PDF crash log (32.30 KB, text/plain)
2007-04-02 08:47 PDT, Peter Norby
no flags Details
Yet another PDF crash log (658.58 KB, text/plain)
2007-06-19 12:29 PDT, Jay Batson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin M. Dean 2006-10-27 05:47:59 PDT
Crashes when loading a pdf using the Adobe PDF plugin.

On a side-note, I was trying to evaluate if webkit continues to give the status "Failed to open page (see Activity window for details)" every time a pdf is viewed like Safari does. The Activity window says: "Plug-in Cancelled". It says this every time, but the pdfs are shown.
Comment 1 Kevin M. Dean 2006-10-27 05:48:47 PDT
Created attachment 11238 [details]
Crash log
Comment 2 mitz 2006-10-27 07:31:29 PDT
The regression occurred in r17264 due to a change to IconLoader::startLoading(). If the frame is "documentless", you need to bail out for now (see bug 10902).
Comment 3 Brady Eidson 2006-10-27 10:47:30 PDT
Oh that crazy Maciej...  I'll take this and clean it up later today after I get some more stuff out of my tree
Comment 4 mitz 2006-11-06 11:33:29 PST
*** Bug 11530 has been marked as a duplicate of this bug. ***
Comment 5 Brady Eidson 2006-11-06 13:15:41 PST
*** Bug 11530 has been marked as a duplicate of this bug. ***
Comment 6 Brady Eidson 2006-11-06 13:17:51 PST
Patch reviewed in bug 11530 - didn't even realize it was closed as a dupe of this one.

Committed in r17626
Comment 7 Brady Eidson 2006-11-06 13:18:33 PST
Kevin, please verify
Comment 8 Kevin M. Dean 2006-11-06 15:53:05 PST
Still crashes with the same crash log on my end with r17630
Comment 9 Mark Knopper 2006-11-12 06:47:49 PST
Created attachment 11495 [details]
Crash log
Comment 10 Mark Knopper 2006-11-12 06:48:17 PST
I am getting a similar crash with today's nightly (r17743). It happens at this URL: http://www.toledomuseum.org/pdf/Map_with_directions.pdf

To reproduce go to this page (http://www.toledomuseum.org/Info_main.htm ) and click on "Printable Museum-area map with driving directions (in PDF format):  Click here". A new window opens and the crash happens after that. 

I will post the crash log.
Comment 11 Kevin M. Dean 2006-11-16 05:06:50 PST
EasyFix?   Still crashing here.
Comment 12 mitz 2006-11-17 08:32:22 PST
I looked at the crash logs again and realized that this bug is about using Adobe's PDF Viewer plugin. On a debug build of TOT I get the following error prior to the crash:
ERROR: NPP_NewStream failed with error: 1 responseURL: http://media.corporate-ir.net/media_files/irol/10/107357/corpGov/AppleSupplierCoc111305.pdf
(WebKit/Plugins/WebBaseNetscapePluginStream.m:226 -[WebBaseNetscapePluginStream startStreamResponseURL:expectedContentLength:lastModifiedDate:MIMEType:])

Earlier nightlies (r17205 and earlier) don't crash immediately, but don't display the PDF. Some crash when I close the window containing the PDF plugin. Even earlier nightlies (before r15598; fix for bug 10009) don't load the Adobe plugin and use WebKit's native PDF View instead, making it difficult to determine when the bug was introduced.

See also bug 10510.
Comment 13 Alexey Proskuryakov 2006-11-17 12:00:30 PST
> ERROR: NPP_NewStream failed with error: 1

I have checked in gdb - stock Safari/WebKit also get this error. It's a bit weird, because the plugin fills out the response before returning the error (1 == NPERR_GENERIC_ERROR), but seems to be unrelated. BTW, this might be related to the "Plugin cancelled" error in Activity window.

The problem at hand is caused by _loader being nil (this is a "manual" stream that is created with plain alloc+init sequence instead of initWith...). However, I'm not sure if fixing this by adding nil checks is right.

> Earlier nightlies (r17205 and earlier) don't crash immediately, but don't
> display the PDF. Some crash when I close the window containing the PDF plugin.

I also got a crash deep inside the Adobe plugin after adding nil checks for _loader. 


> EasyFix?   Still crashing here.

  Removed EasyFix, added NeedsRadar.
Comment 14 Kevin M. Dean 2006-12-01 13:29:05 PST
I've updated to Acrobat 8 which in-turn updated the pdf plugin. It no longer crashes, but I don't know if this got fixed before I upgraded. Can someone who's still running version 7 of the plugin see if it still crashes for them.
Comment 15 Alexey Proskuryakov 2006-12-01 21:02:00 PST
Yes, the underlying regression in WebKit is still present - it cannot cope with an error returned from the plugin.
Comment 16 David Kilzer (:ddkilzer) 2006-12-17 16:10:28 PST
*** Bug 11851 has been marked as a duplicate of this bug. ***
Comment 17 Mark Rowe (bdash) 2007-01-16 19:06:03 PST
<rdar://problem/4928621>
Comment 18 Maciej Stachowiak 2007-02-07 05:26:16 PST
The Radar is closed due to the new Acrobat 8, but as Alexey says this is still a real regression, so adding back NeedsRadar.
Comment 19 Maciej Stachowiak 2007-02-10 19:12:28 PST
<rdar://problem/4990042>
Comment 20 Alexey Proskuryakov 2007-03-18 09:34:29 PDT
Looks like the problem has been fixed during loader refactoring (which has changed this code very heavily). I can not reproduce it anymore; here is what I tried:

1) Hacked the return value of NPP_NewStream to be an error (matching how Acrobat 7 worked), patch below.
2) Opened the bug URL - but Acrobat 8 doesn't even get to this point in code, so it didn't prove anything.
3) Opened www.adobe.com/flash - the Flash plugin got this code to execute, but WebKit didn't have any problem handling the error.

I couldn't test with Acrobat 7 because of bug 10510. However, I'm confused by the duplicates that were filed much later than bug 10510, yet used Acrobat 7. Does Acrobat 7 work for anyone with nightlies?



Index: /Users/ap/WebKit/WebKit/Plugins/WebBaseNetscapePluginStream.m
===================================================================
--- /Users/ap/WebKit/WebKit/Plugins/WebBaseNetscapePluginStream.m       (revision 20268)
+++ /Users/ap/WebKit/WebKit/Plugins/WebBaseNetscapePluginStream.m       (working copy)
@@ -234,6 +234,7 @@
     WebBaseNetscapePluginView *pv = pluginView;
     [pv willCallPlugInFunction];
     NPError npErr = NPP_NewStream(plugin, (char *)[MIMEType UTF8String], &stream, NO, &transferMode);
+    npErr = 1;
     [pv didCallPlugInFunction];
     LOG(Plugins, "NPP_NewStream URL=%@ MIME=%@ error=%d", responseURL, MIMEType, npErr);
Comment 21 Patricia Warwick 2007-03-18 10:08:05 PDT
I'm using Adobe Reader 7.0.5 and WebKit still crashes when I link to a PDF file.
Comment 22 Alexey Proskuryakov 2007-03-19 03:51:12 PDT
Thank you for checking! Could you please post the crash log that you are getitng with a current nightly build?
Comment 23 Patricia Warwick 2007-03-19 05:26:10 PDT
Created attachment 13703 [details]
Crash Log for PDF crash

Acrobate Reader 7.0.5 crash
Comment 24 Peter Norby 2007-04-02 08:47:30 PDT
Created attachment 13918 [details]
Yet another PDF crash log

Here's another one, 10.4.9, Adobe Reader 7.0.8, NIghtly Build 20652.

-/\/
Comment 25 Alexey Proskuryakov 2007-04-16 12:57:04 PDT
*** Bug 13316 has been marked as a duplicate of this bug. ***
Comment 26 Alexey Proskuryakov 2007-04-21 03:25:27 PDT
I can reproduce this with Acrobat 7 and and a local debug WebKit build now. Still no idea on how to fix.
Comment 27 David Kilzer (:ddkilzer) 2007-06-04 08:06:36 PDT
*** Bug 13983 has been marked as a duplicate of this bug. ***
Comment 28 Jay Batson 2007-06-19 12:29:14 PDT
Created attachment 15124 [details]
Yet another PDF crash log

Safari log file
Comment 29 Jay Batson 2007-06-19 12:29:44 PDT
In my case, I'm not sure which "helper" is supposed to be displaying the PDF.  I had ShubertIT's PDFbrowser plug-in installed (in /Library/Internet Plug-Ins/).  It's been working fine with Safari until the new 3.0 (beta?) release.  The first time I hit a PDF file, Safari crashed.  I blamed it on the Plug-In, so I de-installed the Plug-in, and went to view the PDF (again).  Crash again.  At this moment, I'm not sure there _is_ a PDF viewer associated with this type.  However, note that I _do_ have Adobe Acrobat Pro installed, and there could be a residual handler from this that is trying to handle the PDF display.

Comment 30 Alexey Proskuryakov 2007-07-09 21:56:34 PDT
Fixed by Anders in r24118 as <rdar://problem/4954319>. See comment 17 and comment 19 for duplicate Radars.