I have no idead where to go from here.
I have a line in a program that is generating a segfault.
The line that generates this error is trying to open a connection to mysql on the localhost. This connection has been successfully opened before; in fact, this is the second time through the loop, and the first execution of the loop executed flawlessly.
This exact error occurs every time there is a second iteration of the loop. I double-checked to make sure that the connection is closed before it is reopened. Here is output from gdb:
I don't expect that anyone can solve this problem, but if you would at least throw some ideas out as to what might be causing it, that might help. I am fairly sure that I have closed and opened all mysql structures properly, but if you'd like to look as well, a second pair of eyes wouldn't hurt. I've posted the code at
In that code, all instances of target_mac[] will be empty strings, and ip_is_bound( ip ) will always return 0 (in my test case).
TIA!
I have a line in a program that is generating a segfault.
The line that generates this error is trying to open a connection to mysql on the localhost. This connection has been successfully opened before; in fact, this is the second time through the loop, and the first execution of the loop executed flawlessly.
This exact error occurs every time there is a second iteration of the loop. I double-checked to make sure that the connection is closed before it is reopened. Here is output from gdb:
Code:
2018 if( !mysql_real_connect( &conn_temp, server, mysqlUser, mysqlPass, mysqlDB, 0, NULL, 0 )) {
(gdb)
Program received signal SIGSEGV, Segmentation fault.
0x00d21301 in malloc_consolidate () from /lib/tls/libc.so.6
(gdb) backtrace
#0 0x00d21301 in malloc_consolidate () from /lib/tls/libc.so.6
#1 0x00d20b29 in _int_malloc () from /lib/tls/libc.so.6
#2 0x00d1fecd in malloc () from /lib/tls/libc.so.6
#3 0x00eceb8a in my_malloc () from /usr/lib/libmysqlclient.so.12
#4 0x00ee0055 in my_net_init () from /usr/lib/libmysqlclient.so.12
#5 0x00ecb4db in mysql_real_connect () from /usr/lib/libmysqlclient.so.12
#6 0x0804e8e2 in scan (report=1) at ipman.c:2018
#7 0x08049cc9 in main (argc=2, argv=0xbfffc054) at ipman.c:292
(gdb)
I don't expect that anyone can solve this problem, but if you would at least throw some ideas out as to what might be causing it, that might help. I am fairly sure that I have closed and opened all mysql structures properly, but if you'd like to look as well, a second pair of eyes wouldn't hurt. I've posted the code at
In that code, all instances of target_mac[] will be empty strings, and ip_is_bound( ip ) will always return 0 (in my test case).
TIA!