Bug 418781

Summary: yast2-gtk: package selector truncate segfault
Product: [openSUSE] openSUSE 11.0 Reporter: Joe Harmon <jharmon>
Component: YaST2Assignee: Forgotten User h13THG8RK1 <forgotten_h13THG8RK1>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Critical    
Priority: P5 - None CC: forgotten_h13THG8RK1, michael.meeks
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: All   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: screenshot of segfault
yast files
backtrace
repos
second backtrace
third backtrace
YGPackageSelector.cc

Description Joe Harmon 2008-08-20 15:53:52 UTC
We have an add on product (Novell Client for Linux) that we are working on. This same product installs fine when we build it for SLE 10 (gtk, qt). However the new changes to the gtk interface on openSUSE 11.0 are causing a segfault when running the product through the add on product section. If I run this through ncurses or the qt interface I don't receive the segfault.

Steps to reproduce
(1) Launch Yast2 and select the Add on Product option.
(2) Choose the iso option and point it to the iso in question.
(3) Yast adds the installation source and I receive the license agreement.
(4) After accepting the license agreement I receive the software management screen.
(5) After accepting the license agreement I get the Software Management screen.
(6) I wanted to verify that the software was preselected to be installed. I find that it isn't preselected (separate bug) so I go in to select a package and as soon as I select it I receive a segfault.
Comment 1 Joe Harmon 2008-08-20 15:54:44 UTC
Assignment to Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> was per Jiri.
Comment 2 Joe Harmon 2008-08-20 15:57:02 UTC
Created attachment 234501 [details]
screenshot of segfault
Comment 3 Joe Harmon 2008-08-20 16:42:56 UTC
Created attachment 234515 [details]
yast files
Comment 4 Forgotten User h13THG8RK1 2008-08-23 10:28:31 UTC
Hi Joe. Would be great if you could run yast2 through gdb so we could get a nice backtrace. Please, run:
  gdb --args /usr/lib/YaST2/bin/y2base sw_single gtk
  run
  (you may have to press Return a couple of times)
  (try select packages to trigger the crash)
  backtrace

Also, clarify whether the system is 32-bit or 64-bit, and attach a tarball of /etc/zypp/repos.d/ if you could.
Comment 5 Joe Harmon 2008-08-25 13:08:59 UTC
I am getting a lot of (no debugging symbols found).... what -devel packages do I need to have installed?
Comment 6 Forgotten User h13THG8RK1 2008-08-26 01:29:09 UTC
Joe, just hit Return a couple of times there, while you see stuff like:

  (no debugging symbols found)
  (no debugging symbols found)
  (no debugging symbols found)
  (no debugging symbols found)
  ---Type <return> to continue, or q <return> to quit---

yast2-gtk is already compiled with the debug symbols; I guess that stuff is from the rest of yast, libraries or something. It doesn't interest us.

Anyway, it would be great if you could just fill the Hardware (x86 or x86-64?) in the Product Information box...
Comment 7 Joe Harmon 2008-08-26 14:01:13 UTC
"gdb --args /usr/lib/YaST2/bin/y2base sw_single gtk" doesn't show the problem, only the add on product shows the issue. So I ran the following instead: "gdb --args /usr/lib/YaST2/bin/y2base add-on gtk"

here is the output and this is on x86_64:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x40f26950 (LWP 4031)]
0x00007f8a4d7e55f8 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string () from /usr/lib64/libstdc++.so.6



Comment 8 Forgotten User h13THG8RK1 2008-08-28 00:28:17 UTC
Dude, I want that backtrace! =) Check there my comment 4 again:
    1. gdb
    1.1. run
->  1.2. backtrace

By the way, odd that you can only trigger it from the add-on tool. I guess it either adds more repos, or you need to click more packages there in sw_single (or use the filter) to get to the repository string triggering the crash...
Comment 9 Joe Harmon 2008-08-28 02:15:28 UTC
(In reply to comment #8 from Ricardo Cruz)
> Dude, I want that backtrace! =) Check there my comment 4 again:
>     1. gdb
>     1.1. run
> ->  1.2. backtrace

lol... sorry man. I guess it has been a while since I did a backtrace... I thought it looked a little short.

> By the way, odd that you can only trigger it from the add-on tool. I guess it
> either adds more repos, or you need to click more packages there in sw_single
> (or use the filter) to get to the repository string triggering the crash...

Yeah, I found it strange as well.
Comment 10 Joe Harmon 2008-08-28 02:16:08 UTC
Created attachment 235862 [details]
backtrace
Comment 11 Forgotten User h13THG8RK1 2008-08-29 19:07:40 UTC
Well, it doesn't seem like -g is enabled there afterall... No line numbers or arguments. :( Since SVN truncate function is also different, in order to properly cope with utf-8 characters, it would be great if you could try it out:
  1. Make sure you have installed:
    g++, gtk2-devel, yast2-devtools, yast2-core-devel, libzypp-devel
    (possibly configure may report more...)

  2. Download it:
    svn checkout http://svn.opensuse.org/svn/yast/trunk/gtk/ yast-gtk

  3. Compile it:
    cd yast-gtk
    make -f Makefile.cvs
    make && sudo make install

Alternatively, send me a tarball of /etc/zypp/repos.d/ as I asked previously, to see what repository names we are passing the function... I could find them among the yast logs, but that would be very tedious. ;)
Comment 12 Joe Harmon 2008-08-29 20:02:08 UTC
Created attachment 236386 [details]
repos

Must have missed that one as well, sorry. Just a not on the repos. The one I am adding during the add on product is called ncl and I am adding it via the iso option. Just wanted to note that since it is not in this list. I assume that it is not in this list because it fails during the selecting of the package.
Comment 13 Joe Harmon 2008-08-29 20:05:15 UTC
(In reply to comment #11 from Ricardo Cruz)

>   1. Make sure you have installed:
>     g++, gtk2-devel, yast2-devtools, yast2-core-devel, libzypp-devel
>     (possibly configure may report more...)

I see and am installing everything except g++. I don't see that package anywhere.
Comment 14 Forgotten User h13THG8RK1 2008-08-29 21:03:30 UTC
Ups. It seems the g++ package is called "gcc-c++". Anyway, that likely has already been installed by the -devel packages... What you may also want to make sure is installed is "yast2-libyui-devel" and "yast2-ycp-ui-bindings-devel". Thanks for the trouble!
Comment 15 Joe Harmon 2008-08-29 21:05:03 UTC
Created attachment 236398 [details]
second backtrace

I was able to get the g++ and other dependencies figured out. I assume that you wanted me to run though the procedure again after doing all that and get another backtrace. Here it is.
Comment 16 Forgotten User h13THG8RK1 2008-08-29 21:10:19 UTC
Great! I will be checking that out tomorrow...
Comment 17 Forgotten User h13THG8RK1 2008-08-30 01:09:52 UTC
Okay, caught the bugger. It seems that zypp doesn't have the repository you added in add-on in their repository API -- maybe those are just the stored ones, or maybe the repo gets added after the Package Selector UI is constructed. Anyway, we obviously weren't sanitizing things well. If you follow again the steps from comment 11, from the 2nd one, it should be fixed.

What would be great now, to end this matter, is if you could just try a couple of things there, to see at what point is the seed of the mess planted.

1) try out the add-on tool with the Qt interface (/usr/lib/YaST2/bin/y2base add-on qt): select some package that crashed the GTK UI, and check the Versions tab for that package. Does it show the repository you added in that "1.0.0 from repo-X" list?)

2) is the repository you added listed in the GTK UI Repositories list? (if you select the "Groups" menu button, there is a "Repositories" entry there that will list the known repositories...) And if you select the new repository, does it filter the packages correctly?
Comment 18 Joe Harmon 2008-09-03 18:51:06 UTC
Nope still failed. Adding new backtrace.
Comment 19 Joe Harmon 2008-09-03 18:51:57 UTC
Created attachment 237264 [details]
third backtrace
Comment 20 Forgotten User h13THG8RK1 2008-09-04 14:24:07 UTC
Sure you're using the SVN version? In the backtrace the YGPackageSelector.cc line should be 1722, not 1721.

If you look at src/YGPackageSelector.cc, you should have:
1720  string repo;
1721  if (version->repo)
1722    repo = YGUtils::truncate (version->repo->name,
1723      MAX (20, version->number.length() + version->arch.length() + 4), 0);

I can't "emulate" the bug now...
Comment 21 Joe Harmon 2008-09-04 19:06:34 UTC
Created attachment 237650 [details]
YGPackageSelector.cc

I followed the instructions outlined in comment #11 as you suggested and it failed again. I have also attached the YGPackageSelector.cc and yes it does look to be correct
Comment 22 Forgotten User h13THG8RK1 2008-09-08 14:14:56 UTC
Joe, I've googled for some repository to feed the addon tool with, so I can test your problem, but only howtos to create such repos seem to come up. Could you point me to the one you're using or any one at all. Otherwise, it seems there is a nice yast tool I can use to create one, and I'll try that one.

It's best I replicate the crash here, so to not bother you anymore ;) and do some side testing.
Comment 23 Joe Harmon 2008-09-08 19:46:56 UTC
I can't give you this particular client yet because it is proprietary code that we have not yet approved for release, but you can use a 10.3 version that has been approved for release. You won't be able to install the packages but it fails before that point and it will allow you to reproduce the issue.

Please do the following:
(1) Go to www.novell.com/beta and under the Public beta section click on Novell Client for Linux 2.0 SP1 and download the ISO with the appropriate architecture.

(2) Go into yast2, add on product and add the ISO as an add on product using the ISO option.

(3) You will then get to the software screen. Now typically the software is automatically selected as part of the add on product. For some reason it is not happening by default in openSUSE 11.0 and I already have a bug in for that. So you will need to change the filter to patterns.

(4) In the patterns section click on Novell Client on the left hand side and then select the novell-client package. That is were it will fail.

Let me know if you run into any issues with this.
Comment 24 Forgotten User h13THG8RK1 2008-09-09 05:11:00 UTC
Okay, so the earlier fix takes care of the crash here (maybe the previous installed gtk plugin is still being used there...). Anyway, the underlying issue -- that is, the add-on repository not being detected by the GTK UI -- is fixed now that I switched to some other Zypp API to query repositories, as used by the Qt UI, that seems like the proper one. That one has to fix things for you.

Many thanks for bothering to follow this through. If possible, please do check if things work for you.

By the way, every time I pressed Cancel, it seems the add-on tool wasn't cleaning up the repository, so I ended up with a plethora of those. Opened bug 424655.
Comment 25 Joe Harmon 2008-09-12 21:48:42 UTC
Thanks... I tried following comment #11 again to test the fix and I am getting the following error on the make and make install command

YGDialog.cc:8:24: error: YDialogSpy.h: No such file or directory
YGDialog.cc: In static member function ‘static gboolean YGWindow::key_pressed_cb(GtkWidget*, GdkEventKey*, YGWindow*)’:
YGDialog.cc:245: error: ‘YDialogSpy’ has not been declared
make[2]: *** [YGDialog.lo] Error 1
make[2]: Leaving directory `/home/jharmon/Desktop/yast-gtk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jharmon/Desktop/yast-gtk'
make: *** [all] Error 2

It looks like it is looking for YDialogSpy.h file but that doesn't seem to come with openSUSE 11.0.

Thoughts?
Comment 26 Forgotten User h13THG8RK1 2008-09-15 13:41:17 UTC
The same branch is used for 11.0 and current development. Forgot to check for yast version when adding support for this new feature. Please try SVN again.
Comment 27 Joe Harmon 2008-09-15 15:05:51 UTC
Now I am getting the following:

 YGPushButton.lo YGPushButton.cc
 g++ -DHAVE_CONFIG_H -I. -I.. -I./include -I/usr/include/YaST2 -I/usr/include/YaST2/yui -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -DY2LOG=\"ui-gtk\" -DTHEMEDIR=\"/usr/share/YaST2/theme/current\" -DLOCALEDIR=\"/usr/share/YaST2/locale\" -g -O2 -Wall -Wformat=2 -MT YGPushButton.lo -MD -MP -MF .deps/YGPushButton.Tpo -c YGPushButton.cc  -fPIC -DPIC -o .libs/YGPushButton.o
YGPushButton.cc:60: error: ‘YButtonRole’ has not been declared
YGPushButton.cc: In member function ‘void YGPushButton::setStockIcon(const std::string&)’:
YGPushButton.cc:33: error: ‘role’ was not declared in this scope
YGPushButton.cc:34: error: ‘YOKButton’ was not declared in this scope
YGPushButton.cc:37: error: ‘YApplyButton’ was not declared in this scope
YGPushButton.cc:40: error: ‘YCancelButton’ was not declared in this scope
YGPushButton.cc: In member function ‘virtual void YGPushButton::setRole(int)’:
YGPushButton.cc:62: error: ‘setRole’ is not a member of ‘YPushButton’
YGPushButton.cc:63: error: ‘YCustomButton’ was not declared in this scope
make[2]: *** [YGPushButton.lo] Error 1
make[2]: Leaving directory `/home/jharmon/Desktop/yast-gtk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jharmon/Desktop/yast-gtk'
make: *** [all] Error 2
Comment 28 Forgotten User h13THG8RK1 2008-09-15 15:30:11 UTC
Okay, so there's that too. :/ Hopefully, any new functionality is detected properly now...
Comment 29 Joe Harmon 2008-09-15 15:46:53 UTC
Yep, seems to be working now. Thanks for all of your hard work on this. Any idea when this will go out as an update?
Comment 30 Forgotten User h13THG8RK1 2008-09-15 16:00:36 UTC
Can we get a yast2-gtk update package for this crash on the add-on tool?
Comment 31 JP Rosevear 2008-09-15 18:40:23 UTC
Its already packaged afaict, unless there are fixes past when the changelog in svn says this bug is fixed.
Comment 32 Forgotten User h13THG8RK1 2008-09-16 00:11:42 UTC
I meant a 11.0 patch... Clearly Joe thinks it's important, putting up with my queries all this time. ;)