message from sge-8.1.6 client crashes qmaster
Brought to you by:
rayrayson,
ron_chen_123
If a OGS 2011.11p1 qmaster receives a message from an SGE-8.1.6 client, the qmaster crashes with a segmentation fault:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fb7e63ff700 (LWP 22985)]
0x000000000049c601 in do_gdi_packet (ctx=0x7fb7e4421300, monitor=<value optimized out>)
at ../daemons/qmaster/sge_qmaster_process_message.c:196
196 packet->host = sge_strdup(NULL, aMsg->snd_host);
(gdb) bt
#0 0x000000000049c601 in do_gdi_packet (ctx=0x7fb7e4421300, monitor=<value optimized out>)
at ../daemons/qmaster/sge_qmaster_process_message.c:196
#1 sge_qmaster_process_message (ctx=0x7fb7e4421300, monitor=<value optimized out>)
at ../daemons/qmaster/sge_qmaster_process_message.c:159
#2 0x000000000042d8c5 in sge_listener_main (arg=0x7fb7f4ef51f0)
at ../daemons/qmaster/sge_thread_listener.c:168
#3 0x00007fb7f65529d1 in start_thread () from /lib64/libpthread.so.0
#4 0x00007fb7f6089b6d in clone () from /lib64/libc.so.6
(gdb) print aMsg
$1 = (struct_msg_t *) 0x7fb7e63fecc0
(gdb) print *aMsg
$2 = {snd_host = "barry.cora.nwra.com", '\000' <repeats 44 times>,
snd_name = "qstat", '\000' <repeats 58 times>, snd_id = 4, tag = 2, request_mid = 1, buf = {
head_ptr = 0x7fb7ebcd3a00 "", cur_ptr = 0x7fb7ebcd3acb "", mem_size = 2341,
bytes_used = 203, just_count = 0, version = 268566528}}
(gdb) print packet
$3 = (sge_gdi_packet_class_t *) 0x0
(gdb) print local_ret
$1 = false
Trying to read the code, I don't really understand how packet ends up being NULL. But the code clearly does not handle that case.
I will handle this bug.