When upcall/show is used to collect upcall statistics from a grafana
collector or some agent, upcall/show can be called even during ovs
restart. Occassionally ovs will crash when the revalidator thread
is not really inited. Backtrace:

warning: Unexpected size of section '.reg-xstate/3731535' in core file.
2885 ofproto/ofproto-dpif-upcall.c: No such file or directory.
[Current thread is 1 (Thread 0x7f60b32d8440 (LWP 3731535))]
(gdb) bt
- 0 upcall_unixctl_show (conn=0x55fb517f0770, argc=<optimized out>, 
argv=<optimized out>, aux=<optimized out>) at ofproto/ofproto-dpif-upcall.c:2885
- 1 0x000055fb4e5468fa in process_command (request=<optimized out>, 
conn=0x55fb517f0770) at lib/unixctl.c:308
- 2 run_connection (conn=0x55fb517f0770) at lib/unixctl.c:342
- 3 unixctl_server_run (server=0x55fb4fef9300) at lib/unixctl.c:393
- 4 0x000055fb4df73c0f in main (argc=<optimized out>, argv=<optimized out>) at 
v$witchd/ovs-v$witchd.c:140

Signed-off-by: Wan Junjie <[email protected]>
---
 ofproto/ofproto-dpif-upcall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 1c9c720f0..57f94df54 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -2971,11 +2971,11 @@ upcall_unixctl_show(struct unixctl_conn *conn, int argc 
OVS_UNUSED,
         }
         ds_put_char(&ds, '\n');
 
-        for (i = 0; i < n_revalidators; i++) {
+        for (i = 0; i < udpif->n_revalidators; i++) {
             struct revalidator *revalidator = &udpif->revalidators[i];
             int j, elements = 0;
 
-            for (j = i; j < N_UMAPS; j += n_revalidators) {
+            for (j = i; j < N_UMAPS; j += udpif->n_revalidators) {
                 elements += cmap_count(&udpif->ukeys[j].cmap);
             }
             ds_put_format(&ds, "  %u: (keys %d)\n", revalidator->id, elements);
-- 
2.33.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to