Description of problem: The restraint client crashes with a segfault when I try to run a standalone job. [root@centipede keyutils]# restraint --host=1=localhost --job=/root/keyutils/key utils-testsuite.xml No result Using ./keyutils-testsuite.02 for job run Segmentation fault (core dumped) A backtrace from the core file: (gdb) bt #0 0x000000000040a670 in copy_job_as_template ( job=0x11b79820 "/root/keyutils/keyutils-testsuite.xml", app_data=0x11b6ad20) at client.c:1055 #1 0x000000000040b44c in main (argc=1, argv=0x3fff1412588) at client.c:1449 Version-Release number of selected component (if applicable): restraint-0.1.21-3.aa7a.aarch64 How reproducible: always Steps to Reproduce: 1. restraint --host=1=localhost --job=job.xml Actual results: segfault Expected results: job runs Additional info:
please provide the xml used as well. thanks
recipe_nodes in client.c:1055 is a null pointer: Program terminated with signal 11, Segmentation fault. #0 0x000000000040a670 in copy_job_as_template ( job=0x11b79820 "/root/keyutils/keyutils-testsuite.xml", app_data=0x11b6ad20) at client.c:1055 1055 for (guint i = 0; i < recipe_nodes->nodesetval->nodeNr; i++) { Missing separate debuginfos, use: debuginfo-install glibc-2.17-105.el7.aarch64 (gdb) print i $1 = 0 (gdb) print recipe_nodes $2 = (xmlXPathObjectPtr) 0x0 (gdb) print recipe_nodes->nodesetval Cannot access memory at address 0x8 The job xml is simple enough: <job> <recipe> <recipeSet> <task name="/kernel/keyutils/testsuite"> <fetch url="git://example.com/keyutils-tests.git?master#testsuite"/> </task> </recipeSet> </recipe> </job>
(In reply to Jeff Bastian from comment #2) > The job xml is simple enough: > > <job> > <recipe> > <recipeSet> D'oh! That's my mistake: I had recipe and recipeSet inverted... It works fine once I fixed it.
still shouldn't segfault. leave this open and I'll fix it. Thanks Jeff
If it helps, I found my problem with xmllint: $ xmllint --noout \ --relaxng /usr/lib/python2.7/site-packages/bkr/common/schema/beaker-job.rng \ keyutils-testsuite.xml keyutils-testsuite.xml:1: element job: Relax-NG validity error : Expecting an element recipeSet, got nothing keyutils-testsuite.xml:2: element recipe: Relax-NG validity error : Invalid sequence in interleave keyutils-testsuite.xml:2: element recipe: Relax-NG validity error : Element job failed to validate content keyutils-testsuite.xml fails to validate
https://gerrit.beaker-project.org/#/c/4595/
Merged, there is also this change https://gerrit.beaker-project.org/#/c/4607/2 that adds job xml validation to restraint.