leverich / mutilate

Mutilate: high-performance memcached load generator
BSD 3-Clause "New" or "Revised" License
126 stars 69 forks source link

Floating point exception in agent mode #4

Open trauzti opened 10 years ago

trauzti commented 10 years ago

I'm trying to run mutilate in agent mode: $ mutilate -A -T 16 But it crashes. Here is the output from GDB.

Program received signal SIGFPE, Arithmetic exception. Value can't be converted to integer. 0x0000000000404a0e in args_to_options (options=options@entry=0x7fffffffdbc0) at mutilate.cc:1061 1061 options->records = args.records_arg / options->server_given;

berserkr commented 9 years ago

==45727== Process terminating with default action of signal 8 (SIGFPE) ==45727== Integer divide by zero at address 0x403C468B2 ==45727== at 0x4049E5: args_to_options(options_t*) (mutilate.cc:1061) ==45727== by 0x409B2F: main (mutilate.cc:468)

Duplicated on CentOS. Weird thing is that in Ubuntu 12.04 it worked fine. Not only that, I am unable to connect to agents under CentOS...

drouyang commented 9 years ago

I saw the same problem on CentOS 7. $./mutilate -T 12 -A Floating point exception

It was because libzmp is not currently installed, especially the zeromp c++ binding (zmp.hpp). If I check the config.h created by scons, the HAVE_LIBZMQ is not defined, meaning libzmp is not found. This would cause the "divide by zero" problem when run as an agent.

Fix:

  1. download lastest zeromq from http://zeromq.org/area:download, and build from source by $./configure $make $sudo make install
  2. checkout zeromq c++ binding, which is now a separated project hosted at https://github.com/zeromq/cppzmq $cp zmp.hpp /usr/local/include
  3. rebuild project $scons -c $scons

Make sure you have HAVE_LIBZMQ defined in your config.h. Otherwise, your libzmp is still not installed correctly.