Hi,

here you are as requested the stack trace. The code segfaults during deactivation of the GRAM client module, when the credential is released. The code example works as follows: the server receives a delegated credential and uses it to submit a job asynchronously (nonblockng job submission) on behalf of the user. The function globus_gram_client_set_credentials() is called as needed to authenticate the status callback that will receive notifications from the remote jobmanager. When the job is done, the delegated credential is released; finally the GRAM client module is deactivated and this causes the segfault.
Of course the code works fine if

1) I do not release the credential explicitly and deactivate the GRAM client module 2) I release the credential, but then I do not deactivate the GRAM module.

Of course strategy 1 seems the one to adopt. The function globus_gram_client_set_credentials() is not documented, so in order to fully understand what it does I had to take a look at the source code in the GRAM protocol library to discover that it sets the credential passed as argument for all of the callbacks/listeners associated to the calling thread. Is it correct do say that all of the callbacks/ listeners associated to the calling threads are affected, including future callbacks/listeners that may be started or setting the credential only affects already started callbacks/listeners excluding therefore future ones?

Massimo




gdb submit-gsi-server-threads
GNU gdb 6.3.50-20050815 (Apple version gdb-768) (Tue Oct 2 04:07:49 UTC 2007)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-apple-darwin"...Reading symbols for shared libraries ......................... done

(gdb) r
Starting program: /Users/cafaro/work/plugin/server/submit-gsi-server- threads
Exit 1
setenv: Too many arguments.
Reading symbols for shared libraries ++++++++++++++++++++++++. done
Accepted connection on socket 6 from IP 127.0.0.1
globus_gram_client: debug messages will be printed.
Callback contact: https://starnet.local:49578/
in globus_gram_client_job_contact_free()
JOB https://starnet.local:49581/2248/1197468807/ STATUS ACTIVE
JOB https://starnet.local:49581/2248/1197468807/ STATUS DONE
in globus_gram_client_job_contact_free()
Remote job manager returned the following job id: 
https://starnet.local:49581/2248/1197468807/

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xc028771b
[Switching to process 2184 thread 0x2303]
0x00563f78 in CRYPTO_add_lock (pointer=0xc028771b, amount=-1, type=3, file=0x635910 "tasn_utl.c", line=113) at cryptlib.c:455
455                     ret= *pointer+amount;
(gdb) bt
#0 0x00563f78 in CRYPTO_add_lock (pointer=0xc028771b, amount=-1, type=3, file=0x635910 "tasn_utl.c", line=113) at cryptlib.c:455 #1 0x005df479 in asn1_do_lock (pval=0xb0184dc0, op=-1, it=0x653b1c) at tasn_utl.c:113 #2 0x005ddb75 in asn1_item_combine_free (pval=0xb0184dc0, it=0x653b1c, combine=0) at tasn_fre.c:134 #3 0x005dd8dc in ASN1_item_free (val=0xc028770b, it=0x653b1c) at tasn_fre.c:71
#4  0x005e2152 in X509_free (a=0xc028770b) at x_x509.c:125
#5 0x00312c42 in globus_gsi_cred_handle_destroy (handle=0xa1f810) at globus_gsi_cred_handle.c:154 #6 0x0022978e in gss_release_cred (minor_status=0xb0184e48, cred_handle_P=0x7b300) at release_cred.c:74 #7 0x000746ec in globus_l_gram_protocol_deactivate () at globus_gram_protocol.c:146 #8 0x003b936a in globus_module_deactivate (module_descriptor=0x7b014) at globus_module.c:311 #9 0x000505d0 in globus_i_gram_client_deactivate () at globus_gram_client.c:293 #10 0x003b936a in globus_module_deactivate (module_descriptor=0x53014) at globus_module.c:311 #11 0x00002e46 in process_request (arg=0x99f000) at submit-gsi-server- threads.c:126 #12 0x003c2db9 in thread_starter (temparg=0x1000430) at globus_thread_pthreads.c:508
#13 0x966cb075 in _pthread_start ()
#14 0x966caf32 in thread_start ()
(gdb)





On Dec 11, 2007, at 9:00 PM, Joseph Bester wrote:

On Dec 10, 2007, at 12:46 PM, Massimo Cafaro wrote:
Dear all,

with reference to my previous email related to GT4.0.5 pre-ws GRAM jobmanager not sending back job state changes, I have tried adding a call to

globus_gram_client_set_credentials()

as required to authenticate the status callback that should receive the state changes. However, the code always segfaults on GT4.0.5. I have checked the globus bugzilla. It seems that this bug (4620) appeared and was fixed in GT4.0.3 by the advisory patch for the GRAM protocol library v6.5

http://www.globus.org/toolkit/advisories.html?version=4.0#globus_gram_protocol-6.5

Any clue about? I know the patch was committed to the 4.0 branch and CVS trunk...
Thank you in advance, and best regards,

Massimo

Can you send a stack trace of the segfault please?

Joe



--

*******************************************************************************************************

Massimo Cafaro, Ph.D. National Nanotechnology Laboratory (NNL/CNR-INFM) Assistant Professor Euro- Mediterranean Centre for Climate Change
 Dept. of Engineering for Innovation        SPACI Consortium
 University of Salento, Lecce, Italy
Via per Monteroni Voice +39 0832 297371 Fax +39 0832 298173
 73100 Lecce, Italy                                     Web     
http://sara.unile.it/~cafaro
 E-mail [EMAIL PROTECTED]             [EMAIL PROTECTED]

*******************************************************************************************************


Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to