[syslog-ng] load failures in afsocket and afsql

Matthew Hall mhall at mhcomputing.net
Thu Dec 16 03:56:23 CET 2010


Some more information.

The first time my patterndb is read from disk it's supposed to be 
persisted to some kind of permanent storage. But for some reason it does 
not seem to be.

Thus when g_hash_table_lookup_extended is called, it returns NULL, and 
all hell breaks loose because the rest of the code assumes (reasonably) 
that an already-initted structure can't be NULL when you have 
initialized it and persisted it previously.

I need to figure out how this thing is getting persisted and what is 
going wrong there, as the problem is not getting logged anywhere I've 
been able to find.

I think it has to be persisted somewhere in here:

log_db_parser_reload_database
log_db_parser_init
log_parser_init
log_parser_rule_init
log_process_rule_init
log_process_pipe_init
log_pipe_init
log_center_init
cfg_init
cfg_initial_init
initial_init

Now I have a ton of code to read. :-(

I really hope somebody else can help me sort this one out.

Matthew.

log_pipe_init (s=0x148f8ec0, cfg=0x148c9860) at logpipe.h:88
88	  if (!(s->flags & PIF_INITIALIZED))
(gdb) print *s
$34 = {ref_cnt = 1, flags = 0, cfg = 0x0, pipe_next = 0x148f8f10, queue = 0x2adb089e37ef <log_process_pipe_queue>, 
  init = 0x2adb089e3723 <log_process_pipe_init>, deinit = 0x2adb089e378e <log_process_pipe_deinit>, 
  free_fn = 0x2adb089e38cd <log_process_pipe_free>, notify = 0}
...

91	      if (!s->init || s->init(s))
...

Breakpoint 1, log_db_parser_init (s=0x148f7270, cfg=0x148c9860) at dbparser.c:121
121	  LogDBParser *self = (LogDBParser *) s;
123	  self->db = cfg_persist_config_fetch(cfg, log_db_parser_format_persist_name(self));
log_db_parser_format_persist_name (self=0x148f7270) at dbparser.c:114
114	  g_snprintf(persist_name, sizeof(persist_name), "db-parser(%s)", self->db_file);
(gdb) print self->db_file
$35 = (gchar *) 0x148f7320 "/home/y/conf/ysyslogng/xml/corpmon-db.xml"
115	  return persist_name;
(gdb) print persist_name
$36 = "db-parser(/home/y/conf/ysyslogng/xml/corpmon-db.xml)", '\0' <repeats 459 times>

...

cfg_persist_config_fetch (cfg=0x148c9860, name=0x2adb0a72bd60 "db-parser(/home/y/conf/ysyslogng/xml/corpmon-db.xml)") at cfg.c:599
599	  gpointer res = NULL;
604	  if (cfg->persist && g_hash_table_lookup_extended(cfg->persist->keys, name, &tmp1, &tmp2))
615	  return res;
(gdb) print res
$37 = (gpointer) 0x0
616	}

...

log_db_parser_init (s=0x148f7270, cfg=0x148c9860) at dbparser.c:124
124	  if (self->db)
142	      log_db_parser_reload_database(self);
(gdb) print self->db
$38 = (PatternDB *) 0x0

...

Breakpoint 4, log_db_parser_reload_database (self=0x148f7270) at dbparser.c:61
61	  if (stat(self->db_file, &st) < 0)
68	  if ((self->db_file_inode == st.st_ino && self->db_file_mtime == st.st_mtime))
98	}
(gdb) print self->db_file_inode
$39 = 193445917
(gdb) print st.st_ino
$40 = 193445917
(gdb) print self->db_file_mtime
$41 = 1292463962
(gdb) print st.st_mtim
$42 = {tv_sec = 1292463962, tv_nsec = 0}

...

(gdb) n
log_db_parser_init (s=0x148f7270, cfg=0x148c9860) at dbparser.c:145
145	  self->timer_tick_id = g_timeout_add_seconds(1, log_db_parser_timer_tick, self);
(gdb) n
146	  return self->db != NULL;
(gdb) print self->db
$43 = (PatternDB *) 0x0
147	}
...

log_parser_init (s=0x148f7270, cfg=0x148c9860) at logparser.h:58
58	}

...

log_parser_rule_init (s=0x148f7360, cfg=0x148c9860) at logparser.c:106
106	        success = FALSE;
103	  for (l = self->parser_list; l; l = l->next)
108	  return success;
110	}

...

log_process_rule_init (s=0x148f7360, cfg=0x148c9860) at logprocess.h:64
64	}

...

log_process_pipe_init (s=0x148f8ec0) at logprocess.c:61
61	}

...

log_pipe_init (s=0x148f8ec0, cfg=0x148c9860) at logpipe.h:96
96	      return FALSE;
99	}

...

log_center_init (self=0x148d56f0, cfg=0x148c9860) at center.c:510
510	          msg_error("Error initializing message pipeline",


More information about the syslog-ng mailing list