guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GUILE/SCWM] Why the hook is 0x0


From: P Pareit
Subject: [GUILE/SCWM] Why the hook is 0x0
Date: Wed, 11 Sep 2002 22:55:06 +0200
User-agent: KMail/1.4.2

I still got this backtrace,

Program received signal SIGSEGV, Segmentation fault.
0x4007bd5c in scm_hook_empty_p (hook=0x0) at hooks.c:227
(gdb) bt
#0  0x4007bd5c in scm_hook_empty_p (hook=0x0) at hooks.c:227
#1  0x0806271c in scwm_handle_error (data=0x8098fa0, tag=0x80b1750,
    throw_args=0x404829b0) at callbacks.c:501
#2  0x400a0811 in scm_internal_catch (tag=0x2374, body=0x400a0a30 <cwss_body>, 
    body_data=0xbffff220, handler=0x80626b6 <scwm_handle_error>, 
    handler_data=0x8098fa0) at throw.c:200
#3  0x400a0aae in scm_internal_stack_catch (tag=0x404961a0, body=0x404961a0,
    body_data=0x404961a0, handler=0x80626b6 <scwm_handle_error>, 
    handler_data=0x8098fa0) at throw.c:330
#4  0x080636cc in scwm_catching_eval_x (expr=0x404ab388) at callbacks.c:451
#5  0x08063653 in scwm_catching_load_from_port (port=0x404ab3a8)
    at callbacks.c:465
#6  0x080626b1 in scwm_body_eval_str (body_data=0x809a840) at callbacks.c:489
#7  0x400a0839 in scm_internal_catch (tag=0x2374, 
    body=0x8062674 <scwm_body_eval_str>, body_data=0x809a840, 
    handler=0x40094160 <cwdr_handler>, handler_data=0xbffff3f0) at throw.c:205
#8  0x400942a4 in scm_internal_cwdr (body=0x8062674 <scwm_body_eval_str>, 
    body_data=0x809a840, handler=0x8056970 <scm_handle_by_message_noexit>, 
    handler_data=0x8098fa0, stack_start=0x404961a0) at root.c:283
#9  0x08072ae9 in scm_internal_cwdr_no_unwind (
    body=0x8062674 <scwm_body_eval_str>, body_data=0x809a840, 
    handler=0x8056970 <scm_handle_by_message_noexit>, handler_data=0x8098fa0, 
    stack_start=0xbffff474) at guile-compat.c:64
#10 0x080627f2 in scwm_safe_eval_str (
    string=0x809a840 "\n\n\n\n\n\n\n\n(use-modules (app scwm 
optargs))\n\n(define-public guile-version (+ (string->number (major-version)) 
\n\t\t\t\t(/ (string->number (minor-version)) 10)))\n\n\n\n(if (> 
guile-version 1.3)\n    (setvbuf (cur"...) at callbacks.c:532
#11 0x080859df in scwm_main (argc=1, argv=0xbffff954) at scwm.c:1220
#12 0x40072ebe in gh_launch_pad (closure=0x8084d58, argc=1, argv=0xbffff954)
    at gh_init.c:60
#13 0x4007c987 in invoke_main_func (body_data=0x404961a0) at init.c:636
#14 0x4007c942 in scm_boot_guile_1 (base=0xbffff89c, closure=0xbffff8a0)
    at init.c:616
#15 0x4007c63b in scm_boot_guile (argc=1078550944, argv=0x404961a0,
    main_func=0x404961a0, closure=0x404961a0) at init.c:440
#16 0x40072ef9 in gh_enter (argc=1, argv=0xbffff954,
    c_main_prog=0x8084d58 <scwm_main>) at gh_init.c:70
#17 0x08084d4d in main (argc=1, argv=0xbffff954) at scwm.c:607
#18 0x4030c082 in __libc_start_main () from /lib/i686/libc.so.6

so I set a breakpoint at scwm_handle_error wich is like this:

static SCM 
scwm_handle_error (void *data, SCM tag, SCM throw_args)
{
  SCM port = scm_set_current_error_port(make_output_strport("error-handler"));
  SCM str;
  scm_handle_by_message_noexit(data,tag,throw_args);
  port = scm_set_current_error_port(port);
  str = scm_strport_to_string(port);
  if (SCM_BOOL_T == scm_hook_empty_p(error_hook)) {
*************************************^^^^^^^^^^
    scm_display(str,scm_def_errp);
    scm_newline(scm_def_errp);
  } else {
    scwm_run_hook_message_only(error_hook,
                               gh_list(str, SCM_UNDEFINED));
  }
  return SCM_UNSPECIFIED;
}

Printing error_hook gave me 0x0, something wat is not right.
So I look up error_hook wich is:

SCWM_HOOK(error_hook, "error-hook", 1,
"Called on all kinds of errors and exceptions.\n\
Whenever an error or other uncaught throw occurs on any callback,\n\
whether a hook, a mouse binding, a key binding, a menu entry, a file\n\
being processed, or anything else, error-hook will be invoked. Each\n\
procedure in the hook will be called with the throw arguments; these\n\
will generally include information about the nature of the error. ");

SCWM_HOOK is a macro wich expands depending if guile-snarf is run:

/* do not define this macro if we are extracting comments since
   the macro name is used as a lexical cue to the extractor */

#ifndef SCM_MAGIC_SNARFER
#define SCWM_HOOK(var, name, args, docstring) \
static SCM var
#else

#ifndef HAVE_SCM_MAKE_HOOK
#define SCWM_HOOK(var, name, args, docstring) \
SCM__I     do { var = scm_sysintern(name, SCM_EOL); } while (0)
#else
#ifdef HAVE_SCM_CREATE_HOOK
#define SCWM_HOOK(var, name, args, docstring) \
SCM__I     do { var = scm_create_hook(name,args); } while (0)
#else
#define SCWM_HOOK(var, name, args, docstring) \
SCM__I     do { var = scm_make_named_hook(name,args); } while (0)
#endif
#endif

#endif

Now error_hook does not show up in callback.x:

/* cpp arguments: callbacks.c -DHAVE_CONFIG_H -I. -I. -I../include 
-I../include -I/usr/X11R6/include -I/usr/local/include -g */
 scm_c_define_gsubr (s_safe_load, 1, 0, 0, (SCM (*)()) safe_load);
 scm_c_define_gsubr (s_set_load_processing_frequency_x, 1, 0, 0, (SCM (*)()) 
set_load_processing_frequency_x);
 scm_c_define_gsubr (s_add_timer_hook_x, 2, 0, 0, (SCM (*)()) 
add_timer_hook_x);
 scm_c_define_gsubr (s_remove_timer_hook_x, 1, 0, 0, (SCM (*)()) 
remove_timer_hook_x);
 scm_c_define_gsubr (s_reset_timer_hook_x, 0, 0, 0, (SCM (*)()) 
reset_timer_hook_x);
 scm_c_define_gsubr (s_get_timer_hooks_list, 0, 0, 0, (SCM (*)()) 
get_timer_hooks_list);
 scm_c_define_gsubr (s_add_input_hook_x, 2, 0, 0, (SCM (*)()) 
add_input_hook_x);
 scm_c_define_gsubr (s_remove_input_hook_x, 1, 0, 0, (SCM (*)()) 
remove_input_hook_x);
 scm_c_define_gsubr (s_reset_input_hook_x, 0, 0, 0, (SCM (*)()) 
reset_input_hook_x);
 scm_c_define_gsubr (s_get_input_hooks_list, 0, 0, 0, (SCM (*)()) 
get_input_hooks_list);
 scm_c_define_gsubr (s_call_interactively, 1, 1, 0, (SCM (*)()) 
call_interactively);

Should error_hook show up in the .x file?

There is mention of SCM__I in the ChangLog-2000 file, where it states that 
it's name is replaced from SCM__I to SCM_SNARF_INIT_START (same for SCM__D, 
SCM__S and SCM__E), if that is true, it would explane my problems in running 
scwm. So this could mean I best replace SCM__I, but it might even be better 
to change the macro's to guile-snarf macro's special made for the purpose 
(SCM_VARIABLE maybe?). Someone knows what I best do?

pieter;






reply via email to

[Prev in Thread] Current Thread [Next in Thread]