* Help needed on strange random error (Guile 2.0.9) @ 2013-12-06 12:04 Sun Yijiang 2013-12-06 22:16 ` Ludovic Courtès 0 siblings, 1 reply; 7+ messages in thread From: Sun Yijiang @ 2013-12-06 12:04 UTC (permalink / raw) To: guile-user@gnu.org [-- Attachment #1: Type: text/plain, Size: 797 bytes --] This happens very rarely, and randomly on almost any guile scripts, errors are: Backtrace: In ice-9/boot-9.scm: 157: 7 [catch #t #<catch-closure 1fe7960> ...] In unknown file: ?: 6 [apply-smob/1 #<catch-closure 1fe7960>] In ice-9/boot-9.scm: 63: 5 [call-with-prompt prompt0 ...] In ice-9/eval.scm: 432: 4 [eval # #] 386: 3 [eval # #] 386: 2 [eval # #] 393: 1 [eval #<memoized @@> #<directory (guile-user) 1fd8c60>] In unknown file: ?: 0 [memoize-variable-access! #<memoized @@> #<directory (guile-user) 1fd8c60>] ERROR: In procedure memoize-variable-access!: ERROR: Unbound variable: @@ The error won't repeat itself if you run again, it's like a ghost. Things got worse when I run a lot of my scripts in parallel (with GNU parallel). Could anyone give me a clue? Regards, Steve [-- Attachment #2: Type: text/html, Size: 969 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help needed on strange random error (Guile 2.0.9) 2013-12-06 12:04 Help needed on strange random error (Guile 2.0.9) Sun Yijiang @ 2013-12-06 22:16 ` Ludovic Courtès 2013-12-07 3:52 ` Sun Yijiang 0 siblings, 1 reply; 7+ messages in thread From: Ludovic Courtès @ 2013-12-06 22:16 UTC (permalink / raw) To: Sun Yijiang; +Cc: guile-user Sun Yijiang <sunyijiang@gmail.com> skribis: > This happens very rarely, and randomly on almost any guile scripts, errors > are: > > Backtrace: > In ice-9/boot-9.scm: > 157: 7 [catch #t #<catch-closure 1fe7960> ...] > In unknown file: > ?: 6 [apply-smob/1 #<catch-closure 1fe7960>] > In ice-9/boot-9.scm: > 63: 5 [call-with-prompt prompt0 ...] > In ice-9/eval.scm: > 432: 4 [eval # #] > 386: 3 [eval # #] > 386: 2 [eval # #] > 393: 1 [eval #<memoized @@> #<directory (guile-user) 1fd8c60>] > In unknown file: > ?: 0 [memoize-variable-access! #<memoized @@> #<directory (guile-user) > 1fd8c60>] > > ERROR: In procedure memoize-variable-access!: > ERROR: Unbound variable: @@ Could you post the script in question, and the command line used to run it? Thanks, Ludo’. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help needed on strange random error (Guile 2.0.9) 2013-12-06 22:16 ` Ludovic Courtès @ 2013-12-07 3:52 ` Sun Yijiang 2013-12-07 11:07 ` Ludovic Courtès 0 siblings, 1 reply; 7+ messages in thread From: Sun Yijiang @ 2013-12-07 3:52 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user [-- Attachment #1: Type: text/plain, Size: 1364 bytes --] It's an application using Guile for extensions, involving a bunch of C++ / Scheme code and need an environment to run, so I'm afraid it's not quite possible to post them here. Besides, there are commercial secrets included. I know it's hard to get any help with such little infomation. I'll try to post an example script that can reproduce this problem. Still, any hint on where I can start looking into this problem? Thanks, Steve 2013/12/7 Ludovic Courtès <ludo@gnu.org> > Sun Yijiang <sunyijiang@gmail.com> skribis: > > > This happens very rarely, and randomly on almost any guile scripts, > errors > > are: > > > > Backtrace: > > In ice-9/boot-9.scm: > > 157: 7 [catch #t #<catch-closure 1fe7960> ...] > > In unknown file: > > ?: 6 [apply-smob/1 #<catch-closure 1fe7960>] > > In ice-9/boot-9.scm: > > 63: 5 [call-with-prompt prompt0 ...] > > In ice-9/eval.scm: > > 432: 4 [eval # #] > > 386: 3 [eval # #] > > 386: 2 [eval # #] > > 393: 1 [eval #<memoized @@> #<directory (guile-user) 1fd8c60>] > > In unknown file: > > ?: 0 [memoize-variable-access! #<memoized @@> #<directory (guile-user) > > 1fd8c60>] > > > > ERROR: In procedure memoize-variable-access!: > > ERROR: Unbound variable: @@ > > Could you post the script in question, and the command line used to > run it? > > Thanks, > Ludo’. > [-- Attachment #2: Type: text/html, Size: 1883 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help needed on strange random error (Guile 2.0.9) 2013-12-07 3:52 ` Sun Yijiang @ 2013-12-07 11:07 ` Ludovic Courtès 2013-12-10 7:04 ` Sun Yijiang 0 siblings, 1 reply; 7+ messages in thread From: Ludovic Courtès @ 2013-12-07 11:07 UTC (permalink / raw) To: Sun Yijiang; +Cc: guile-user Sun Yijiang <sunyijiang@gmail.com> skribis: > It's an application using Guile for extensions, involving a bunch of C++ / > Scheme code and need an environment to run, so I'm afraid it's not quite > possible to post them here. Besides, there are commercial secrets included. > > I know it's hard to get any help with such little infomation. I'll try to > post an example script that can reproduce this problem. That would be great. > Still, any hint on where I can start looking into this problem? First, in what context does ‘@@’ occur in the source? Normally you should rarely need to use it, but if you do, the correct syntax is: (@@ (foo) bar) which looks up private top-level variable ‘bar’ in module (foo). Second, the expression is being evaluated instead of run from compiled code (hence the ‘eval’ in the backtrace.) You should arrange to run compiled code instead, for instance by using ‘primitive-load’, which would auto-compile the source if needed. HTH, Ludo’. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help needed on strange random error (Guile 2.0.9) 2013-12-07 11:07 ` Ludovic Courtès @ 2013-12-10 7:04 ` Sun Yijiang 2013-12-10 8:46 ` Ludovic Courtès 0 siblings, 1 reply; 7+ messages in thread From: Sun Yijiang @ 2013-12-10 7:04 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user@gnu.org I managed to narrow the problem down to this: (abbreviated code snippets) /* from app.c */ static void init_builtins(void*) { scm_c_define_gsubr(...) scm_c_export(...) ... } static void _main(void *data, int argc, char* argv[]) { // smob definitions DEFINE_SMOB(....) ... scm_c_define_module("builtin", init_builtins, NULL); scm_c_eval_string( "(current-warning-port (%make-void-port \"w\"))" "(read-set! keywords 'prefix)" "(add-to-load-path \"/my/scm/path\")" "(use-modules (builtin) (ice-9 readline)) (activate-readline)" ); scm_shell(argc, argv); } int main(int argc, char* argv[]) { scm_boot_guile(argc, argv, _main, 0); return 0; } /* end of app.c */ If I remove (use-modules (builtin)) but leave everything else the same, the problem goes away. I can say I found a fix, but I still don't know the cause. Any idea? Best, Steve 2013/12/7 Ludovic Courtès <ludo@gnu.org> > > Sun Yijiang <sunyijiang@gmail.com> skribis: > > > It's an application using Guile for extensions, involving a bunch of C++ / > > Scheme code and need an environment to run, so I'm afraid it's not quite > > possible to post them here. Besides, there are commercial secrets included. > > > > I know it's hard to get any help with such little infomation. I'll try to > > post an example script that can reproduce this problem. > > That would be great. > > > Still, any hint on where I can start looking into this problem? > > First, in what context does ‘@@’ occur in the source? Normally you > should rarely need to use it, but if you do, the correct syntax is: > > (@@ (foo) bar) > > which looks up private top-level variable ‘bar’ in module (foo). > > Second, the expression is being evaluated instead of run from compiled > code (hence the ‘eval’ in the backtrace.) You should arrange to run > compiled code instead, for instance by using ‘primitive-load’, which > would auto-compile the source if needed. > > HTH, > Ludo’. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help needed on strange random error (Guile 2.0.9) 2013-12-10 7:04 ` Sun Yijiang @ 2013-12-10 8:46 ` Ludovic Courtès 2013-12-13 5:52 ` Sun Yijiang 0 siblings, 1 reply; 7+ messages in thread From: Ludovic Courtès @ 2013-12-10 8:46 UTC (permalink / raw) To: Sun Yijiang; +Cc: guile-user@gnu.org Sun Yijiang <sunyijiang@gmail.com> skribis: > static void _main(void *data, int argc, char* argv[]) { > // smob definitions > DEFINE_SMOB(....) > ... > > scm_c_define_module("builtin", init_builtins, NULL); > scm_c_eval_string( > "(current-warning-port (%make-void-port \"w\"))" > "(read-set! keywords 'prefix)" > "(add-to-load-path \"/my/scm/path\")" > "(use-modules (builtin) (ice-9 readline)) (activate-readline)" > ); > scm_shell(argc, argv); > } Could you add this line right after the ‘scm_c_define_module’ line: scm_write (scm_current_module (), scm_current_error_port ()); What does it print? Ludo’. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Help needed on strange random error (Guile 2.0.9) 2013-12-10 8:46 ` Ludovic Courtès @ 2013-12-13 5:52 ` Sun Yijiang 0 siblings, 0 replies; 7+ messages in thread From: Sun Yijiang @ 2013-12-13 5:52 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guile-user@gnu.org It prints #<directory (guile-user) ........> However, I cannot reproduce this problem any more. Steve 2013/12/10 Ludovic Courtès <ludo@gnu.org>: > Sun Yijiang <sunyijiang@gmail.com> skribis: > >> static void _main(void *data, int argc, char* argv[]) { >> // smob definitions >> DEFINE_SMOB(....) >> ... >> >> scm_c_define_module("builtin", init_builtins, NULL); >> scm_c_eval_string( >> "(current-warning-port (%make-void-port \"w\"))" >> "(read-set! keywords 'prefix)" >> "(add-to-load-path \"/my/scm/path\")" >> "(use-modules (builtin) (ice-9 readline)) (activate-readline)" >> ); >> scm_shell(argc, argv); >> } > > Could you add this line right after the ‘scm_c_define_module’ line: > > scm_write (scm_current_module (), scm_current_error_port ()); > > What does it print? > > Ludo’. ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-12-13 5:52 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-12-06 12:04 Help needed on strange random error (Guile 2.0.9) Sun Yijiang 2013-12-06 22:16 ` Ludovic Courtès 2013-12-07 3:52 ` Sun Yijiang 2013-12-07 11:07 ` Ludovic Courtès 2013-12-10 7:04 ` Sun Yijiang 2013-12-10 8:46 ` Ludovic Courtès 2013-12-13 5:52 ` Sun Yijiang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).