gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [bug #32411] ExternalInterface XML parser fails with nest


From: Nutchanon Wetchasit
Subject: [Gnash-commit] [bug #32411] ExternalInterface XML parser fails with nested tags
Date: Tue, 02 Feb 2016 14:26:05 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:25.5) Gecko/20150606 Firefox/31.9 PaleMoon/25.5.0

Follow-up Comment #20, bug #32411 (project gnash):

I have done some trial and error changes on how libgnashplugin allocates
NPObject
<http://git.savannah.gnu.org/cgit/gnash.git/tree/plugin/npapi/external.cpp?id=e705394a72888a8791497d94a7cf4c78b2e23f02#n334>
for returning as Object value from ExternalInterface callback:

* Original code: crashed at garbage collection.
* When got object return value from player, parse it, but then return `null`
to browser instead <https://savannah.gnu.org/bugs/?32411#comment19>: *not
crashing*.
* Zero-fill entire of new NPObject before use, then proceed normally: crashed
at garbage collection.
* Zero-fill entire of new NPObject before use, set dummy NPClass, then proceed
normally: crashed at garbage collection.
* Use `NPN_CreateObject()` to create object instead of `NPN_MemAlloc()`, with
`NULL` as class and NPP instance: _crashed at allocation_.
* Use `NPN_CreateObject()` to create object instead of `NPN_MemAlloc()`, with
dummy NPClass, and `NULL` NPP instance: _crashed at allocation_.
* Use `NPN_CreateObject()` to create object instead of `NPN_MemAlloc()`, with
dummy NPClass, and real NPP instance: *not crashing*.
* Call browser's `window.Object()` to create object instead of
`NPN_MemAlloc()`: *not crashing*.

Last approach looks the best: apart from not crashing, `NPN_SetProperty()`
is now working, and JavaScript's `typeof()` also returns "object"
(instead of just "function"), first-level Object members are also
get passed to JavaScript properly too.

In case anyone want to test the last approach, see the attached
`plugin-return-js-object.patch`.

Warning: This patch is experimental; it does work, but it breaks
libgnashplugin's automated test
<http://git.savannah.gnu.org/cgit/gnash.git/tree/plugin/npapi/test.cpp?id=e705394a72888a8791497d94a7cf4c78b2e23f02>
(compile error) as it hacked other parts of
plugin in order to pass `NPP` structure around, and it blatantly removed the
string conversion code which caused bug #47004 (otherwise it will crash
<https://savannah.gnu.org/bugs/?47004#comment1>).

Bug #47004 (at least on JavaScript-calls-Flash direction) would need to be
fixed in proper way before a fix for this issue could be carried out.

Gnash: 0.8.11dev (patched against git e705394 29-Jan-2016) NPAPI
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

P.S. Removing the string conversion code
<https://savannah.gnu.org/bugs/?47004#comment1> mentioned in bug #47004
alone won't fix the crash in browser's garbage collection.


(file #36232)
    _______________________________________________________

Additional Item Attachment:

File name: plugin-return-js-object.patch  Size:12 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?32411>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]