Hi!
I was looking into building the OpenNebula frontend from Alpine Linux, first on 86_x64, then on armhf.
Everything went pretty much OK in terms of building/installing.
However, I am dealing with a complex bug in execution.
I get the following segmentation fault:
Thread 6 "collectd" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 19301]
0x00005555555589fa in ListenerThread::monitor_loop (
this=<error reading variable: Cannot access memory at address 0x7ffff7f81338>)
at src/im_mad/collectd/ListenerThread.cc:55
This is basically a tread pool, each tread is run by a ListenerThread object. However, for some reason the “this” pointer becomes corrupt.
The thread spawning code in the ListenerPool seems OK, but something goes wrong between creating the thread and before calling ListenerThread.monitor_loop.
I have been debugging the code, until noticing something something strange. Despite setting the thread pool to 50, I notice that the ListenerThread constructor is getting called only once.
I find the following code as the place where ListenerThreads are instantiated:
ListenerPool(int fd, int sock, size_t num)
:listeners(num, ListenerThread(sock)), out_fd(fd), socket(sock){};
I am starting to wonder if this initialization results of a vector with num pointers to the same instance or num ListenerThread instances in a vector.
Can anyone familiar with the code point me in the right direction?
@ruben , do you know what the problem could be?