Posts Tagged ‘MALLOC_PERTURB_’

MALLOC_PERTURB_: Finding real bugs in condor_chirp

July 17, 2010

If you are not familiar with MALLOC_PERTURB_, you should read the fedora-devel post by Jim Meyering.

After condor_ssh_to_job, which gives you a shell in the environment of your running 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 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 {

From chirp_client_get_job_attr in 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 condor_chirp.cpp:

	char *p = 0;
	chirp_client_get_job_attr(client, argv[2], &p);
	printf("%s\n", p);
Advertisements

%d bloggers like this: