Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3510] Android evalJS crashing with SIGSEGV

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionDuplicate
Resolution Date2011-04-15T03:46:06.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect
ReporterKT
AssigneeDon Thorp
Created2011-04-15T03:46:05.000+0000
Updated2017-03-29T22:15:05.000+0000

Description

I've been going over this, and I'm fairly certain this is a bug.

Here's the minimal test that will crash on Android with SIGSEGV:

var win = Ti.UI.createWindow({

// Android
navBarHidden: false,
exitOnClose: true

}); var view = Ti.UI.createWebView({

scalesPageToFit: false,
url: 'something.html'

}); view.addEventListener('load', function() {

view.evalJS("test");

}); win.add(view);
win.open();

(Although I find it hard to believe people aren't somehow using evalJS() on Android. You'd think it would be a higher-profile issue.)

Anyway, that code gives a crash dump similar to http://pastie.org/1754641">http://pastie.org/1754641.

Comments

  1. KT 2011-04-15

    Sorry about that formatting. I just realized how it pasted. Hopefully this is better.

    (Also, confirming that this crash also happens with 1.7 beta.)

       var win = Ti.UI.createWindow({
           // Android
           navBarHidden: false,
           exitOnClose: true
       });
       var view = Ti.UI.createWebView({
           scalesPageToFit: false,
           url: 'something.html'
       });
       view.addEventListener('load', function() {
           view.evalJS("test");
       });
       win.add(view);
       win.open();
       
  2. KT 2011-04-15

    Just as some further background and to help try to pinpoint it regression-wise, this issue seems to go back at least a year:

    http://developer.appcelerator.com/question/117750/android-evaljs">http://developer.appcelerator.com/question/117750/android-evaljs

    http://developer.appcelerator.com/question/67431/js-to-webview-working-on-iphone-not-in-android"> http://developer.appcelerator.com/question/67431/js-to-webview-working-on-iphone-not-in-android

    http://developer.appcelerator.com/question/41671/problem-with-webviewevaljs---doesnt-seem-to-work-at-all-with-android-emulator"> http://developer.appcelerator.com/question/41671/problem-with-webviewevaljs---doesnt-seem-to-work-at-all-with-android-emulator

    http://developer.appcelerator.com/question/13431/evaljs-not-working-anymore-since-12x-upgrade-on-android-16"> http://developer.appcelerator.com/question/13431/evaljs-not-working-anymore-since-12x-upgrade-on-android-16

    This is, strangely, in direct contravention to your drillbit test in:

    https://github.com/appcelerator/titanium_mobile/commit/597a4878af606e255811964cc5cbc9b93df5dfb2"> https://github.com/appcelerator/titanium_mobile/commit/597a4878af606e255811964cc5cbc9b93df5dfb2

    If that works, then what is drillbit doing differently so that it works whereas the app.js above crashes hard immediately?

  3. KT 2011-04-15

    Further information: This crash doesn't seem to happen on 3.0. But the necessary Ti Javascript seems to never get injected, as is the case with 1.6 (i.e., no crash, but no Ti injection).

  4. hal 2011-04-15

    The information in this ticket has been moved to http://appc.me/timob-3554" title="Ticket #3554">#3554

  5. Lee Morris 2017-03-29

    Closing ticket as duplicate.

JSON Source