Skip to content
Snippets Groups Projects
Commit ece2347d authored by Moe Jette's avatar Moe Jette
Browse files

Fix bug in srun when using --no-shell option if not running under debugger

 (was causing segmentation fault).
Verify that a connection remains before trying to send a return code.
parent b1a3ac44
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ documents those changes that are of interest to users and admins. ...@@ -8,6 +8,8 @@ documents those changes that are of interest to users and admins.
-- Create new allocation as needed for debugger in case old allocation -- Create new allocation as needed for debugger in case old allocation
has been purged has been purged
-- Add Blue Gene User Guide to html documents -- Add Blue Gene User Guide to html documents
-- Fix srun bug that could cause seg fault with --no-shell option if not
running under a debugger
* Changes in SLURM 0.4.0-pre2 * Changes in SLURM 0.4.0-pre2
============================= =============================
......
...@@ -115,13 +115,13 @@ DESTDIR="$RPM_BUILD_ROOT" make install ...@@ -115,13 +115,13 @@ DESTDIR="$RPM_BUILD_ROOT" make install
install -D -m755 etc/init.d.slurm $RPM_BUILD_ROOT/etc/rc.d/init.d/slurm install -D -m755 etc/init.d.slurm $RPM_BUILD_ROOT/etc/rc.d/init.d/slurm
install -D -m644 etc/slurm.conf.example $RPM_BUILD_ROOT/etc/slurm/slurm.conf install -D -m644 etc/slurm.conf.example $RPM_BUILD_ROOT/etc/slurm/slurm.conf
# Delete unpackaged files: # Delete unpackaged files:
rm -f $RPM_BUILD_ROOT/usr/lib/slurm/*.{a,la} rm -f $RPM_BUILD_ROOT/%{_libdir}/slurm/*.{a,la}
# Build file lists for optional plugin packages # Build file lists for optional plugin packages
for plugin in auth_munge auth_authd switch_elan; do for plugin in auth_munge auth_authd switch_elan; do
LIST=./${plugin}.files LIST=./${plugin}.files
touch $LIST touch $LIST
test -f $RPM_BUILD_ROOT/usr/lib/slurm/${plugin}.so && test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/${plugin}.so &&
echo %{_libdir}/slurm/${plugin}.so > $LIST echo %{_libdir}/slurm/${plugin}.so > $LIST
done done
......
...@@ -930,6 +930,9 @@ int slurm_send_rc_msg(slurm_msg_t *msg, int rc) ...@@ -930,6 +930,9 @@ int slurm_send_rc_msg(slurm_msg_t *msg, int rc)
slurm_msg_t resp_msg; slurm_msg_t resp_msg;
return_code_msg_t rc_msg; return_code_msg_t rc_msg;
if (msg->conn_fd < 0)
return (ENOTCONN);
rc_msg.return_code = rc; rc_msg.return_code = rc;
resp_msg.address = msg->address; resp_msg.address = msg->address;
......
...@@ -222,8 +222,12 @@ static void _join_attached_threads (int nthreads, thd_t *th) ...@@ -222,8 +222,12 @@ static void _join_attached_threads (int nthreads, thd_t *th)
{ {
int i; int i;
void *retval; void *retval;
for (i = 0; i < nthreads; i++) if (!opt.parallel_debug)
pthread_join (th[i].thread, &retval); return;
for (i = 0; i < nthreads; i++) {
if (th[i].thread != (pthread_t) NULL)
pthread_join (th[i].thread, &retval);
}
return; return;
} }
...@@ -294,6 +298,7 @@ static void _p_launch(slurm_msg_t *req, job_t *job) ...@@ -294,6 +298,7 @@ static void _p_launch(slurm_msg_t *req, job_t *job)
if (job->ntask[i] == 0) { /* No tasks for this node */ if (job->ntask[i] == 0) { /* No tasks for this node */
debug("Node %s is unused",job->host[i]); debug("Node %s is unused",job->host[i]);
job->host_state[i] = SRUN_HOST_REPLIED; job->host_state[i] = SRUN_HOST_REPLIED;
thd[i].thread = (pthread_t) NULL;
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment