Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 615633 - condor_chirp get_job_attr can return garbage
condor_chirp get_job_attr can return garbage
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: condor (Show other bugs)
1.2
All Linux
medium Severity medium
: 1.3
: ---
Assigned To: Matthew Farrellee
Lubos Trilety
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-17 11:48 EDT by Matthew Farrellee
Modified: 2010-10-14 12:14 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-14 12:14:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2010:0773 normal SHIPPED_LIVE Moderate: Red Hat Enterprise MRG Messaging and Grid Version 1.3 2010-10-14 11:56:44 EDT

  None (edit)
Description Matthew Farrellee 2010-07-17 11:48:48 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
Comment 1 Matthew Farrellee 2010-07-17 12:13:05 EDT
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;
 }
Comment 2 Matthew Farrellee 2010-07-17 12:17:09 EDT
https://condor-wiki.cs.wisc.edu/index.cgi/tktview?tn=1513

Built post 7.4.4-0.4
Comment 3 Lubos Trilety 2010-08-06 08:18:50 EDT
Tested with (version):
condor-7.4.4-0.8

Tested on:
RHEL5 x86_64,i386  - passed
RHEL4 x86_64,i386  - passed

>>> VERIFIED
Comment 5 errata-xmlrpc 2010-10-14 12:14:02 EDT
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

Note You need to log in before you can comment on or make changes to this bug.