Red Hat Bugzilla – Bug 615633
condor_chirp get_job_attr can return garbage
Last modified: 2010-10-14 12:14:02 EDT
Description of problem: After ssh_to_job... $ /usr/libexec/condor/condor_chirp get_job_attr Owner "matt"uuuuuuuuuuuuuuuuuu $ MALLOC_PERTURB_=97 /usr/libexec/condor/condor_chirp get_job_attr Owner "matt"aaaaaaaaaaaaaaaaaa $ MALLOC_PERTURB_=98 /usr/libexec/condor/condor_chirp get_job_attr Owner "matt"bbbbbbbbbbbbbbbbbb $ MALLOC_PERTURB_=0 /usr/libexec/condor/condor_chirp get_job_attr Owner "matt" From chirp_client.c: *expr = (char*)malloc(result); if(*expr) { actual = fread(*expr,1,result,c->rstream); if(actual!=result) chirp_fatal_request("get_job_attr"); } else { From io_proxy_handler.cpp: result = REMOTE_CONDOR_get_job_attr(name,recv_expr); if(result==0) { sprintf(line,"%u",(unsigned int)strlen(recv_expr)); r->put_line_raw(line); r->put_bytes_raw(recv_expr,strlen(recv_expr)); } else { Oops! No terminating NULL. Version-Release number of selected component (if applicable): 7.4.4-0.4 Additional information: Workaround by setting MALLOC_PERTURB_=0
diff --git a/src/condor_chirp/condor_chirp.cpp b/src/condor_chirp/condor_chirp.cpp index c1e9fbb..20e513f 100644 --- a/src/condor_chirp/condor_chirp.cpp +++ b/src/condor_chirp/condor_chirp.cpp @@ -307,8 +307,8 @@ int chirp_get_job_attr(int argc, char **argv) { } char *p = 0; - chirp_client_get_job_attr(client, argv[2], &p); - printf("%s\n", p); + int len = chirp_client_get_job_attr(client, argv[2], &p); + printf("%.*s\n", len, p); return 0; }
https://condor-wiki.cs.wisc.edu/index.cgi/tktview?tn=1513 Built post 7.4.4-0.4
Tested with (version): condor-7.4.4-0.8 Tested on: RHEL5 x86_64,i386 - passed RHEL4 x86_64,i386 - passed >>> VERIFIED
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2010-0773.html