Bug#551238: FTBFS: spidermonkey.c:(.text+0x52858): undefined reference to `JS_SetBranchCallback'

2010-01-09 Thread Y Giridhar Appaji Nag
On 09/11/04 09:59 +0200, Kalle Olavi Niemitalo said ...
 http://repo.or.cz/w/elinks/miciah.git?a=shortlog;h=refs/heads/miciah/heartbeat
 has a patch for this, using SIGVTALRM instead of SIGALRM
 (which is not how the ecmascript.max_exec_time is documented
 but should catch runaway scripts all the same).
 I haven't tested it.

I haven't been able to use patch to with the test [1] that Mike Hommey
suggested (ditto for a patch in the elinks git proper commit f31cf6f9).
However, in the interest of fixing this RC FTBFS and installability, I
uploaded a package with the above patch.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=551238#18

Giridhar

-- 
Y Giridhar Appaji Nag | http://www.appaji.net/


signature.asc
Description: Digital signature


Bug#551238: FTBFS: spidermonkey.c:(.text+0x52858): undefined reference to `JS_SetBranchCallback'

2009-11-04 Thread Kalle Olavi Niemitalo
http://repo.or.cz/w/elinks/miciah.git?a=shortlog;h=refs/heads/miciah/heartbeat
has a patch for this, using SIGVTALRM instead of SIGALRM
(which is not how the ecmascript.max_exec_time is documented
but should catch runaway scripts all the same).
I haven't tested it.


pgpZc4xR4vaGK.pgp
Description: PGP signature


Bug#551238: FTBFS: spidermonkey.c:(.text+0x52858): undefined reference to `JS_SetBranchCallback'

2009-10-25 Thread Kalle Olavi Niemitalo
We discussed this in IRC on 2009-07-18.
I think the plan was something like:

* Don't add threads.

* Use SIGALRM for both JS_TriggerOperationCallback and the
  select() race, with the same signal handler function.

* Add a global variable that lists the scripts being evaluated.
  Each element of the list contains a JSContext * and a time_t.
  The list should normally have just 0 or 1 element so we don't
  need any fancy priority queue.

* Add ecmascript_check_alarms(), which walks this list and calls
  JS_TriggerOperationCallback for each context whose timeout has
  expired.  It then returns the number that should be passed to
  the next alarm() call.

* Before each call to JS_EvaluateScript, construct a list element
  as an auto variable, add it to the list, and call
  alarm(ecmascript_check_alarms()).

* After each call to JS_EvaluateScript, remove the element from
  the list, and call alarm(ecmascript_check_alarms()).

* If e.g. Win32 doesn't support alarm(), don't implement the
  ECMAScript timeout there.

* The old SIGALRM code (critical_section, pending_alarm,
  alarm_handler, check_for_select_race, uninstall_alarm) seems
  intended to handle the case where a signal occurs immediately
  before select() and ELinks would instead like it to interrupt
  the select().  (The race condition could be entirely prevented,
  by blocking the signals almost all the time and letting
  pselect() unblock them.  That would however be less portable.)
  Because select_loop() is not called recursively, this should
  never get run during ECMAScript evaluation.  Add some
  assertions for that.

* There are some sleep() calls in error handlers.  Replace those
  with a wrapper that calls alarm(ecmascript_check_alarms())
  at the end, in case sleep() interfered with alarm().


pgp1U7f6LoQvR.pgp
Description: PGP signature