X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Ftimeval.c;h=d8539892afa57145f6d90d84056f1eb0dc86c010;hb=c2f0373a8248d0c20d2f876d7f3bc61a400d9924;hp=05f1c2d3643030dc16c20bdcacb44cc0f72311ac;hpb=f43e80e023378a2c1ef18d3caee9b76d6d2a6d23;p=openvswitch diff --git a/lib/timeval.c b/lib/timeval.c index 05f1c2d3..d8539892 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -121,6 +121,16 @@ time_init(void) } inited = true; + /* The implementation of backtrace() in glibc does some one time + * initialization which is not signal safe. This can cause deadlocks if + * run from the signal handler. As a workaround, force the initialization + * to happen here. */ + if (HAVE_EXECINFO_H) { + void *bt[1]; + + backtrace(bt, ARRAY_SIZE(bt)); + } + memset(traces, 0, sizeof traces); if (HAVE_EXECINFO_H && CACHE_TIME) {