0

ブースト スレッドを使用しています。デストラクタ内で notify_all() を呼び出すと、セグメンテーション エラーが発生します。スタックは次のとおりです。

(gdb) where
#0  0x00007ffff752de84 in pthread_mutex_lock ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#1  0x00007fffe85ab22e in        boost::pthread::pthread_mutex_scoped_lock::pthread_mutex_scoped_lock (this=0x7fffffffdba0, m_=0x0)
    at /usr/include/boost/thread/pthread/pthread_mutex_scoped_lock.hpp:26
#2  0x00007fffe85abb5d in boost::condition_variable::notify_one (this=0x0)
    at /usr/include/boost/thread/pthread/condition_variable.hpp:88
#3  0x00007fffe8690864 in CampaignFrequency::stopFlushThread (this=0x6ad590)
    at /home/git/gitRTB/infinityplus/src/common/shm/CampaignFrequency.cpp:197
#4  0x00007fffe868ffd7 in CampaignFrequency::~CampaignFrequency (
    this=0x6ad590, __in_chrg=<optimised out>)
    at /home/git/gitRTB/infinityplus/src/common/shm/CampaignFrequency.cpp:81
#5  0x00007fffe85bdc37 in rtb_child_init (s=0x7ffff7fc3238)
    at /home/git/gitRTB/infinityplus/src/bidder/mod_rtb.cpp:265
#6  0x000000000044784c in ap_run_child_init ()
#7  0x000000000042817c in ?? ()
#8  0x0000000000463594 in ?? ()
#9  0x00000000004635f4 in ?? ()
#10 0x00000000004643fd in ?? ()
#11 0x000000000042f026 in ap_run_mpm ()
#12 0x0000000000428d74 in main ()
4

1 に答える 1

2

実際にコードを見なければ、これはほとんど推測です。

デバッグから:

#2  0x00007fffe85abb5d in boost::condition_variable::notify_one (this=0x0)
    at /usr/include/boost/thread/pthread/condition_variable.hpp:88

this (条件変数内) はnullptr. cv->notify_all()cv がどこにあるかnullptr(aka )を呼び出しているようです0。使用する前に条件変数を削除している可能性はありますか?

于 2013-04-23T13:54:02.403 に答える