Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix segfault in printjob_svr.bin #2643

Merged
merged 1 commit into from
May 24, 2024
Merged

Conversation

vchlum
Copy link
Contributor

@vchlum vchlum commented May 15, 2024

Describe Bug or Feature

printjob_svr.bin -s <jobid> ends with segfault:

[root@almalinux pbspro]# printjob_svr.bin -s 1118.almalinux
---------------------------------------------------
Jobscript for jobid:1118.almalinux
---------------------------------------------------
sleep 1000
 
Segmentation fault (core dumped)
[root@almalinux pbspro]# 

The free_attrlist(&dbjob.db_attr_list.attrs) is called even if the dbjob is uninitialized.

Describe Your Change

Call free_attrlist() in print_db_job() only after dbjob initialization.

Link to Design Doc

Attach Test and Valgrind Logs/Output

Manual test of the fix:

[root@almalinux pbspro]# printjob_svr.bin -s 1118.almalinux
---------------------------------------------------
Jobscript for jobid:1118.almalinux
---------------------------------------------------
sleep 1000
 
[root@almalinux pbspro]# 

Copy link
Contributor

@bayucan bayucan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@bayucan bayucan merged commit 5b39e0c into openpbs:master May 24, 2024
6 checks passed
@vchlum vchlum deleted the fix_print_db_job branch May 24, 2024 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants