progschj / ThreadPool

A simple C++11 Thread Pool implementation
zlib License
7.63k stars 2.21k forks source link

Compiles normally on Linux but generates core files when running #98

Open OxesDozen opened 2 years ago

OxesDozen commented 2 years ago

I have tried compiling and running this program on a Windows system and it worked fine. When I try to compile and run on a Linux system, it compiles fine, but the core file appears when I run it.

After analysis, I think the problem is in the emplace_back() function. In the Windows environment, the emplace_back() function refers to the _M_realloc_insert() function; but in the Linux environment, the same location is replaced by the _M_emplace_back_aux() function.

I'm new to programming and don't understand why such a difference would cause the software to fail, and I'm hoping for an answer. If I want to run this program in Linux environment, how can I modify the main function?