anonymous2ch / libproxy

Automatically exported from code.google.com/p/libproxy
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Pac file doesn't work with pacrunner_webkit.cpp #154

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. do a little patch

--- pacrunner_webkit.cpp.old    2011-01-10 03:54:32.000000000 +0800
+++ pacrunner_webkit.cpp    2011-01-10 03:54:45.000000000 +0800
@@ -16,7 +16,8 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
  ******************************************************************************/
-
+ 
+#include <iostream>
 #include "../extension_pacrunner.hpp"
 using namespace libproxy;

@@ -127,7 +128,10 @@

        // Add the PAC into the context
        str = JSStringCreateWithUTF8CString(pac.c_str());
-       if (!JSCheckScriptSyntax(this->jsctx, str, NULL, 0, NULL)) goto error;
+       if (!JSCheckScriptSyntax(this->jsctx, str, NULL, 0, NULL)) {
+           std::cerr << "webkit_pacrunner bad_alloc: " << pac << std::endl;
+           goto error;
+       }
        JSEvaluateScript(this->jsctx, str, NULL, NULL, 1, NULL);
        JSStringRelease(str);
        return;

2. ~/src/libproxy-trunk/build/utils$ _PX_DEBUG= 
http_proxy=pac+file:///tmp/1.pac ./proxy http://example.com
Using config: 23envvar_config_extension
Using ignore: 
Config is: pac+file:///tmp/1.pac
PAC received!
Using pacrunner: 26webkit_pacrunner_extension
webkit_pacrunner bad_alloc: function FindProxyForURL(url, host)
{
    return "DIRECT";
}
modman::extension<basetype, sngl>::base_type() [with basetype = 
libproxy::ignore_extension, bool sngl = false]

3. (An ensuing bad_alloc exception unhandled)

What version of the product are you using? On what operating system?

 * libproxy trunk r777. 
 * Debian GNU/Linux testing (squeeze)
 * configured with: cmake .. -DCMAKE_BUILD_TYPE=None -DCMAKE_CXX_FLAGS="-O0 -g" -DCMAKE_C_FLAGS="-O0 -g"

Please provide any additional information below.

I haven't tested this with an actual application using recent version of 
libproxy because the version shipped by Debian is outdated.

Original issue reported on code.google.com by metacybernesis@gmail.com on 9 Jan 2011 at 8:03

GoogleCodeExporter commented 9 years ago
I just checked in a small patch regarding loading pac files from file://, which 
is likely to also address this one (initialization missing).

Can you try trunk r778 again to verify ?

Original comment by dominiqu...@gmail.com on 6 Feb 2011 at 1:07

GoogleCodeExporter commented 9 years ago
r778 solved the problem exactly described above. But other similar segfaults 
still happen. Please refer to issue 153.

Original comment by metacybernesis@gmail.com on 13 Mar 2011 at 10:55

GoogleCodeExporter commented 9 years ago
Thanks for the check. This means this very bug is fixed (we have issue 153 
still to tackle though)

Original comment by dominiqu...@gmail.com on 14 Mar 2011 at 4:42