Re: [Ecls-list] Any way to get stack out of condition?

2013-02-18 Thread Peter Enerccio
I used this method:

(defun print-error-log (eout e)
  (format eout "Unhandled error detected: ~%")
  (format eout "~A~%" e)
  (when (c-code::error-data-p)
(format eout "Additional error data: ~%~A~%" (c-code::get-error-data)))
  (format eout "Backtrace: ~%")
  (loop for x from (- (si::ihs-top) 2) downto 1
 do
   (format eout "~A~%" (si::ihs-fun x))
   (format eout " Args:~%")
   (let ((env (si::decode-ihs-env (si::ihs-env x
 (dolist (ip env)
   (format eout "  ~A= ~A~%" (car ip) (cdr ip
   (format eout "~%"))
  (format eout "~%")
  (format eout "C stack: ~%")
  (c-code::print-c-stack eout)
  (format eout "~%"))

which relies on two c side things, c-code::print-c-stack which is just
platform dependent method for printing c stack and
c-code::error-data-p / c-code::get-error-data, which is a c global value
accessor (reason why is isn't lisp global value is that
unfortunately, ecl handles this in separate thread/context, thus every
special variable is nil).

this method is then used in handler-bind:

(defun handle-any-error-log (e)
  (with-open-file (eout "errors.txt"
:direction :output)
(print-error-log eout e))
  (print-error-log *standard-output* e)
  (throw :end-execution-on-error :error-handled))

(eval-when (:load-toplevel :execute)
  (catch :end-execution-on-error
(handler-bind
((error #'handle-any-error-log))
  (post-initialization



Output is pretty nice, imo:

Unhandled error detected:
Thats enough!
Backtrace:
#
 Args:
  DELTA-TIME= 876
  SCENE= #
  WINDOW= #

G26
 Args:
  CORE::W= #

#
 Args:
  WINDOW= #

#
 Args:

LOAD-INTERNAL
 Args:
  CORE::LOC-NAME= code/init.lisp
  CORE::GLO-NAME=
/media/home/home/enerccio/projects/gaia/gaia/pakdata/code/init.lisp
  CORE::LISP-FILE= init.lisp

POST-INITIALIZATION
 Args:


C stack:
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(c_stack+0x62)
[0x4090f2]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x4f15)
[0x7fbec1145f15]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x4857)
[0x7fbec1145857]
/usr/lib/libecl.so.12.12(+0x12eb99) [0x7fbec5129b99]
/usr/lib/libecl.so.12.12(+0x12ed88) [0x7fbec5129d88]
/usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fbec51649e8]
/usr/lib/libecl.so.12.12(cl_error+0xd6) [0x7fbec5185406]
/usr/lib/libecl.so.12.12(ecl_interpret+0x1cad) [0x7fbec51671bd]
/usr/lib/libecl.so.12.12(cl_apply+0x29b) [0x7fbec5164d2b]
/usr/lib/libecl.so.12.12(+0x111ae4) [0x7fbec510cae4]
/usr/lib/libecl.so.12.12(+0x117031) [0x7fbec5112031]
/usr/lib/libecl.so.12.12(_ecl_standard_dispatch+0x198) [0x7fbec516fed8]
/usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fbec51649e8]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(render_once+0x128)
[0x408d8d]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(start_loop+0x33)
[0x408c02]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(cl_start_loop+0x25)
[0x408c43]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x3ad2)
[0x7fbec1144ad2]
/usr/lib/libecl.so.12.12(cl_apply+0x29b) [0x7fbec5164d2b]
/usr/lib/libecl.so.12.12(+0x111ae4) [0x7fbec510cae4]
/usr/lib/libecl.so.12.12(+0x117031) [0x7fbec5112031]
/usr/lib/libecl.so.12.12(_ecl_standard_dispatch+0x198) [0x7fbec516fed8]
/usr/lib/libecl.so.12.12(ecl_interpret+0x1f97) [0x7fbec51674a7]
/usr/lib/libecl.so.12.12(ecl_interpret+0x1ece) [0x7fbec51673de]
/usr/lib/libecl.so.12.12(+0x17118f) [0x7fbec516c18f]
/usr/lib/libecl.so.12.12(si_eval_with_env+0x2eb) [0x7fbec516dd3b]
/usr/lib/libecl.so.12.12(si_load_source+0x191) [0x7fbec51bce41]
/usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fbec51649e8]
/usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fbec51bd6bd]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x5561)
[0x7fbec1146561]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x599e)
[0x7fbec114699e]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(init_fas_CODE+0x2036)
[0x7fbec114e276]
/usr/lib/libecl.so.12.12(ecl_init_module+0x409) [0x7fbec5181bb9]
/usr/lib/libecl.so.12.12(si_load_binary+0x9a) [0x7fbec51bcb7a]
/usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fbec51649e8]
/usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fbec51bd6bd]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(init_common_lisp_subsystem+0xf0)
[0x40907e]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(main+0x25)
[0x408e61]
/usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7fbec3e5d725]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia() [0x403ee9]

what I don't like is that I can't get fas compiled objects to show c debug
symbol names, no matter if I add -fdynamic or not, it will only show
init_fas_CODE symbol,
and nothing else. Oh well...


2013/2/19 Anton Vodonosov 

> 03.02.2013, 05:34, "Peter Enerccio" :
> > I actually got it working, so it was most likely problem on my side.
> Thanks!
>
> Could you share your findings? What is the right reciepe for printing
> backtrace?
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo

Re: [Ecls-list] Any way to get stack out of condition?

2013-02-18 Thread Anton Vodonosov
03.02.2013, 05:34, "Peter Enerccio" :
> I actually got it working, so it was most likely problem on my side. Thanks!

Could you share your findings? What is the right reciepe for printing backtrace?

--
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-02-02 Thread Matthew Mondor
On Sun, 3 Feb 2013 02:32:42 +0100
Peter Enerccio  wrote:

> I actually got it working, so it was most likely problem on my side. Thanks!

You're welcome, and I'm glad that it works,
-- 
Matt

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-02-02 Thread Peter Enerccio
I actually got it working, so it was most likely problem on my side. Thanks!


2013/1/31 Matthew Mondor 

> On Thu, 31 Jan 2013 17:03:44 -0500
> Matthew Mondor  wrote:
>
> > Hmm that's not impossible, especially if it's a recent migration or
> > concerns mostly the bytecode interpreter (which I have less experience
> > with except for the REPL).
>
> s/migration/regression/ of course :)
> --
> Matt
>
>
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> ___
> Ecls-list mailing list
> Ecls-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-31 Thread Matthew Mondor
On Thu, 31 Jan 2013 17:03:44 -0500
Matthew Mondor  wrote:

> Hmm that's not impossible, especially if it's a recent migration or
> concerns mostly the bytecode interpreter (which I have less experience
> with except for the REPL).

s/migration/regression/ of course :)
-- 
Matt

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-31 Thread Matthew Mondor
On Thu, 31 Jan 2013 22:48:24 +0100
Juan Jose Garcia-Ripoll  wrote:

> On Wed, Jan 30, 2013 at 5:06 PM, Peter Enerccio  wrote:
> 
> > Well, I am trying to get with handler-bind, however, it still prints
> > nothing at all (for the backtrace, I mean)
> >
> 
> Probably what Anton said is the origin of your problems. I need some time
> to look into this. Could you please file a bug report with your test case?

Hmm that's not impossible, especially if it's a recent migration or
concerns mostly the bytecode interpreter (which I have less experience
with except for the REPL).

However, in the httpd I wrote for ECL, worker threads are used
(compiled to C with a high DEBUG level) and it's generally possible to
obtain some information about the stack in the custom debug hook, if I
remember.

(http://cvs.pulsar-zone.net/cgi-bin/cvsweb.cgi/mmondor/mmsoftware/cl/server/
for reference, although it has been posted here before, but I don't
remember if it was in the same thread).  Functions of interest are in
ecl-mp-server.lisp: WITH-LOG-ERRORS, LOG-ERROR and STACKTRACE.
-- 
Matt

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-31 Thread Juan Jose Garcia-Ripoll
On Wed, Jan 30, 2013 at 5:06 PM, Peter Enerccio  wrote:

> Well, I am trying to get with handler-bind, however, it still prints
> nothing at all (for the backtrace, I mean)
>

Probably what Anton said is the origin of your problems. I need some time
to look into this. Could you please file a bug report with your test case?


-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-31 Thread Peter Enerccio
By the way, anton, your guess is right.

> ((lambda () (si::ihs-fun 1)))

#

directly from ecl repl..


2013/1/31 Peter Enerccio 

> I managed to grab c stack (on linux anyways) which is nice, but not that
> very revealing for any bytecoded functions...
>
> Unhandled error detected:
> something went hairy
> Backtrace:
>
> C stack:
> /media/home/home/enerccio/
> projects/gaia/gaia/Debug/gaia(c_stack+0x62) [0x4024ae]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2a26)
> [0x7fe16cfc3a26]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x26d7)
> [0x7fe16cfc36d7]
> /usr/lib/libecl.so.12.12(+0x12eb99) [0x7fe170954b99]
> /usr/lib/libecl.so.12.12(+0x12ed88) [0x7fe170954d88]
> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
> /usr/lib/libecl.so.12.12(cl_error+0xd6) [0x7fe1709b0406]
> /usr/lib/libecl.so.12.12(ecl_interpret+0x1cad) [0x7fe1709921bd]
> /usr/lib/libecl.so.12.12(ecl_interpret+0x1ece) [0x7fe1709923de]
> /usr/lib/libecl.so.12.12(+0x17118f) [0x7fe17099718f]
> /usr/lib/libecl.so.12.12(si_eval_with_env+0x2eb) [0x7fe170998d3b]
> /usr/lib/libecl.so.12.12(si_load_source+0x191) [0x7fe1709e7e41]
> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
> /usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2ced)
> [0x7fe16cfc3ced]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x30ee)
> [0x7fe16cfc40ee]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(init_fas_CODE+0xc35)
> [0x7fe16cfc5ca5]
> /usr/lib/libecl.so.12.12(ecl_init_module+0x409) [0x7fe1709acbb9]
> /usr/lib/libecl.so.12.12(si_load_binary+0x9a) [0x7fe1709e7b7a]
> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
> /usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(init_common_lisp_subsystem+0xa0)
> [0x40243a]
> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(main+0x2a)
> [0x40226e]
> /usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7fe16fabd725]
> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia() [0x4019f9]
>
>
> 2013/1/31 Peter Enerccio 
>
>> I managed to grab c stack (on linux anyways) which is nice, but not that
>> very revealing for any bytecoded functions...
>>
>> Unhandled error detected:
>> something went hairy
>> Backtrace:
>>
>> C stack:
>> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(c_stack+0x62)
>> [0x4024ae]
>> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2a26)
>> [0x7fe16cfc3a26]
>> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x26d7)
>> [0x7fe16cfc36d7]
>> /usr/lib/libecl.so.12.12(+0x12eb99) [0x7fe170954b99]
>> /usr/lib/libecl.so.12.12(+0x12ed88) [0x7fe170954d88]
>> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
>> /usr/lib/libecl.so.12.12(cl_error+0xd6) [0x7fe1709b0406]
>> /usr/lib/libecl.so.12.12(ecl_interpret+0x1cad) [0x7fe1709921bd]
>> /usr/lib/libecl.so.12.12(ecl_interpret+0x1ece) [0x7fe1709923de]
>> /usr/lib/libecl.so.12.12(+0x17118f) [0x7fe17099718f]
>> /usr/lib/libecl.so.12.12(si_eval_with_env+0x2eb) [0x7fe170998d3b]
>> /usr/lib/libecl.so.12.12(si_load_source+0x191) [0x7fe1709e7e41]
>> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
>> /usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
>> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2ced)
>> [0x7fe16cfc3ced]
>> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x30ee)
>> [0x7fe16cfc40ee]
>> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(init_fas_CODE+0xc35)
>> [0x7fe16cfc5ca5]
>> /usr/lib/libecl.so.12.12(ecl_init_module+0x409) [0x7fe1709acbb9]
>> /usr/lib/libecl.so.12.12(si_load_binary+0x9a) [0x7fe1709e7b7a]
>> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
>> /usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
>> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(init_common_lisp_subsystem+0xa0)
>> [0x40243a]
>> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(main+0x2a)
>> [0x40226e]
>> /usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7fe16fabd725]
>> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia() [0x4019f9]
>>
>>
>>
>> 2013/1/31 Anton Vodonosov 
>>
>>> Another guess (sorry if I am mistaken).
>>>
>>> Do you run this code from the main REPL thread or from another thread?
>>>
>>> I remember I debugged hunchentoot on ECL and wanted stack trace
>>> of error happened during request handling (hunchentoot runs
>>> request handlers in separate threads).
>>>
>>> As you did, I looked at the ECL backtrace functions used in SLIME
>>> and tried to use them. Stack trace was empty.
>>>
>>> I looked at their source code and have *impression* that
>>> stack trace is only maintained for the REPL thread.
>>>
>>> Juan Jose must know better how stacktraces are implemented.
>>> But if you run from another thread, try from REPL. If you
>>> run from REPL and still doesn't have stacktrace, then
>>> my guess above does not apply.
>>>
>>> Best regar

Re: [Ecls-list] Any way to get stack out of condition?

2013-01-31 Thread Peter Enerccio
I managed to grab c stack (on linux anyways) which is nice, but not that
very revealing for any bytecoded functions...

Unhandled error detected:
something went hairy
Backtrace:

C stack:
/media/home/home/enerccio/
projects/gaia/gaia/Debug/gaia(c_stack+0x62) [0x4024ae]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2a26)
[0x7fe16cfc3a26]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x26d7)
[0x7fe16cfc36d7]
/usr/lib/libecl.so.12.12(+0x12eb99) [0x7fe170954b99]
/usr/lib/libecl.so.12.12(+0x12ed88) [0x7fe170954d88]
/usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
/usr/lib/libecl.so.12.12(cl_error+0xd6) [0x7fe1709b0406]
/usr/lib/libecl.so.12.12(ecl_interpret+0x1cad) [0x7fe1709921bd]
/usr/lib/libecl.so.12.12(ecl_interpret+0x1ece) [0x7fe1709923de]
/usr/lib/libecl.so.12.12(+0x17118f) [0x7fe17099718f]
/usr/lib/libecl.so.12.12(si_eval_with_env+0x2eb) [0x7fe170998d3b]
/usr/lib/libecl.so.12.12(si_load_source+0x191) [0x7fe1709e7e41]
/usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
/usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2ced)
[0x7fe16cfc3ced]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x30ee)
[0x7fe16cfc40ee]
/media/home/home/enerccio/projects/gaia/gaia/postinit.fas(init_fas_CODE+0xc35)
[0x7fe16cfc5ca5]
/usr/lib/libecl.so.12.12(ecl_init_module+0x409) [0x7fe1709acbb9]
/usr/lib/libecl.so.12.12(si_load_binary+0x9a) [0x7fe1709e7b7a]
/usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
/usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(init_common_lisp_subsystem+0xa0)
[0x40243a]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(main+0x2a)
[0x40226e]
/usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7fe16fabd725]
/media/home/home/enerccio/projects/gaia/gaia/Debug/gaia() [0x4019f9]


2013/1/31 Peter Enerccio 

> I managed to grab c stack (on linux anyways) which is nice, but not that
> very revealing for any bytecoded functions...
>
> Unhandled error detected:
> something went hairy
> Backtrace:
>
> C stack:
> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(c_stack+0x62)
> [0x4024ae]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2a26)
> [0x7fe16cfc3a26]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x26d7)
> [0x7fe16cfc36d7]
> /usr/lib/libecl.so.12.12(+0x12eb99) [0x7fe170954b99]
> /usr/lib/libecl.so.12.12(+0x12ed88) [0x7fe170954d88]
> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
> /usr/lib/libecl.so.12.12(cl_error+0xd6) [0x7fe1709b0406]
> /usr/lib/libecl.so.12.12(ecl_interpret+0x1cad) [0x7fe1709921bd]
> /usr/lib/libecl.so.12.12(ecl_interpret+0x1ece) [0x7fe1709923de]
> /usr/lib/libecl.so.12.12(+0x17118f) [0x7fe17099718f]
> /usr/lib/libecl.so.12.12(si_eval_with_env+0x2eb) [0x7fe170998d3b]
> /usr/lib/libecl.so.12.12(si_load_source+0x191) [0x7fe1709e7e41]
> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
> /usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x2ced)
> [0x7fe16cfc3ced]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(+0x30ee)
> [0x7fe16cfc40ee]
> /media/home/home/enerccio/projects/gaia/gaia/postinit.fas(init_fas_CODE+0xc35)
> [0x7fe16cfc5ca5]
> /usr/lib/libecl.so.12.12(ecl_init_module+0x409) [0x7fe1709acbb9]
> /usr/lib/libecl.so.12.12(si_load_binary+0x9a) [0x7fe1709e7b7a]
> /usr/lib/libecl.so.12.12(cl_funcall+0x78) [0x7fe17098f9e8]
> /usr/lib/libecl.so.12.12(cl_load+0x46d) [0x7fe1709e86bd]
> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(init_common_lisp_subsystem+0xa0)
> [0x40243a]
> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia(main+0x2a)
> [0x40226e]
> /usr/lib/libc.so.6(__libc_start_main+0xf5) [0x7fe16fabd725]
> /media/home/home/enerccio/projects/gaia/gaia/Debug/gaia() [0x4019f9]
>
>
>
> 2013/1/31 Anton Vodonosov 
>
>> Another guess (sorry if I am mistaken).
>>
>> Do you run this code from the main REPL thread or from another thread?
>>
>> I remember I debugged hunchentoot on ECL and wanted stack trace
>> of error happened during request handling (hunchentoot runs
>> request handlers in separate threads).
>>
>> As you did, I looked at the ECL backtrace functions used in SLIME
>> and tried to use them. Stack trace was empty.
>>
>> I looked at their source code and have *impression* that
>> stack trace is only maintained for the REPL thread.
>>
>> Juan Jose must know better how stacktraces are implemented.
>> But if you run from another thread, try from REPL. If you
>> run from REPL and still doesn't have stacktrace, then
>> my guess above does not apply.
>>
>> Best regards,
>> - Anton
>>
>> 30.01.2013, 20:07, "Peter Enerccio" :
>> > Well, I am trying to get with handler-bind, however, it still prints
>> nothing at all (for the backtrace, I mean)
>> >
>> > (defun handle-any-error-log (e)
>> >   (print "x") ; checking that we are indeed in the handl

Re: [Ecls-list] Any way to get stack out of condition?

2013-01-31 Thread Anton Vodonosov
Another guess (sorry if I am mistaken).

Do you run this code from the main REPL thread or from another thread?

I remember I debugged hunchentoot on ECL and wanted stack trace
of error happened during request handling (hunchentoot runs
request handlers in separate threads).

As you did, I looked at the ECL backtrace functions used in SLIME
and tried to use them. Stack trace was empty.

I looked at their source code and have *impression* that
stack trace is only maintained for the REPL thread.

Juan Jose must know better how stacktraces are implemented.
But if you run from another thread, try from REPL. If you
run from REPL and still doesn't have stacktrace, then
my guess above does not apply.

Best regards,
- Anton

30.01.2013, 20:07, "Peter Enerccio" :
> Well, I am trying to get with handler-bind, however, it still prints nothing 
> at all (for the backtrace, I mean)
>
> (defun handle-any-error-log (e)
>   (print "x") ; checking that we are indeed in the handler
>   (with-open-file (eout "errors.txt"
>             :direction :output)
>     (format eout "Unhandled error detected: ~%")
>     (format eout "~A~%" e)
>     (format eout "Backtrace: ~%")
>     (loop for x from (si::ihs-top)
>    to 0 do
>      (format eout "~A~%" (si::ihs-fun x)))
>     (format eout "~%")))
>
> (eval-when (:load-toplevel :execute)
>   (handler-bind
>   ((error #'handle-any-error-log))
>     (post-initialization)))
>
> Output:
>
> enerccio@G73Jh-Arch:~/projects/gaia/gaia$ cat errors.txt
> Unhandled error detected:
> LOAD: Could not load file 
> #P"/media/home/home/enerccio/projects/gaia/gaia/plugins/crap.fas" (Error: 
> "/media/home/home/enerccio/projects/gaia/gaia/plugins/crap.fas: file too 
> short")
> Backtrace:
> NIL
>
> 2013/1/30 Anton Vodonosov 
>> In CL you usually can't get stack trace "out of condition".
>>
>> Usually you can get the current stack trace. I.e. before stack is unwound.
>> I.e. catching error handler-bind you can get stack trace, because you are 
>> still
>> inside the stack, but for example with handler-case you are invoked after
>> the stack is unwound.
>>
>> PS. also check out trivial-backtrace if you want be portable library, 
>> although
>> I don't know if it supports ECL.
>>
>> 30.01.2013, 19:49, "Peter Enerccio" :
>>> I tried looking it up there, however it uses si::ihs-top/si::ihs-fun, which 
>>> at the condition handlers are for some reason 0 so there is nothing to do 
>>> at that point.
>>>
>>> 2013/1/30 Stas Boukarev 
 Peter Enerccio  writes:

> Hello, I was wondering if it is possible to get the stack of thrown
> condition.
> I dont think there is ansi way of doing that, however, I can see stack
> generated by conditions thrown in slime with ecl, so there must be a way 
> to
> do it.
 You can look at swank-ecl.lisp to see how slime does it.

 --
 With best regards, Stas.
>>>
>>> --
>>> Bc. Peter Vaňušanik
>>> http://www.bishojo.tk
>>
>>> ,
>>> --
>>> Everyone hates slow websites. So do we.
>>> Make your web apps faster with AppDynamics
>>> Download AppDynamics Lite for free today:
>>> http://p.sf.net/sfu/appdyn_d2d_jan
>>> ,
>>> ___
>>> Ecls-list mailing list
>>> Ecls-list@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/ecls-list
>
> --
> Bc. Peter Vaňušanik
> http://www.bishojo.tk
> ,
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> ,
> ___
> Ecls-list mailing list
> Ecls-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-31 Thread Matthew Mondor
On Thu, 31 Jan 2013 07:58:17 +0100
Peter Enerccio  wrote:

> Even if I put declaim in the file, it is still compiled with
>  DEBUG 0
> 
> ;;; Compiling /media/home/home/enerccio/
> projects/gaia/gaia/src/postinit.lisp.
> ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0

If I remember this misleading message is about the current level before
compiling, but I could be mistaken.  To make sure you could execute the
DECLAIM at the REPL before compilation and see if the stacktrace is now
available.  If so, perhaps there's a regression with applying OPTIMIZE
levels or such...
-- 
Matt

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-30 Thread Peter Enerccio
Even if I put declaim in the file, it is still compiled with
 DEBUG 0

;;; Compiling /media/home/home/enerccio/
projects/gaia/gaia/src/postinit.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0


2013/1/31 Matthew Mondor 

> On Wed, 30 Jan 2013 17:06:47 +0100
> Peter Enerccio  wrote:
>
> > Well, I am trying to get with handler-bind, however, it still prints
> > nothing at all (for the backtrace, I mean)
>
> Was the code compiled with an optimize debug level 2 or over?  I think
> that to get backtraces I needed that.
>
> i.e. at the start of a file:
>
> (declaim (optimize (debug 3)))
> --
> Matt
>
>
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> ___
> Ecls-list mailing list
> Ecls-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-30 Thread Matthew Mondor
On Wed, 30 Jan 2013 17:06:47 +0100
Peter Enerccio  wrote:

> Well, I am trying to get with handler-bind, however, it still prints
> nothing at all (for the backtrace, I mean)

Was the code compiled with an optimize debug level 2 or over?  I think
that to get backtraces I needed that.

i.e. at the start of a file:

(declaim (optimize (debug 3)))
-- 
Matt

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-30 Thread Peter Enerccio
Well, I am trying to get with handler-bind, however, it still prints
nothing at all (for the backtrace, I mean)

(defun handle-any-error-log (e)
  (print "x") ; checking that we are indeed in the handler
  (with-open-file (eout "errors.txt"
:direction :output)
(format eout "Unhandled error detected: ~%")
(format eout "~A~%" e)
(format eout "Backtrace: ~%")
(loop for x from (si::ihs-top)
   to 0 do
 (format eout "~A~%" (si::ihs-fun x)))
(format eout "~%")))

(eval-when (:load-toplevel :execute)
  (handler-bind
  ((error #'handle-any-error-log))
(post-initialization)))


Output:

enerccio@G73Jh-Arch:~/projects/gaia/gaia$ cat errors.txt
Unhandled error detected:
LOAD: Could not load file
#P"/media/home/home/enerccio/projects/gaia/gaia/plugins/crap.fas" (Error:
"/media/home/home/enerccio/projects/gaia/gaia/plugins/crap.fas: file too
short")
Backtrace:
NIL



2013/1/30 Anton Vodonosov 

> In CL you usually can't get stack trace "out of condition".
>
> Usually you can get the current stack trace. I.e. before stack is unwound.
> I.e. catching error handler-bind you can get stack trace, because you are
> still
> inside the stack, but for example with handler-case you are invoked after
> the stack is unwound.
>
> PS. also check out trivial-backtrace if you want be portable library,
> although
> I don't know if it supports ECL.
>
> 30.01.2013, 19:49, "Peter Enerccio" :
> > I tried looking it up there, however it uses si::ihs-top/si::ihs-fun,
> which at the condition handlers are for some reason 0 so there is nothing
> to do at that point.
> >
> > 2013/1/30 Stas Boukarev 
> >> Peter Enerccio  writes:
> >>
> >>> Hello, I was wondering if it is possible to get the stack of thrown
> >>> condition.
> >>> I dont think there is ansi way of doing that, however, I can see stack
> >>> generated by conditions thrown in slime with ecl, so there must be a
> way to
> >>> do it.
> >> You can look at swank-ecl.lisp to see how slime does it.
> >>
> >> --
> >> With best regards, Stas.
> >
> > --
> > Bc. Peter Vaňušanik
> > http://www.bishojo.tk
> > ,
> >
> --
> > Everyone hates slow websites. So do we.
> > Make your web apps faster with AppDynamics
> > Download AppDynamics Lite for free today:
> > http://p.sf.net/sfu/appdyn_d2d_jan
> > ,
> > ___
> > Ecls-list mailing list
> > Ecls-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ecls-list
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-30 Thread Anton Vodonosov
In CL you usually can't get stack trace "out of condition".

Usually you can get the current stack trace. I.e. before stack is unwound.
I.e. catching error handler-bind you can get stack trace, because you are still
inside the stack, but for example with handler-case you are invoked after
the stack is unwound.

PS. also check out trivial-backtrace if you want be portable library, although
I don't know if it supports ECL.

30.01.2013, 19:49, "Peter Enerccio" :
> I tried looking it up there, however it uses si::ihs-top/si::ihs-fun, which 
> at the condition handlers are for some reason 0 so there is nothing to do at 
> that point.
>
> 2013/1/30 Stas Boukarev 
>> Peter Enerccio  writes:
>>
>>> Hello, I was wondering if it is possible to get the stack of thrown
>>> condition.
>>> I dont think there is ansi way of doing that, however, I can see stack
>>> generated by conditions thrown in slime with ecl, so there must be a way to
>>> do it.
>> You can look at swank-ecl.lisp to see how slime does it.
>>
>> --
>> With best regards, Stas.
>
> --
> Bc. Peter Vaňušanik
> http://www.bishojo.tk
> ,
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> ,
> ___
> Ecls-list mailing list
> Ecls-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-30 Thread Peter Enerccio
I tried looking it up there, however it uses si::ihs-top/si::ihs-fun, which
at the condition handlers are for some reason 0 so there is nothing to do
at that point.


2013/1/30 Stas Boukarev 

> Peter Enerccio  writes:
>
> > Hello, I was wondering if it is possible to get the stack of thrown
> > condition.
> > I dont think there is ansi way of doing that, however, I can see stack
> > generated by conditions thrown in slime with ecl, so there must be a way
> to
> > do it.
> You can look at swank-ecl.lisp to see how slime does it.
>
> --
> With best regards, Stas.
>



-- 
Bc. Peter Vaňušanik
http://www.bishojo.tk
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] Any way to get stack out of condition?

2013-01-30 Thread Stas Boukarev
Peter Enerccio  writes:

> Hello, I was wondering if it is possible to get the stack of thrown
> condition.
> I dont think there is ansi way of doing that, however, I can see stack
> generated by conditions thrown in slime with ecl, so there must be a way to
> do it.
You can look at swank-ecl.lisp to see how slime does it.

-- 
With best regards, Stas.

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list