Hello, I'm experiencing a problem starting openvswitch 2.1 on an openSUSE13.1 (kernel version 3.11.10) system. Specifically, ovsdb-server enters an infinite loop during logging bringup.
When setting up logging levels for the various vlog_modules (please see lib/vlog.c:set_facility_level() and lib/vlog.c:vlog_set_log_file()) the lib/list.h:LIST_FOR_EACH macro iterates over a doubly linked list which in our case enters a final condition where prev==next and never terminates. >From gdb, the structure in this condition looks like the following: (gdb) p *mp $7 = {list = {prev = 0x6085a0 <VLM_ovsdb_server>, next = 0x6085a0 <VLM_ovsdb_server>}, name = 0x406699 "ovsdb_server", levels = {4, 1, 4}, min_level = 4, honor_rate_limits = true} Since mp->list.next never hits NULL, LIST_FOR_EACH never terminates. ovsdb-server is brought up in the following manner: ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/var/run/openvswitch/db.sock --private-key=db:Open_vSwitch,SSL,private_key --certificate=db:Open_vSwitch,SSL,certificate --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert --no-chdir --log-file=/var/log/openvswitch/ovsdb-server.log --pidfile=/var/run/openvswitch/ovsdb-server.pid --detach --monitor To work around the problem, I cooked up this quick macro and have successfully brought up the openvswitch service, added a bridge and port. I'm curious if anyone has hit this kind of problem? Also, any input on this workaround from someone here who is familiar with this code path would be very helpful. Thanks, -Karol
Index: lib/vlog.c =================================================================== --- lib/vlog.c.orig +++ lib/vlog.c @@ -227,7 +227,7 @@ set_facility_level(enum vlog_facility fa ovs_mutex_lock(&log_file_mutex); if (!module) { struct vlog_module *mp; - LIST_FOR_EACH (mp, list, &vlog_modules) { + LIST_FOR_EACH_CHECK (mp, list, &vlog_modules) { mp->levels[facility] = level; update_min_level(mp); } @@ -347,7 +347,7 @@ vlog_set_log_file(const char *file_name) log_writer = async_append_create(new_log_fd); } - LIST_FOR_EACH (mp, list, &vlog_modules) { + LIST_FOR_EACH_CHECK (mp, list, &vlog_modules) { update_min_level(mp); } ovs_mutex_unlock(&log_file_mutex); Index: lib/list.h =================================================================== --- lib/list.h.orig +++ lib/list.h @@ -79,5 +79,9 @@ bool list_is_short(const struct list *); ? ASSIGN_CONTAINER(NEXT, (ITER)->MEMBER.next, MEMBER), 1 \ : 0); \ (ITER) = (NEXT)) +#define LIST_FOR_EACH_CHECK(ITER, MEMBER, LIST) \ + for (ASSIGN_CONTAINER(ITER, (LIST)->next, MEMBER); \ + &(ITER)->MEMBER != (LIST) && (ITER)->MEMBER.next != (ITER)->MEMBER.prev; \ + ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER)) #endif /* list.h */
_______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev