Bug 846467

Summary: pkgbindings cause segfault when there are missing parameters
Product: [openSUSE] openSUSE 13.1 Reporter: Thomas Göttlicher <tgoettlicher>
Component: YaST2Assignee: Ladislav Slezák <lslezak>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P2 - High CC: tgoettlicher
Version: RC 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: testcase

Description Thomas Göttlicher 2013-10-17 16:09:31 UTC
Created attachment 563928 [details]
testcase 

Running the attached testcase causes a segfault on 13.1 rc1.
Comment 1 Ladislav Slezák 2013-10-21 11:44:22 UTC
I found out that the crash is caused by missing parameters, just add them. In this case they are just dummy parameters left for backward compatibility:

Pkg.PkgSolve() -> Pkg.PkgSolve(false)
Pkg.PkgCommit() -> Pkg.PkgCommit(0)

Then it should work.

I'll investigate how to avoid the hard crash and log something more meaningful instead...

(Lowering severity as it happens only in wrong scripts, in correct scripts it won't happen.)
Comment 2 Thomas Göttlicher 2013-10-21 12:08:25 UTC
Ladislav, thanks for the workaround. It works with dummy arguments for me.
Comment 3 Ladislav Slezák 2013-10-21 12:13:26 UTC
Ok, thanks for the feedback, I'm fixing the crash right now...
Comment 4 Ladislav Slezák 2013-10-21 13:08:35 UTC
Fixed in yast2-pkg-bindings-3.0.4 (https://github.com/yast/yast-pkg-bindings/pull/12)

It should not crash anymore and you should see errors like "Parameter 1 is nil, Integer is required" in y2log when a parameter is missing.
Comment 5 Ladislav Slezák 2013-10-22 08:00:41 UTC
In the end fixed in yast2-core-3.0.3 (see https://github.com/yast/yast-core/pull/64) as a better solution.
Comment 6 Ladislav Slezák 2013-10-22 08:47:49 UTC
(Just a note if somebody would like to test the fix: you need updated pkg-bindings compiled against yast2-core >= 3.0.3)