{"id":610,"date":"2010-01-25T13:30:10","date_gmt":"2010-01-25T17:30:10","guid":{"rendered":"http:\/\/benjamin.smedbergs.us\/blog\/?p=610"},"modified":"2010-01-25T13:30:10","modified_gmt":"2010-01-25T17:30:10","slug":"error-calling-method-on-npobject","status":"publish","type":"post","link":"http:\/\/benjamin.smedbergs.us\/blog\/2010-01-25\/error-calling-method-on-npobject\/","title":{"rendered":"Error calling method on NPObject!"},"content":{"rendered":"<p>When a plugin crashes, content script may still have a reference to JS objects provided by that plugin. The JS objects will throw an exception &#8220;Error calling method on NPObject&#8221; when any properties or methods are called. Unfortunately, this generic error message is also thrown whenever a plugin method fails for any reason. You can&#8217;t tell, just by looking at the exception, whether the process crashed or some other type of failure occurred.<\/p>\n<p>This is important when a test fails: there could be any number of different errors lurking under the surface with similar outward appearance. Today there was a <a href=\"http:\/\/tinderbox.mozilla.org\/showlog.cgi?log=Firefox\/1264436181.1264437361.13846.gz\">Mochitest error<\/a> with the following symptoms:<\/p>\n<pre>197 ERROR TEST-UNEXPECTED-FAIL | \/tests\/modules\/plugin\/test\/test_painting.html | [SimpleTest\/SimpleTest.js, window.onerror] An error occurred - Error calling method on NPObject! at http:\/\/localhost:8888\/tests\/modules\/plugin\/test\/test_painting.html:105\r\nPROCESS-CRASH | automation.py | application crashed (minidump found)\r\nThread 1 (crashed)\r\nPROCESS-CRASH | automation.py | application crashed (minidump found)\r\nThread 1 (crashed)\r\nPROCESS-CRASH | automation.py | application crashed (minidump found)\r\nThread 1 (crashed)\r\nPROCESS-CRASH | automation.py | application crashed (minidump found)\r\nThread 1 (crashed)<\/pre>\n<p>Reading through the log, however, the important output is:<\/p>\n<pre>###!!! [RPCChannel][Child][\/builds\/moz2_slave\/mozilla-central-linux\/build\/ipc\/glue\/RPCChannel.cpp:276] Assertion (mDeferred.empty() || 1 == mDeferred.size()) failed.  expected mDeferred to have 0 or 1 items, but it has %lu (triggered by rpc)\r\n  local RPC stack size: 2863316886\r\n  remote RPC stack guess: 8\r\n  deferred stack size: 2863316886\r\n  out-of-turn RPC replies stack size: 2863316886\r\n  Pending queue size: 2863317142, front to back:<\/pre>\n<p>This assertion is immediately followed by an abort, which is visible in the crash dump output also:<\/p>\n<pre>Crash reason:  SIGSEGV\r\nCrash address: 0xbdce4804\r\n\r\nThread 1 (crashed)\r\n 0  libxul.so!mozilla::ipc::RPCChannel::DebugAbort(char const*, int, char const*, char const*, char const*, bool) [ipc_message.h:0235fc257969 : 97 + 0x0]<\/pre>\n<p>David B. mistakenly thought that this was a manifestation of <a href=\"https:\/\/bugzilla.mozilla.org\/show_bug.cgi?id=541102\">Bug 541102<\/a> when in fact it is an entirely unrelated bug with similar symptoms. When in doubt about a crash, please check with one of the Electrolysis team to help diagnose and read the log.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When a plugin crashes, content script may still have a reference to JS objects provided by that plugin. The JS objects will throw an exception &#8220;Error calling method on NPObject&#8221; when any properties or methods are called. Unfortunately, this generic error message is also thrown whenever a plugin method fails for any reason. You can&#8217;t [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[213,232],"class_list":["post-610","post","type-post","status-publish","format-standard","hentry","category-mozilla","tag-electrolysis","tag-oopp"],"_links":{"self":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/comments?post=610"}],"version-history":[{"count":2,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/610\/revisions"}],"predecessor-version":[{"id":612,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/posts\/610\/revisions\/612"}],"wp:attachment":[{"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/media?parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/categories?post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/benjamin.smedbergs.us\/blog\/wp-json\/wp\/v2\/tags?post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}