Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
f9a3c7e4
Commit
f9a3c7e4
authored
11 years ago
by
David Bigagli
Browse files
Options
Downloads
Patches
Plain Diff
Subtract the PMII_COMMANDLEN_SIZE to prevent certain implementation of snprintf() to
segfault.
parent
92d13a44
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NEWS
+2
-0
2 additions, 0 deletions
NEWS
contribs/pmi2/pmi2_api.c
+13
-2
13 additions, 2 deletions
contribs/pmi2/pmi2_api.c
with
15 additions
and
2 deletions
NEWS
+
2
−
0
View file @
f9a3c7e4
...
...
@@ -89,6 +89,8 @@ documents those changes that are of interest to users and admins.
lengths.
-- If OverTimeLimit is defined do not declare failed those jobs that ended
in the OverTimeLimit interval.
-- Subtract the PMII_COMMANDLEN_SIZE in contribs/pmi2/pmi2_api.c to prevent
certain implementation of snprintf() to segfault.
* Changes in Slurm 2.6.1
========================
...
...
This diff is collapsed.
Click to expand it.
contribs/pmi2/pmi2_api.c
+
13
−
2
View file @
f9a3c7e4
...
...
@@ -1492,6 +1492,14 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
PMI2U_ERR_CHKANDJUMP
(
ret
>=
remaining_len
,
pmi2_errno
,
PMI2_ERR_OTHER
,
"**intern %s"
,
"Ran out of room for command"
);
c
+=
ret
;
remaining_len
-=
ret
;
/* Subtract the PMII_COMMANDLEN_SIZE to prevent
* certain implementation of snprintf() to
* segfault when zero out the buffer.
* PMII_COMMANDLEN_SIZE must be added later on
* back again to send out the right protocol
* message size.
*/
remaining_len
-=
PMII_COMMANDLEN_SIZE
;
#ifdef MPICH_IS_THREADED
MPIU_THREAD_CHECK_BEGIN
;
...
...
@@ -1531,8 +1539,11 @@ int PMIi_WriteSimpleCommand( int fd, PMI2_Command *resp, const char cmd[], PMI2_
--
remaining_len
;
}
/* prepend the buffer length stripping off the trailing '\0' */
cmdlen
=
PMII_MAX_COMMAND_LEN
-
remaining_len
;
/* prepend the buffer length stripping off the trailing '\0'
* Add back the PMII_COMMANDLEN_SIZE to get the correct
* protocol size.
*/
cmdlen
=
PMII_MAX_COMMAND_LEN
-
(
remaining_len
+
PMII_COMMANDLEN_SIZE
);
ret
=
snprintf
(
cmdlenbuf
,
sizeof
(
cmdlenbuf
),
"%d"
,
cmdlen
);
PMI2U_ERR_CHKANDJUMP
(
ret
>=
PMII_COMMANDLEN_SIZE
,
pmi2_errno
,
PMI2_ERR_OTHER
,
"**intern %s"
,
"Command length won't fit in length buffer"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment