Forum: Building VoltDB Clients

Post: Which parameters should we set for voter(c++)

Which parameters should we set for voter(c++)
Apr 3, 2015
I compiled Voter.cpp and create executable voter.
What are the correct input parameters for voter executable?
My OS is ubuntu 14.4 and machine has core i-7 CPU with 8 GB ram.
PS: I am asking because i got segmentation fault after i run the executable as shown below:
./voter 6 2 10000 1 250 5 20 1 "localhost"

Allowing 2 votes per phone number
Allowing between 1 and 250 oustanding SP calls at a time
Submitting 10000 SP calls/sec
Feedback interval = 5 second(s)
Running for 20 second(s)
Latency not recorded for 1 second(s)
Connecting to server: 'localhost'
Running for 6 contestant(s)
Segmentation fault (core dumped)

Thanks in advance,
Apr 3, 2015

The parameters look okay to me.

Is the server running on localhost and listening on port 21212? To debug it further, you can also run it in GDB to see where it faults on.
Apr 3, 2015
Hi Ninq,
I got segmentation fault after calling client.runOnce();
I don't think it is a port issue, because, i see 887 rows at votes table..
How can i trace the code in server side? Can problem be the count of waiting async calls?
Below is gdb backtrace;

Program received signal SIGSEGV, Segmentation fault.
__GI___libc_free (mem=0x50) at malloc.c:2929
2929 malloc.c: No such file or directory.
(gdb) backtrace
#0 __GI___libc_free (mem=0x50) at malloc.c:2929
#1 0x00000000004135bf in ~shared_count (this=<optimized out>, __in_chrg=<optimized out>)
at include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:145
#2 ~shared_array (this=<optimized out>, __in_chrg=<optimized out>) at include/boost/smart_ptr/shared_array.hpp:47
#3 ~SharedByteBuffer (this=0x7fffffffd458, __in_chrg=<optimized out>) at include/ByteBuffer.hpp:483
#4 voltdb::Table::~Table (this=0x7fffffffd440, __in_chrg=<optimized out>) at include/Table.h:52
#5 0x0000000000414e07 in voltdb::InvocationResponse::InvocationResponse (this=0x7fffffffd650, data=..., length=50)
at include/InvocationResponse.hpp:94
#6 0x00000000004101ef in voltdb::ClientImpl::regularReadCallback (this=0x646130, bev=0x646970) at src/ClientImpl.cpp:488
#7 0x000000000042bf32 in bufferevent_readcb (fd=8, event=<optimized out>, arg=0x646970) at bufferevent_sock.c:183
#8 0x0000000000423e4d in event_process_active_single_queue (activeq=<optimized out>, base=<optimized out>) at event.c:1340
#9 event_process_active (base=<optimized out>) at event.c:1407
#10 event_base_loop (base=0x646310, flags=2) at event.c:1604
#11 0x000000000040d2fb in voltdb::ClientImpl::runOnce (this=0x646130) at src/ClientImpl.cpp:449
#12 0x000000000040b801 in voltdb::Client::runOnce (this=<optimized out>, this@entry=0x7fffffffda80) at src/Client.cpp:75
#13 0x000000000040519a in main (argc=<optimized out>, argv=<optimized out>) at Voter.cpp:221
Apr 3, 2015

It definitely seems like a C++ client library problem. It shouldn't have anything to do with the server.

The line numbers in the stack trace seem correlated to an older version of the C++ library. We may have fixed the bug already. Do you mind trying out the latest C++ driver? You can download it from the Github repository.