| Summary: | Removed malloc error logic in several files | ||
|---|---|---|---|
| Product: | Slurm | Reporter: | Nathan Yee <nyee32> |
| Component: | Other | Assignee: | Moe Jette <jette> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | 5 - Enhancement | ||
| Priority: | --- | CC: | da |
| Version: | 2.4.x | ||
| Hardware: | Linux | ||
| OS: | Linux | ||
| Site: | SchedMD | Slinky Site: | --- |
| Alineos Sites: | --- | Atos/Eviden Sites: | --- |
| Confidential Site: | --- | Coreweave sites: | --- |
| Cray Sites: | --- | DS9 clusters: | --- |
| Google sites: | --- | HPCnow Sites: | --- |
| HPE Sites: | --- | IBM Sites: | --- |
| NOAA SIte: | --- | NoveTech Sites: | --- |
| Nvidia HWinf-CS Sites: | --- | OCF Sites: | --- |
| Recursion Pharma Sites: | --- | SFW Sites: | --- |
| SNIC sites: | --- | Tzag Elita Sites: | --- |
| Linux Distro: | --- | Machine Name: | |
| CLE Version: | Version Fixed: | ||
| Target Release: | --- | DevPrio: | --- |
| Emory-Cloud Sites: | --- | ||
| Attachments: | Removed all the malloc error logic in multiple files | ||
I found four problems, all similar. Here's a C lesson for you:
if (!(job_resrcs_ptr->node_bitmap = bit_copy(bitmap)))
fatal("bit_copy malloc failure");
Is equivalent to:
job_resrcs_ptr->node_bitmap = bit_copy(bitmap);
if (!job_resrcs_ptr->node_bitmap)
fatal("bit_copy malloc failure");
It is just compressed to save some space and perhaps make the logic more clear. So rather than remove the 2 lines in the first example complete, it needed to be change to:
job_resrcs_ptr->node_bitmap = bit_copy(bitmap);
|
Created attachment 170 [details] Removed all the malloc error logic in multiple files