Bug 739069

Summary: zypper segfaults with some proxy values
Product: [openSUSE] openSUSE 12.1 Reporter: Stratos Zolotas <strzol>
Component: libzyppAssignee: Dominique Leuenberger <dimstar>
Status: VERIFIED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Critical    
Priority: P3 - Medium CC: andihartmann, arif, brassh, Matthias.Merk, nick, s91066, silviu_marin-caea, xrigou
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Stratos Zolotas 2011-12-31 12:53:03 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20100101 Firefox/9.0

I'm getting a segfault from zypper when a non proxy value in /etc/sysconfig/proxy is entered as CIDR (10.0.0.0/8).

If the offending value is removed zypper works.

The error is:

zypper[3242]: segfault at 0 ip 00007f90dd484a6b sp 00007fff1ede5170 error 4 in libproxy.so.1.0.0[7f90dd469000+20000]

I can provide more info if you point me to the right way.


Reproducible: Always

Steps to Reproduce:
1. Put a CIDR value in no proxy in /etc/sysconfig/proxy
2. run zypper
3.
Comment 1 Peter Tselios 2012-01-05 11:15:23 UTC
Same issue with i386 version.
I removed all CIDR entries from NOPROXY line in /etc/sysconfig/proxy.
Comment 2 Christos Gourdoupis 2012-01-06 20:13:51 UTC
This is most probably related to bug 679322, where I have contributed.
I bet removing all spaces from the NO_PROXY string will make you happy.
Comment 3 H Brass 2012-01-08 21:48:52 UTC
Same issue here with OpenSUSE 12.1 32-bit after update from zypper-1.6.16-5.3.1.i586.rpm to zypper-1.6.18-5.8.1.i586.

Workarounds:
either 
   downgrade to zypper-1.6.16-5.3.1.i586.rpm
or 
   keep zypper-1.6.18-5.8.1.i586 and delete any network ranges (as 10.0.0.0/8) from NO_PROXY in /etc/sysconfig/proxy. Single adresses (as localhost or 127.0.0.1) do not harm here
Comment 4 Nick Fennell 2012-01-10 13:00:17 UTC
(In reply to comment #2)
> This is most probably related to bug 679322, where I have contributed.
> I bet removing all spaces from the NO_PROXY string will make you happy.

Removing spaces fixed it for me on zypper 1.6.18
Comment 5 Arif Nugroho 2012-01-14 11:59:21 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > This is most probably related to bug 679322, where I have contributed.
> > I bet removing all spaces from the NO_PROXY string will make you happy.
> 
> Removing spaces fixed it for me on zypper 1.6.18

Same here. Zypper 1.6.18
Comment 6 Klaus Mueller 2012-01-16 11:58:02 UTC
I can confirm the given workaround.


But there is one more issue: NO_PROXY in /etc/sysconfig/proxy doesn't work at all if this situation is given:

- NO_PROXY="...,192.168.1.0/24,..."
- URL: ftp://fqdn/... (fqdn resolves to an address in the 192.168.1.0/24 range)

-> zypper / libproxy ignores,that for reaching fqdn the NO_PROXY configuration has to be used.
Comment 7 Michael Andres 2012-01-31 15:54:47 UTC
*** Bug 744062 has been marked as a duplicate of this bug. ***
Comment 8 Michael Andres 2012-01-31 18:10:18 UTC
Dominique, would you mind having a look at this?


Seems to be a generic libproxy issue (not limited to the sysconfig module):

  $ export HTTP_PROXY="http://proxy.suse.de:3128"
  $ export NO_PROXY=" 1.2.3.4/5"                  # !!leading WS
  $ _PX_DEBUG=1 proxy http://www.suse.de
  Using config: 23envvar_config_extension
  Using ignore:  1.2.3.4/5
  Segmentation fault


1) stripping whitepace when splitting at the ',' would be nice. I saw several
people running into this issue.


2) After a quick look at libproxy-0.4.7/modules/ignore_ip.cpp 

(- I wonder which form of delete is right: 'delete' or 'delete[]', both cannot
be.)


- With the leading ' ' in ignore

   137: ign_ip = sockaddr_from_string(ignore.substr(0, ignore.find('/')));

  returns NULL and it crashes in 

   151: net_ip = sockaddr_from_cidr(ign_ip->sa_family, cidr);
Comment 9 Dominique Leuenberger 2012-02-01 19:34:25 UTC
This looks like this upstream commit should address this issue:
http://code.google.com/p/libproxy/source/diff?spec=svn821&r=821&format=side&path=/trunk/libproxy/proxy.cpp
Comment 10 Dominique Leuenberger 2012-02-01 19:54:18 UTC
Bug 701059 dealt with the same issue for 11.4, but 12.1 was not identified to be affected.
Comment 11 Dominique Leuenberger 2012-02-01 20:06:26 UTC
Fixed packages should appear shortly in this repo:
http://download.opensuse.org/repositories/home:/dimstar:/bnc739069/

Please verify if those packages resolve the issue reported.
Comment 12 Dominique Leuenberger 2012-02-16 19:09:41 UTC
ping ping?

Anybody tested those packages yet?
Comment 13 Klaus Mueller 2012-02-16 21:43:53 UTC
I can confirm, that the sigseg is fixed here with the packages in the above given repository. I tested libproxy1-0.4.7-7.4.1.x86_64.rpm.

But the problem from https://bugzilla.novell.com/show_bug.cgi?id=739069#c6 is not fixed.
Comment 14 Dominique Leuenberger 2012-02-17 09:22:51 UTC
(In reply to comment #6)
> - NO_PROXY="...,192.168.1.0/24,..."
> - URL: ftp://fqdn/... (fqdn resolves to an address in the 192.168.1.0/24 range)
> 
> -> zypper / libproxy ignores,that for reaching fqdn the NO_PROXY configuration
> has to be used.

This is standard behavior in all implementations of proxy handling I have seen (except when custom pac files are used.. )

The 'issue' is that none of the implementations wants to go on and do a namelookup first before matching, as this would considerably slow down ANY access to websites. (Same is true for FF implementation of proxy access, even _other OS_ have this 'issue'.

Usually you have a NO_PROXY for 192.168.0.0/16 (all private ranges) and .mydomain.com (all sites in .mydomain are reachable without proxy).
Comment 15 Dominique Leuenberger 2012-02-17 09:25:04 UTC
(In reply to comment #13)
> I can confirm, that the sigseg is fixed here with the packages in the above
> given repository. I tested libproxy1-0.4.7-7.4.1.x86_64.rpm.
> 
> But the problem from https://bugzilla.novell.com/show_bug.cgi?id=739069#c6 is
> not fixed.

@Maintenance, I assume we agree on pushing those fixes as maintenance update? We had the same in 11.4 but missed to include the fix in 'Factory' at that time (Current Factory has the fix).
Comment 16 Benjamin Brunner 2012-02-20 12:13:52 UTC
Could you submit the fix to openSUSE:12.1:Update:Test please. We'll add the fix to the next update-stack update.
Comment 17 Bernhard Wiedemann 2012-02-21 20:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (739069) was mentioned in
https://build.opensuse.org/request/show/106363 12.1 / libproxy
Comment 18 Benjamin Brunner 2012-03-05 10:12:17 UTC
Update released for 12.1. Resolved fixed.