YItem references in swig perl binding are not univocally retrieved, and that have some bad side effects: 1) to be sure an item is selected only label or index are available, first is not univocal since it is often translated and different worlds can have identical translation in different context and meaning. Latter is univocal only for widget instance (YTree, Ytable, YMenu, etc.) but there is no reference to the widget items belong to, so an index is not univocal for the whole application. 2) finding an item is not easy as well, think to iterators item-collection->begin() and end() they provide a different reference value every time so end() comparison condition will always fail and the cycle will never stop, well it will really since the at iterator end, the got item access will crash the application. See the attached URL to get info and file to test the problem. Reproducible: Steps to Reproduce:
I have uploaded a patched package for Mageia 5. You can test this by using the scripts linked in the attached URL. I tested it on x86_64. Suggested advisory: ======================== Updated libyui-bindings packages fix the comparison of YItem objects, to compare YItem objects now you can use references, while before the only way was to use labels or index, e.g. not an uinivocal way. References: https://github.com/libyui/libyui-bindings/issues/15 ======================== Updated packages in core/updates_testing: ======================== python3-yui-1.0.4-0.git20140418.10.1.mga5.x86_64.rpm ruby-yui-1.0.4-0.git20140418.10.1.mga5.x86_64.rpm perl-yui-1.0.4-0.git20140418.10.1.mga5.x86_64.rpm python-yui-1.0.4-0.git20140418.10.1.mga5.x86_64.rpm Source RPMs: libyui-bindings-1.0.4-0.git20140418.10.1.mga5.src.rpm
Status: NEW => ASSIGNED
CC: (none) => anaselliAssignee: anaselli => qa-bugs
Trying this on mga5 x86_64. Installed python3-yui-1.0.4-0 ruby-yui-1.0.4-0 perl-yui-1.0.4-0 python-yui-1.0.4-0 pre-update. Downloaded the test_items.pl and test_items_and_collections.pl scripts from the link referenced in comment 1. Installed python3-yui-1.0.4-0.git20140418.10.1 ruby-yui-1.0.4-0.git20140418.10.1 perl-yui-1.0.4-0.git20140418.10.1 python-yui-1.0.4-0.git20140418.10.1 from Updates Testing. Ran $ perl test_items.pl to run the gui against the items and collections. Gui launched fine and responded to selections. Shall attach screenshots to show the results. I shall have to do some research now to figure out how to test ruby and python so this could take a while.
CC: (none) => tarazed25
I'll try to provide scripts for those language also... give me some more time...
Created attachment 6983 [details] Perl test of selection from menu.
Created attachment 6984 [details] Perl test of menu example
I should be able to transcribe the perl script to ruby-tk given a day or two.
Forgot to mention that lib64yui-{curses,qt,gtk} needed to be installed before the interface came up. Have just now tried a POC by installing the pre-update versions of the RPMs on another machine and could detect no difference in behaviour, which means I have probably misinterpreted the values. This was the terminal log for the pre-update session. $ perl test_items.pl <_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-qt.so.6 <_M_> [ui] YSettings.cc:73 progDir(): progDir: "" <_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: <_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: <_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-qt.so.6 <_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui <_M_> [ui] YPath.cc:118 YPath(): Found libyui-qt.so.6 in /usr/lib64/yui <_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-gtk.so.6 <_M_> [ui] YSettings.cc:73 progDir(): progDir: "" <_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: <_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: <_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-gtk.so.6 <_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui <_M_> [ui] YPath.cc:118 YPath(): Found libyui-gtk.so.6 in /usr/lib64/yui <_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-qt.so.6 <_M_> [ui] YSettings.cc:73 progDir(): progDir: "" <_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: <_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: <_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-qt.so.6 <_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui <_M_> [ui] YPath.cc:118 YPath(): Found libyui-qt.so.6 in /usr/lib64/yui <_M_> [ui] YUI.cc:76 YUI(): This is libyui 3.1.4 <_M_> [ui] YUI.cc:77 YUI(): Creating UI without threads <_M_> [qt-ui] YQUI.cc:100 YQUI(): This is libyui-qt 2.46.13 <_M_> [ui] YUI.cc:230 topmostConstructorHasFinished(): Running without threads <_M_> [qt-styler] QY2Styler.cc:97 loadStyleSheet(): Couldn't open style sheet "/usr/share/libyui/theme/current/wizard/style.qss" <_M_> [qt-ui] YQUI.cc:298 processCommandLineArgs(): Qt argument: perl <_M_> [qt-ui] YQUI.cc:298 processCommandLineArgs(): Qt argument: test_items.pl <_M_> [qt-ui] YQUI.cc:441 calcDefaultSize(): Default size: 1792 x 985 <ERR> [qt-ui] YQUI.cc:264 initUI(): Forcing /libQtGui.so.5 open failed <_M_> [qt-ui] YQApplication.cc:133 loadPredefinedQtTranslations(): Selected language: en_GB <WRN> [qt-ui] YQApplication.cc:137 loadPredefinedQtTranslations(): Qt locale directory not set - no translations for predefined Qt dialogs <_M_> [qt-ui] YQUI.cc:275 initUI(): YQUI initialized. Thread ID: 0x0x7f320cdf1700 libGL error: No matching fbConfigs or visuals found libGL error: failed to load driver: swrast <_M_> [ui] YUILoader.cc:104 deleteUI(): Shutting down UI
I added three simple test cases into https://github.com/libyui/libyui-bindings/issues/15 If you run it before installing the update they should print on console item comparison does not work after item comparison works and you chose [chosen item label] The test cannot be run with libyui-ncurses because output is not shown on console, qt and gtk are ok instead. (you probably found a dep issue on package if you had to install them by hands, but it's not easy to fix because ncurses is the minimum, but i cannot decide which other UIs has to be required)
Thanks Angelo. The pre-update tests with those scripts work precisely as you said.
l@vega ~/test]$ ruby test_yitems.rb <_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-qt.so.6 <_M_> [ui] YSettings.cc:73 progDir(): progDir: "" <_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: <_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: <_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-qt.so.6 <_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui <_M_> [ui] YPath.cc:118 YPath(): Found libyui-qt.so.6 in /usr/lib64/yui <_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-gtk.so.6 <_M_> [ui] YSettings.cc:73 progDir(): progDir: "" <_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: <_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: <_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-gtk.so.6 <_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui <_M_> [ui] YPath.cc:118 YPath(): Found libyui-gtk.so.6 in /usr/lib64/yui <_M_> [ui] YPath.cc:49 YPath(): Given filename: libyui-qt.so.6 <_M_> [ui] YSettings.cc:73 progDir(): progDir: "" <_M_> [ui] YPath.cc:65 YPath(): Preferring subdir: <_M_> [ui] YPath.cc:66 YPath(): Subdir given with filename: <_M_> [ui] YPath.cc:67 YPath(): Looking for: libyui-qt.so.6 <_M_> [ui] YPath.cc:138 lsDir(): Looking in /usr/lib64/yui <_M_> [ui] YPath.cc:118 YPath(): Found libyui-qt.so.6 in /usr/lib64/yui <_M_> [ui] YUI.cc:76 YUI(): This is libyui 3.1.4 <_M_> [ui] YUI.cc:77 YUI(): Creating UI without threads <_M_> [qt-ui] YQUI.cc:100 YQUI(): This is libyui-qt 2.46.13 <_M_> [ui] YUI.cc:230 topmostConstructorHasFinished(): Running without threads Xlib: extension "RANDR" missing on display ":0". <_M_> [qt-styler] QY2Styler.cc:97 loadStyleSheet(): Couldn't open style sheet "/usr/share/libyui/theme/current/wizard/style.qss" <_M_> [qt-ui] YQUI.cc:298 processCommandLineArgs(): Qt argument: ruby <_M_> [qt-ui] YQUI.cc:298 processCommandLineArgs(): Qt argument: test_yitems.rb <_M_> [qt-ui] YQUI.cc:441 calcDefaultSize(): Default size: 2508 x 1007 <ERR> [qt-ui] YQUI.cc:264 initUI(): Forcing /libQtGui.so.5 open failed <_M_> [qt-ui] YQApplication.cc:133 loadPredefinedQtTranslations(): Selected language: en_GB <WRN> [qt-ui] YQApplication.cc:137 loadPredefinedQtTranslations(): Qt locale directory not set - no translations for predefined Qt dialogs <_M_> [qt-ui] YQUI.cc:275 initUI(): YQUI initialized. Thread ID: 0x0x7fc53d3da700 item comparison works and you chose bar item comparison works and you chose foo <_M_> [ui] YUILoader.cc:104 deleteUI(): Shutting down UI Perl and python produced the same results. So this is good to go. Adding tokens to whiteboard.
Whiteboard: (none) => MGA5-64-OK has_procedure
Created attachment 6985 [details] Comparison test for perl by Angelo Naselli Console reports failure before update and success afterwards.
Created attachment 6986 [details] Comparison test for python binding by Angelo Naselli Console report of failure or success before and after updates.
Created attachment 6987 [details] Comparison test for ruby binding by Angelo Naselli
Well done Len Validating. Advisory uploaded. Please push to 5 updates Thanks
Keywords: (none) => validated_updateWhiteboard: MGA5-64-OK has_procedure => MGA5-64-OK has_procedure advisoryCC: (none) => sysadmin-bugs
An update for this issue has been pushed to Mageia Updates repository. http://advisories.mageia.org/MGAA-2015-0119.html
Status: ASSIGNED => RESOLVEDResolution: (none) => FIXED