Bug 226462 - [Proxy] Use system values for proxy settings on Linux
Summary: [Proxy] Use system values for proxy settings on Linux
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 180921
Blocks:
  Show dependency tree
 
Reported: 2008-04-10 05:08 EDT by Szymon Brandys CLA
Modified: 2008-05-05 07:01 EDT (History)
1 user (show)

See Also:


Attachments
linux.x86 native fragment (36.50 KB, text/plain)
2008-04-21 08:47 EDT, Szymon Brandys CLA
no flags Details
linux.x86 native fragment (36.50 KB, application/zip)
2008-04-21 08:48 EDT, Szymon Brandys CLA
no flags Details
Fix (22.34 KB, patch)
2008-04-21 08:56 EDT, Szymon Brandys CLA
no flags Details | Diff
Initial patch (22.32 KB, patch)
2008-04-22 05:28 EDT, Szymon Brandys CLA
no flags Details | Diff
Revised to use native getenv() and restructure native libs - *not tested* (47.49 KB, patch)
2008-04-23 05:40 EDT, Francis Upton IV CLA
no flags Details | Diff
Binaries of the shared libs (99.02 KB, application/octet-stream)
2008-04-23 05:42 EDT, Francis Upton IV CLA
no flags Details
Revised and tested patch (55.35 KB, patch)
2008-04-24 04:45 EDT, Francis Upton IV CLA
no flags Details | Diff
linux shared libraries for x86 (32 bit) (46.01 KB, application/octet-stream)
2008-04-24 04:49 EDT, Francis Upton IV CLA
no flags Details
Patch revised to remove gnome portion, only uses getenv() (38.75 KB, patch)
2008-04-25 02:26 EDT, Francis Upton IV CLA
no flags Details | Diff
shared library for getenv() support (37.51 KB, application/octet-stream)
2008-04-25 02:28 EDT, Francis Upton IV CLA
no flags Details
Get env not using native code (6.39 KB, patch)
2008-04-25 05:39 EDT, Szymon Brandys CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2008-04-10 05:08:13 EDT
 
Comment 1 Szymon Brandys CLA 2008-04-10 13:02:57 EDT
With the last patches and libs, my Eclipse crashes and I get this on my console:

#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGFPE (0x8) at pc=0x007a350c, pid=11330, tid=3086923456
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_14-b05 mixed mode)
# Problematic frame:
# C  [ld-linux.so.2+0x850c]
#
# An error report file with more information is saved as hs_err_pid11330.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Comment 2 Francis Upton IV CLA 2008-04-10 13:11:33 EDT
This is probably happening because the binary is built incorrectly (I'm guessing).  It was build on a Fedora 8 64 bit system, and I might not have correctly specified the options for a 32-bit .so.

What type of system did this error happen on?
Comment 3 Szymon Brandys CLA 2008-04-10 13:21:07 EDT
It is Red Hat AS 4. I think it is 32 bit OS (?)
Comment 4 Francis Upton IV CLA 2008-04-21 03:17:04 EDT
Szymon, anyway you can attach the entire error report file?  I verified that the binary I built was for a 32 bit system, so that was not the problem.

I will try some things to try to reproduce the problem here.

What do I need to run to get this called in the IDE?  The only testing I have done with it is the junit tests, and it seems to react fine if some of the shared libraries are missing.  Maybe the IDE behaves differently.  
Comment 5 Szymon Brandys CLA 2008-04-21 05:24:08 EDT
Francis,

To test the stuff from IDE, you should get one of the latest Nbuilds. I think that I20080415-1646 is ok, despite the failed tests.

Go to Window > Preferences > General > Network Connection and set the "System proxy configuration..." checkbox.

Go to the CVS repos view and try to perform any operation on one of added repos. If you have any pserver one, it will use SOCKS proxy to connect.
Comment 6 Szymon Brandys CLA 2008-04-21 08:47:46 EDT
Created attachment 96832 [details]
linux.x86 native fragment
Comment 7 Szymon Brandys CLA 2008-04-21 08:48:49 EDT
Created attachment 96833 [details]
linux.x86 native fragment
Comment 8 Szymon Brandys CLA 2008-04-21 08:56:11 EDT
Created attachment 96835 [details]
Fix
Comment 9 Szymon Brandys CLA 2008-04-21 11:38:23 EDT
Francis,

System#getenv was deprecated in 1.4. When you try to call this method on Sun VM you will get an error. I'm not sure now... but I think that we should have native code for getting proxy properties on Linux too.
Comment 10 Szymon Brandys CLA 2008-04-22 05:28:04 EDT
Created attachment 96991 [details]
Initial patch
Comment 11 Tomasz Zarna CLA 2008-04-22 06:09:53 EDT
Native fragment and the initial patch released to HEAD.
Comment 12 Francis Upton IV CLA 2008-04-23 03:41:19 EDT
Syzmon, I noticed you moved UnixProxyProvider into ....net.proxy.unix, yet WindowsProxyProvider is in internal.net.

I think they should both be in the same place, so I am moving UnixProxyProvider back to internal.net (this affects the JNI code).  If you disagree, I would be happy to leave it in .net.proxy.unix.
Comment 13 Szymon Brandys CLA 2008-04-23 03:49:14 EDT
I want both windows and unix providers in separate packages. So the windows one will be moved to the win32 package.
Comment 14 Francis Upton IV CLA 2008-04-23 05:40:57 EDT
Created attachment 97178 [details]
Revised to use native getenv() and restructure native libs - *not tested*

Here is the work so far.  It's got some debugging prints in it and has not been tested due to difficulties I am having in getting the native libs to work.  Other than the testing though, the coding is complete (as far as I know).
Comment 15 Francis Upton IV CLA 2008-04-23 05:42:43 EDT
Created attachment 97179 [details]
Binaries of the shared libs

Though these were built on a 64 bit system, they are for 32 bit systems.
Comment 16 Francis Upton IV CLA 2008-04-24 04:45:20 EDT
Created attachment 97399 [details]
Revised and tested patch

This has been revised to also handle the no_proxy environment variable as well as the correct handling of the Gnome use_same_proxy setting.  Debug tracing and some error logging has also been added.  This was tested on a 64-bit machine (though using a 32-bit JVM), and also tested on a 32-bit machine (running Gnome).  This version has *not* been tested on a machine without Gnome (though that was tested previously).  As far as I know there are no further outstanding issues with this code.
Comment 17 Francis Upton IV CLA 2008-04-24 04:49:25 EDT
Created attachment 97400 [details]
linux shared libraries for x86 (32 bit)
Comment 18 Francis Upton IV CLA 2008-04-25 02:26:20 EDT
Created attachment 97566 [details]
Patch revised to remove gnome portion, only uses getenv()

This contains 244 lines of new code.

It also contains some small changes to support bug 228739 (UI for proxy system values) which are easier to locate here rather than in that patch.  That bug must depend on this one.
Comment 19 Francis Upton IV CLA 2008-04-25 02:28:58 EDT
Created attachment 97567 [details]
shared library for getenv() support

I decided to keep the getenv() implementation native as it's actually less code than calling "env" from a process (to do it right is a surprising amount of code).  This is simpler.
Comment 20 Francis Upton IV CLA 2008-04-25 02:32:04 EDT
This bug report is rescoped to include only support for reading of the environment variables on Linux.  The gnome support has been moved to bug 228738 which depends on code from this bug.  With the lastest patches there are no known issues.

I was able to reproduce the initial defect reported in comment #1 and confirm that it is related only to the gnome support.  This issue has been addressed in the Gnome code to be submitted under bug 228738.
Comment 21 Szymon Brandys CLA 2008-04-25 05:39:50 EDT
Created attachment 97582 [details]
Get env not using native code
Comment 22 Tomasz Zarna CLA 2008-04-25 06:41:57 EDT
Patch from comment 21 released with some minor modifications. This was the final commit for this bug, marking as FIXED.
Comment 23 Szymon Brandys CLA 2008-05-05 07:01:32 EDT
Verified by code inspection.