sponnusa / firebreath

Automatically exported from code.google.com/p/firebreath
0 stars 0 forks source link

Stack overflow when returning JSAPIWeakPtr #151

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a method to be called by javascript that returns a JSAPIWeakPtr
2. Call method from javascript
3. Watch your stack overflow :)

What is the expected output? What do you see instead?
Not a stack overflow

What version of FireBreath are you using? On what operating system and
browsers?
4.0rc1 on Windows 7 x64 under Firefox 3.6.13

What version of your compiler or IDE are you using?
Visual Studio 2010 Professional

Please provide any additional information below.
Here is part of the backtrace:

    npPjsipJs.dll!FB::make_variant<boost::weak_ptr<FB::JSAPI> >(boost::weak_ptr<FB::JSAPI> t={...})  Line 846 + 0xd bytes   C++

    npPjsipJs.dll!FB::variant::assign<boost::weak_ptr<FB::JSAPI> >(boost::weak_ptr<FB::JSAPI> x={...})  Line 356 + 0x26 bytes   C++

    npPjsipJs.dll!FB::variant::variant<boost::weak_ptr<FB::JSAPI> >(const boost::weak_ptr<FB::JSAPI> & x={...})  Line 299   C++

    npPjsipJs.dll!FB::variant_detail::conversion::make_variant<FB::JSAPI>(const boost::weak_ptr<FB::JSAPI> & ptr={...})  Line 201 + 0x44 bytes  C++

    npPjsipJs.dll!FB::make_variant<boost::weak_ptr<FB::JSAPI> >(boost::weak_ptr<FB::JSAPI> t={...})  Line 846 + 0xd bytes   C++

    npPjsipJs.dll!FB::variant::assign<boost::weak_ptr<FB::JSAPI> >(boost::weak_ptr<FB::JSAPI> x={...})  Line 356 + 0x26 bytes   C++

    npPjsipJs.dll!FB::variant::variant<boost::weak_ptr<FB::JSAPI> >(const boost::weak_ptr<FB::JSAPI> & x={...})  Line 299   C++
    npPjsipJs.dll!FB::detail::methods::method_wrapper4<PjsipJsAPI,boost::weak_ptr<FB::JSAPI>,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,boost::optional<bool>,boost::weak_ptr<FB::JSAPI> (__thiscall PjsipJsAPI::*)(std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const &,boost::optional<bool>)>::operator()(PjsipJsAPI * instance=0x0a588504, const std::vector<FB::variant,std::allocator<FB::variant> > & in=[3]({table=0x0e429850 object=0x0a53fa40 },{table=0x0e429850 object=0x0a53f860 },{table=0x0e429850 object=0x0a53fae0 }))  Line 161 + 0x10f bytes   C++

I'm wondering if JSObject.h line 201 should be changed to: return 
variant(FB::JSAPIWeakPtr(tmp), true); ?

Original issue reported on code.google.com by zal...@gmail.com on 23 Feb 2011 at 6:12

GoogleCodeExporter commented 9 years ago
Could you please post an example project that reproduces this issue?

Original comment by taxilian on 23 Feb 2011 at 7:24

GoogleCodeExporter commented 9 years ago
Attached is the code and sample html page to reproduce the stack overflow.  

Original comment by zal...@gmail.com on 23 Feb 2011 at 9:18

Attachments:

GoogleCodeExporter commented 9 years ago
you are correct... that should have been , true).  Strange, I thought we'd 
tested that :-/ sorry, and thanks for reporting the issue! I'll have it fixed 
shortly

Original comment by taxilian on 23 Feb 2011 at 10:07

GoogleCodeExporter commented 9 years ago
Fixed in both master and 1.4 branches.  Also, a test has been added for this 
issue.

Original comment by taxilian on 23 Feb 2011 at 10:23