Wednesday, July 20, 2011
First step towards windows debugging for OpenJDK
Yesterday I have installed WinDbg for the purpose of debugging openJDK (mostly around b118), I haven't started using it, will update how it goes
Sunday, July 17, 2011
Make downgrade from 3.81 to 3.80
I was trying to build OpenJdk-b118 (for hotspot patch), for this I had to setup few things (as I never did it at my home system), then I realized that my blog had one state for MAKE just saying "Installed make: make version 'GNU Make 3.80'", which was not so simple as is sounds.
I had to struggle for an hour or more to just downgrade the make from 3.81 to 3.80, my mistake previously that I never made a note of it how to do it (downgrading from 3.81 to 3.80), but please note that this information is not complete as well, as I don't remember exactly from where I got the make 3.80 on to my office computer.
TO downgrade, I had to have copy to files one is "make.exe" with version 3.80 and the other is "cygintl-2.dll" (as I said I don't remember how exactly I got this two files, but hope this will be helping me or some other person struggling with downgrade).
I had to struggle for an hour or more to just downgrade the make from 3.81 to 3.80, my mistake previously that I never made a note of it how to do it (downgrading from 3.81 to 3.80), but please note that this information is not complete as well, as I don't remember exactly from where I got the make 3.80 on to my office computer.
TO downgrade, I had to have copy to files one is "make.exe" with version 3.80 and the other is "cygintl-2.dll" (as I said I don't remember how exactly I got this two files, but hope this will be helping me or some other person struggling with downgrade).
Labels:
b118 build,
downgrade make 3.80,
make 3.80,
openJDK,
OpenJdk-b118 build
Sunday, July 10, 2011
argument parsing in Hotspot
Argument parsing in hotspot is done by the class "hotspot\src\share\vm\runtime\arguments.cpp", for example argument "-Xss" would be parsed in this (will be writing more on this when I go through it thoroughly).
Thursday, March 17, 2011
Sunday, February 6, 2011
Building OpenJDK 7 (openjdk-7-ea-src-b105-13_aug_2010) On Windows [Service Pack 3, Version 5.1]
Building OpenJDK 7 (openjdk-7-ea-src-b105-13_aug_2010) On Windows [Service Pack 3, Version 5.1]
Source used: openjdk-7-ea-src-b105-13_aug_2010
Local Path Source: Windows path "E:\dev\jdk7\openjdk-7-ea-src-b105-13_aug_2010" and cygwin path "/cygdrive/e/dev/jdk7/openjdk-7-ea-src-b105-13_aug_2010"
Boot strap JDK: jdk1.6.0_18
Installed the Binary Plugs: downloaded it from "http://www.java.net/download/openjdk/jdk7/promoted/b92/jdk-7-ea-plug-b92-windows-i586-06_may_2010.jar"
Installed DirectX: "DirectX 9.0 SDK Update - (Summer 2004)" as given in the "README-builds.html" file
Installed make: make version "GNU Make 3.80"
Installed VC: Microsoft Visual C++ 2010 Express
Basic environment variables
# Boot strap JDK, windows path "D:\Java\jdk1.6.0_18"
export ALT_BOOTDIR=D:/JAVA/JDK16~1.0_1
# Binary Plugin
export ALT_BINARY_PLUGS_PATH=E:/DEV/JDK7/JDK7EA~2/OPENJD~1
# DirectX path
export ALT_DXSDK_PATH=/cygdrive/e/setup/directX
# Set OPENJDK to true
export OPENJDK=true
Task 1: Run "make sanity" with out errors
------------------------------------------------
Started cygwin and exported all the ALT_ variables above and ran the sanity by "make sanity".
The first sanity make ended in below error "ERROR: FreeType version 2.3.0 or higher is required.", I tried to installed freetype for cygwin, and re-ran the sanity, but ended up with same error.
Searched and found an direction from the link belwo which says "It's trying to build a freetype check program with VS2010, and probably found a stdio.h from the CYGWIN /usr/include, not the stdio.h you want.........which means downloading freetype sources and building it, and saving those files. Yes, I know, painful. Sorry in advance.".
That means I needed to download freeType and build it localy.
http://markmail.org/thread/g6zrjtpmo4sda7aw#query:freetypecheck.c%2829%29%20%3A%20fatal%20error%20C1083%3A%20Cannot%20open%20include%20file%3A%20%27stdio.h%27%3A%20No%20such%20file%20or%20directory+page:1+mid:4bd7hun3tmbwmjql+state:results
So downloaded FreeType version 2.4.4 (freetype-2.4.4) and tried to build using make in cygwin, but ended up with below error
make: ver: Command not found
make: type: Command not found
make: *** [dos_setup] Error 127
Couldn't find a solution (tried a lot to search on web), then using "VC++ 2010 Exp" I build the freetype as explained below
1. Double clicked the file "freetype-2.4.4\builds\win32\visualc\freetype.dsp"
2. Clicked next in "Conversion wizard", if needed choose backup before convertion, and click next and finish.
3. In "Solution Explorer", right clicked and choosen "Configuration Properties"->"General" in left panel, and in the right panel changed "Configuration Type" to "Dynamic Library (.dll)"
4. And made a build (F7), this will create freetype.dll in "freetype-2.4.4\objs\debug".
freetype.lib too is need for the build, we could use VC 2010 for this, but I couldn't genereated the lib file, instead I build freetype.lib using "ftjam-2.5.2-win32"
1. download, extact and set ftjam's bin in path.
2. Open "Visual Studio Command Prompt 2010" found in start up menu.
3. Changed directory to the root of the freetype-2.4.4, and type jam.
4. freetype.lib is created in "freetype-2.4.4\objs"
Copy this freetype.dll and freetype.lib in a directory, in my case I created "lib" directory in "E:\dev\jdk7\freetype-2.4.4_V2\freetype-2.4.4\lib" folder.
Now export the ALT_FREETYPE_LIB_PATH in cygwin environment
export ALT_FREETYPE_LIB_PATH=E:/DEV/JDK7/FREETY~2.4_V/FREETY~1.4/LIB
Note: To get the path as above "E:/DEV/JDK7/FREETY~2.4_V/FREETY~1.4/LIB", the simple solution is, first using cmd go to the path, in my case I typed
"cd cd E:\dev\jdk7\freetype-2.4.4_V2\freetype-2.4.4\lib" and then type "command" we get "E:\DEV\JDK7\FREETY~2.4_V\FREETY~1.4\LIB", now replace '\' with '/' and we get the path.
Now set the ALT_FREETYPE_HEADERS_PATH
export ALT_FREETYPE_HEADERS_PATH=E:/DEV/JDK7/FREETY~2.4_V/FREETY~1.4/INCLUDE
Here I was able to successfully run the sanity check.
Task 2: Building OpenJdk
------------------------------------------------
After sucessfull sanity check, we can go ahead and build the system. Just type make, and I ended with below error
D:/PROGRA~1/MICROS~1.0/VC/Bin/rc: No such file or directory
RC.exe is no more available in VC++ 2010, instead its available in Microsoft SDK, my system contains Microsoft SDK at location "C:\Program Files\Microsoft SDKs"
Now export variable MSSDKTOOLS_PATH as below which should point to BIN directory of Microsoft SDK
export MSSDKTOOLS_PATH=C:/PROGRA~1/MI2578~1/WINDOWS/V7.0A/BIN
And change the content of the file Compiler-msvc.gmk as below located at "openjdk-7-ea-src-b105-13_aug_2010\jdk\make\common\shared"
"RC = $(MSDEVTOOLS_PATH)rc" to "RC = $(MSSDKTOOLS_PATH)rc"
"RSC = $(MSDEVTOOLS_PATH)rc" to "RSC = $(MSSDKTOOLS_PATH)rc"
its enough to change MTL and MT for only VC 10, ie in the if block of COMPILER_NAME as Visual Studio 10
"MTL = $(MSDEVTOOLS_PATH)/midl.exe" to "MTL = $(MSSDKTOOLS_PATH)/midl.exe"
"MT = $(MSDEVTOOLS_PATH)mt" to "MT = $(MSSDKTOOLS_PATH)mt"
Here basically we are pointing RC, midl and mt to be picked from microsoft sdk rather from Visual Studio 10
That should build OpenJDK.
Source used: openjdk-7-ea-src-b105-13_aug_2010
Local Path Source: Windows path "E:\dev\jdk7\openjdk-7-ea-src-b105-13_aug_2010" and cygwin path "/cygdrive/e/dev/jdk7/openjdk-7-ea-src-b105-13_aug_2010"
Boot strap JDK: jdk1.6.0_18
Installed the Binary Plugs: downloaded it from "http://www.java.net/download/openjdk/jdk7/promoted/b92/jdk-7-ea-plug-b92-windows-i586-06_may_2010.jar"
Installed DirectX: "DirectX 9.0 SDK Update - (Summer 2004)" as given in the "README-builds.html" file
Installed make: make version "GNU Make 3.80"
Installed VC: Microsoft Visual C++ 2010 Express
Basic environment variables
# Boot strap JDK, windows path "D:\Java\jdk1.6.0_18"
export ALT_BOOTDIR=D:/JAVA/JDK16~1.0_1
# Binary Plugin
export ALT_BINARY_PLUGS_PATH=E:/DEV/JDK7/JDK7EA~2/OPENJD~1
# DirectX path
export ALT_DXSDK_PATH=/cygdrive/e/setup/directX
# Set OPENJDK to true
export OPENJDK=true
Task 1: Run "make sanity" with out errors
------------------------------------------------
Started cygwin and exported all the ALT_ variables above and ran the sanity by "make sanity".
The first sanity make ended in below error "ERROR: FreeType version 2.3.0 or higher is required.", I tried to installed freetype for cygwin, and re-ran the sanity, but ended up with same error.
Searched and found an direction from the link belwo which says "It's trying to build a freetype check program with VS2010, and probably found a stdio.h from the CYGWIN /usr/include, not the stdio.h you want.........which means downloading freetype sources and building it, and saving those files. Yes, I know, painful. Sorry in advance.".
That means I needed to download freeType and build it localy.
http://markmail.org/thread/g6zrjtpmo4sda7aw#query:freetypecheck.c%2829%29%20%3A%20fatal%20error%20C1083%3A%20Cannot%20open%20include%20file%3A%20%27stdio.h%27%3A%20No%20such%20file%20or%20directory+page:1+mid:4bd7hun3tmbwmjql+state:results
So downloaded FreeType version 2.4.4 (freetype-2.4.4) and tried to build using make in cygwin, but ended up with below error
make: ver: Command not found
make: type: Command not found
make: *** [dos_setup] Error 127
Couldn't find a solution (tried a lot to search on web), then using "VC++ 2010 Exp" I build the freetype as explained below
1. Double clicked the file "freetype-2.4.4\builds\win32\visualc\freetype.dsp"
2. Clicked next in "Conversion wizard", if needed choose backup before convertion, and click next and finish.
3. In "Solution Explorer", right clicked and choosen "Configuration Properties"->"General" in left panel, and in the right panel changed "Configuration Type" to "Dynamic Library (.dll)"
4. And made a build (F7), this will create freetype.dll in "freetype-2.4.4\objs\debug".
freetype.lib too is need for the build, we could use VC 2010 for this, but I couldn't genereated the lib file, instead I build freetype.lib using "ftjam-2.5.2-win32"
1. download, extact and set ftjam's bin in path.
2. Open "Visual Studio Command Prompt 2010" found in start up menu.
3. Changed directory to the root of the freetype-2.4.4, and type jam.
4. freetype.lib is created in "freetype-2.4.4\objs"
Copy this freetype.dll and freetype.lib in a directory, in my case I created "lib" directory in "E:\dev\jdk7\freetype-2.4.4_V2\freetype-2.4.4\lib" folder.
Now export the ALT_FREETYPE_LIB_PATH in cygwin environment
export ALT_FREETYPE_LIB_PATH=E:/DEV/JDK7/FREETY~2.4_V/FREETY~1.4/LIB
Note: To get the path as above "E:/DEV/JDK7/FREETY~2.4_V/FREETY~1.4/LIB", the simple solution is, first using cmd go to the path, in my case I typed
"cd cd E:\dev\jdk7\freetype-2.4.4_V2\freetype-2.4.4\lib" and then type "command" we get "E:\DEV\JDK7\FREETY~2.4_V\FREETY~1.4\LIB", now replace '\' with '/' and we get the path.
Now set the ALT_FREETYPE_HEADERS_PATH
export ALT_FREETYPE_HEADERS_PATH=E:/DEV/JDK7/FREETY~2.4_V/FREETY~1.4/INCLUDE
Here I was able to successfully run the sanity check.
Task 2: Building OpenJdk
------------------------------------------------
After sucessfull sanity check, we can go ahead and build the system. Just type make, and I ended with below error
D:/PROGRA~1/MICROS~1.0/VC/Bin/rc: No such file or directory
RC.exe is no more available in VC++ 2010, instead its available in Microsoft SDK, my system contains Microsoft SDK at location "C:\Program Files\Microsoft SDKs"
Now export variable MSSDKTOOLS_PATH as below which should point to BIN directory of Microsoft SDK
export MSSDKTOOLS_PATH=C:/PROGRA~1/MI2578~1/WINDOWS/V7.0A/BIN
And change the content of the file Compiler-msvc.gmk as below located at "openjdk-7-ea-src-b105-13_aug_2010\jdk\make\common\shared"
"RC = $(MSDEVTOOLS_PATH)rc" to "RC = $(MSSDKTOOLS_PATH)rc"
"RSC = $(MSDEVTOOLS_PATH)rc" to "RSC = $(MSSDKTOOLS_PATH)rc"
its enough to change MTL and MT for only VC 10, ie in the if block of COMPILER_NAME as Visual Studio 10
"MTL = $(MSDEVTOOLS_PATH)/midl.exe" to "MTL = $(MSSDKTOOLS_PATH)/midl.exe"
"MT = $(MSDEVTOOLS_PATH)mt" to "MT = $(MSSDKTOOLS_PATH)mt"
Here basically we are pointing RC, midl and mt to be picked from microsoft sdk rather from Visual Studio 10
That should build OpenJDK.
Labels:
Build,
openJDK,
openJDK Build Windows,
Windows
Monday, November 29, 2010
java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
I got an issue where I had to fix the above problem, what we found was we had a VIEW where we were converting a CLOB to String (i.e. VARCHAR2) using DBMS_LOB.SUBSTR, there was no problem till now and we were using this view from long long time, the above situation came when one of the rows in the CLOB column had double-byte characters and it extended VARCHAR2 length i.e. 4000+, now when we were using this VIEW it was failing saying "ORA-06502" error.
DBMS_LOB.SUBSTR we were using as "DBMS_LOB.SUBSTR(COMMENTS, DBMS_LOB.GETLENGTH(COMMENTS))", and we changed it to DBMS_LOB.SUBSTR(COMMENTS, 1000), as the double-byte characters would take 4 bytes.
I think the above fix is a quick one, and the issue with this would be for normal chars we would be getting max 1000 chars from the CLOB where as in that CLOB it might be more then that.
Will post when we I have a fix for it :)
DBMS_LOB.SUBSTR we were using as "DBMS_LOB.SUBSTR(COMMENTS, DBMS_LOB.GETLENGTH(COMMENTS))", and we changed it to DBMS_LOB.SUBSTR(COMMENTS, 1000), as the double-byte characters would take 4 bytes.
I think the above fix is a quick one, and the issue with this would be for normal chars we would be getting max 1000 chars from the CLOB where as in that CLOB it might be more then that.
Will post when we I have a fix for it :)
Sunday, November 14, 2010
Hibernate Criterion IN Clause 1000 break up
/**
* An utility method to build the Criterion Query IN clause if the number of parameter
* values passed has a size more than 1000. Oracle does not allow more than
* 1000 parameter values in a IN clause. Doing so a {@link SQLException} is
* thrown with error code, 'ORA-01795: maximum number of expressions in a list is 1000'.
* @param propertyName
* @param values
* @return
*/
public static Criterion buildInCriterion(String propertyName, List values)
{
Criterion criterion = null;
int listSize = values.size();
for (int i = 0; i < listSize; i += PARAMETER_LIMIT) {
List subList;
if (listSize > i + PARAMETER_LIMIT) {
subList = values.subList(i, (i + PARAMETER_LIMIT));
}
else {
subList = values.subList(i, listSize);
}
if (criterion != null) {
criterion = Restrictions.or(criterion, Restrictions.in(propertyName, subList));
}
else {
criterion = Restrictions.in(propertyName, subList);
}
}
return criterion;
}
* An utility method to build the Criterion Query IN clause if the number of parameter
* values passed has a size more than 1000. Oracle does not allow more than
* 1000 parameter values in a IN clause. Doing so a {@link SQLException} is
* thrown with error code, 'ORA-01795: maximum number of expressions in a list is 1000'.
* @param propertyName
* @param values
* @return
*/
public static Criterion buildInCriterion(String propertyName, List values)
{
Criterion criterion = null;
int listSize = values.size();
for (int i = 0; i < listSize; i += PARAMETER_LIMIT) {
List subList;
if (listSize > i + PARAMETER_LIMIT) {
subList = values.subList(i, (i + PARAMETER_LIMIT));
}
else {
subList = values.subList(i, listSize);
}
if (criterion != null) {
criterion = Restrictions.or(criterion, Restrictions.in(propertyName, subList));
}
else {
criterion = Restrictions.in(propertyName, subList);
}
}
return criterion;
}
Subscribe to:
Posts (Atom)