[AOLSERVER] nsoracle clob-test.tcl problem

19 views
Skip to first unread message

Abrantes Araújo Silva Filho

unread,
Aug 18, 2012, 1:11:05 PM8/18/12
to aolserv...@lists.sourceforge.net
Hi,

I'm having some trouble with nsoracle tests.

I have instaled AOLserver 4.5.1 (from sourceforge tarball) and
nsoracle (from source on git).

On the webserver (openSUSE 11.2, 32 bits):
- AOLserver 4.5.1
- TCL 8.5.12
- Oracle Client 11.2.0.3.0 (32 bits)

On the oracle server (SuSE Linux Enterprise Server 11 SP2, 64 bits):
- Oracle Server 11.2.0.3.0 (64 bits)

Everything was installed according instructions and I could connect
AOLserver with our database server without any problems.

Please, visit the following URLs:

- AOLserver 4.5.1 installation:
http://desenv.saudenaweb.com.br:84/

- AOLserver connection test page with our database server (just a
"select sysdate from dual" from Oracle):
http://desenv.saudenaweb.com.br:84/db.adp

Until now I could install AOLserver 4.5.1 and connect it to our database server.

But, when I try to test the nsoracle installation with the tests
scripts provided by nsoracle, I got an error with the "clob-test.tcl"
test. All other tests were done whit success. Please, visit the
following URLs:

- table-test.tcl: OK
http://desenv.saudenaweb.com.br:84/nsoracle/table-test.tcl

- bind-test.tcl: OK
http://desenv.saudenaweb.com.br:84/nsoracle/bind-test.tcl

- error-test.tcl: OK
http://desenv.saudenaweb.com.br:84/nsoracle/error-test.tcl

- clob-test.tcl: ERROR!!
http://desenv.saudenaweb.com.br:84/nsoracle/clob-test.tcl


The "ns_ora clob_dml_file" correctly inserted a small file as clob in
the test table.

The problem is with "ns_ora clob_get_file": when selecting the clob
and writing it to a return file, the resulting file have a binary
charset, and so a diff between the original file and the retrurned
file fails (should be equal).

The ORIGINAL file inserted on database (ns_ora clob_dml_file):
> cat markd-small.txt
this is a small test file

> file -i markd-small.txt
markd-small.txt: text/plain; charset=us-ascii


The RETURNED file (ns_ora clob_get_file):
> cat markd-small.txt-back
this is a small test file

> file -i markd-small.txt-back
markd-small.txt-back: text/plain; charset=binary


Now, aparently the problem is in ns_ora clob_get_file: it is writing a
"binary" file insted of a "character" file:
-rw-r--r-- 1 wwwrun www 26 2012-08-18 13:54 markd-small.txt
-rw------- 1 wwwrun www 977K 2012-08-18 13:54 markd-small.txt-back

Any ideas?

I have been discussing this on openACS forum
(http://www.openacs.org/forums/message-view?message_id=3954708) but I
think here is a more appropriate place to discuss nsoracle problems.

thanks!

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
aolserver-talk mailing list
aolserv...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/aolserver-talk

Jeff Rogers

unread,
Aug 22, 2012, 7:31:20 PM8/22/12
to Abrantes Araújo Silva Filho, aolserv...@lists.sourceforge.net
Abrantes Araújo Silva Filho wrote:
> The "ns_ora clob_dml_file" correctly inserted a small file as clob in
> the test table.
>
> The problem is with "ns_ora clob_get_file": when selecting the clob
> and writing it to a return file, the resulting file have a binary
> charset, and so a diff between the original file and the retrurned
> file fails (should be equal).
>
> The ORIGINAL file inserted on database (ns_ora clob_dml_file):
>> cat markd-small.txt
> this is a small test file
>
>> file -i markd-small.txt
> markd-small.txt: text/plain; charset=us-ascii
>
>
> The RETURNED file (ns_ora clob_get_file):
>> cat markd-small.txt-back
> this is a small test file
>
>> file -i markd-small.txt-back
> markd-small.txt-back: text/plain; charset=binary
>
>
> Now, aparently the problem is in ns_ora clob_get_file: it is writing a
> "binary" file insted of a "character" file:
> -rw-r--r-- 1 wwwrun www 26 2012-08-18 13:54 markd-small.txt
> -rw------- 1 wwwrun www 977K 2012-08-18 13:54 markd-small.txt-back
>
> Any ideas?


A few thoughts.

One strong possibility is that this code is old and worked fine against
oracle 8 but hasn't been tested in a long time.

You could enable the oracle driver debugging: in the config file section
"ns/db/driver/ora8" add in the parameter "ns_param Debug true".
This will log lots more stuff along the way, like the results of various
OCI calls.

The differing file sizes makes it look like 'clob_get_file' is
incorrectly getting the size of the lob. Are the contents of the file
"this is a small test file\0" over and over again, or is it "this is a
small test file" followed by 976k of garbage? The former suggests the
lob reading got into a loop and didn't realize it needed to stop, the
latter suggests a simple buffer overrun (and some amount of luck the
server didn't crash).

Check the length of the inserted lob through independent means (e.g.,
sql*plus and an appropriate dbms_lob function) Is it 26 or 977k? If the
lob length in the database is wrong, then it points to clob_dml_file
being broken.

If the problem really is just with clob_get_file and you are running
openacs, you can probably ignore the problem as that function isn't used
in openacs that I can tell.

Are you tied to oracle for business reasons? Lots of people are running
openacs quite well on postgresql, and quite a few people prefer
postgresql over oracle in any case.

-J

John Buckman from BookMooch

unread,
Sep 13, 2012, 7:11:06 PM9/13/12
to aolserv...@lists.sourceforge.net
I don't know who is in charge of the aolserver.com web page.

Some chinese gamer site has figured out how to have the titles on the page, to repeatedly mention
> www.47qu.com,best webgame website

on the aolserver home page.

-john


------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html

Dossy Shiobara

unread,
Sep 14, 2012, 1:26:37 PM9/14/12
to aolserv...@lists.sourceforge.net
Thanks for the heads-up, John. I believe I fixed the defacement. Not
sure how it happened and since it's hosted by SourceForge, I don't
believe I have access to the necessary logs to even attempt a
post-mortem root cause analysis.

I suppose I'll just wait and see if it happens again, and if it does,
perhaps try and get SF support to help diagnose.


On 9/13/12 7:11 PM, John Buckman from BookMooch wrote:
> I don't know who is in charge of the aolserver.com web page.
>
> Some chinese gamer site has figured out how to have the titles on the page, to repeatedly mention
>> > www.47qu.com,best webgame website
> on the aolserver home page.

--
Dossy Shiobara | "He realized the fastest way to change
do...@panoptic.com | is to laugh at your own folly -- then you
http://panoptic.com/ | can let go and quickly move on." (p. 70)
* WordPress * jQuery * MySQL * Security * Business Continuity *

John Buckman from BookMooch

unread,
Sep 15, 2012, 11:01:05 AM9/15/12
to aolserv...@lists.sourceforge.net
I'm trying to build the current cvs tree on both osx, and 64 bit Linux, and both are failing with link errors against nsthread.

To build, I'm running nsconfig.tcl, then make.

Is there a different process these days?

On Linux:

/usr/local/bin/tclsh8.6 /opt/tmp/aol/aolserver/util/nsremove.tcl nsthreadtest
gcc -o nsthreadtest nsthreadtest.o \
-L. -lnsthread -L/opt/ActiveTcl-8.6/lib -ltcl8.6 -ldl -lz -lpthread -lieee -lm -lgcc_s -Wl,--export-dynamic -Wl,-rpath,/usr/local/lib -Wl,-rpath,/lib
nsthreadtest.o: In function `Pthread':
nsthreadtest.c:(.text+0xc): undefined reference to `Ns_ThreadSetName'
many more undefined references...

--

On OSX there's an ns.mak error, causing gcc to try to build both for 64 and 32 bit architectures (ns.mak has "gcc -arch x86_64 -arch i386"), but then the same link error appears:

gcc -DALLOW_EMPTY_EXPAND -arch x86_64 -pipe -fvisibility=hidden -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5 -o nsthreadtest nsthreadtest.o \
-L. -lnsthread -F/Library/Frameworks -framework Tcl -lz -lpthread -framework CoreFoundation -headerpad_max_install_names -Wl,-search_paths_first
Undefined symbols for architecture x86_64:
"_ns_ctime", referenced from:
_Msg in nsthreadtest.o
_WorkThread in nsthreadtest.o
"_Ns_MutexLock", referenced from:
_Msg in nsthreadtest.o
_Pthread in nsthreadtest.o
_DumperThread in nsthreadtest.o
_MemTime in nsthreadtest.o
_MemThread in nsthreadtest.o
_main in nsthreadtest.o
_WorkThread in nsthreadtest.o
...
"_Ns_ThreadGetName", referenced from:
_Msg in nsthreadtest.o
"_Ns_MutexUnlock", referenced from:
_Msg in nsthreadtest.o
_Pthread in nsthreadtest.o
_DumperThread in nsthreadtest.o
_MemTime in nsthreadtest.o
_MemThread in nsthreadtest.o
_main in nsthreadtest.o
_WorkThread in nsthreadtest.o
...
------------------------------------------------------------------------------
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?

John Buckman from BookMooch

unread,
Sep 15, 2012, 12:00:02 PM9/15/12
to aolserv...@lists.sourceforge.net
I've fixed my aolserver build process -- I believe that the following C Flag:

-fvisibility=hidden

is the problem and should be removed from ns.make. 

-fvisibility=hidden appears to hide the nsthread libraries from the rest of nsd, and thus creates a link error.

I removed it from include/ns.mak and the aolserver build process on both linux and osx now work.

-john

John Buckman from BookMooch

unread,
Sep 15, 2012, 1:41:15 PM9/15/12
to aolserv...@lists.sourceforge.net
I tried tcl8.6.0.0b7 (from the current ActiveTcl) an it does build fine with aolserver, but when loading adp pages, I get:

> [15/Sep/2012:10:14:36][60416.32952320][-default:5-] Error: Tcl exception:
> wrong # args: should be "namespace objName"
> while executing
> "namespace export {[a-z]*}"
> (in namespace eval "::oo::InfoObject" script line 1)
> invoked from within
> "namespace eval ::oo::InfoObject {namespace export {[a-z]*}
> }"
> invoked from within
> "ns_ictl update"


the problem appears to be centered around this ns_ictl code in bin/init.tcl

> #
> # Register the init and cleanup callbacks.
> #
>
> ns_ictl trace create {ns_ictl update}
> ns_ictl trace allocate ns_init
> ns_ictl trace deallocate ns_cleanup

I wasn't able to solve the problem (banged on it for an hour), but just wanted to post an FYI in case anyone else has seen it or worked on it.

-john

Jeff Rogers

unread,
Sep 16, 2012, 12:19:37 AM9/16/12
to John Buckman from BookMooch, aolserv...@lists.sourceforge.net
I'd guess this is related to the code to rebuild namespaces, there may
be something different enough about tcloo namespaces to break it. It
could be something as simple as using "namespace" instead of
"::namespace". I'll try building with the latest tcl and see what I run
into.

-J

John Buckman from BookMooch wrote:
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?

Jeff Rogers

unread,
Sep 17, 2012, 2:39:12 PM9/17/12
to John Buckman from BookMooch, aolserv...@lists.sourceforge.net
Looks like that flag is being pulled in from the tcl compilation flags.
GCC claims it's a great thing, I suppose there's some rationale to it.
In any case, it can also be fixed by updating the definition of
NS_EXPORT in include/nsthread.h:

#else
# if __GNUC__ >= 4
# define NS_EXPORT __attribute__ ((visibility ("default")))
# else
# define NS_EXPORT
# endif /* __GNUC__ >= 4 */

I've checked in this change.

-J


John Buckman from BookMooch wrote:
> ------------------------------------------------------------------------------
> How fast is your code?
> 3 out of 4 devs don\\\'t know how their code performs in production.
> Find out how slow your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219672;13503038;z?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
>
>
>
> _______________________________________________
> aolserver-talk mailing list
> aolserv...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/aolserver-talk
>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Jeff Rogers

unread,
Sep 17, 2012, 4:56:02 PM9/17/12
to John Buckman from BookMooch, aolserv...@lists.sourceforge.net
Just as I suspected, there is a piece of tcloo internals that defines a
different 'namespace' command and it was being picked up due to the use
of an unqualified call. I've checked in a fix.

I also excluded '::oo' from the interp building namespace traversal as a
precaution, until I can learn what needs to be done to recreate tcloo
objects correctly. This means that for the time being, tcloo
definitions in initialization scripts won't be recreated in conn
interps. However, since they didn't work before, it's doubtful anyone
was using them, so this should have no immediate impact :)

-J

Jeff Rogers wrote:
> I'd guess this is related to the code to rebuild namespaces, there may
> be something different enough about tcloo namespaces to break it. It
> could be something as simple as using "namespace" instead of
> "::namespace". I'll try building with the latest tcl and see what I run
> into.
>
> -J
>
> John Buckman from BookMooch wrote:
>> I tried tcl8.6.0.0b7 (from the current ActiveTcl) an it does build fine with aolserver, but when loading adp pages, I get:
>>
>>> [15/Sep/2012:10:14:36][60416.32952320][-default:5-] Error: Tcl exception:
>>> wrong # args: should be "namespace objName"
>>> while executing
>>> "namespace export {[a-z]*}"
>>> (in namespace eval "::oo::InfoObject" script line 1)
>>> invoked from within
>>> "namespace eval ::oo::InfoObject {namespace export {[a-z]*}
>>> }"
>>> invoked from within
>>> "ns_ictl update"



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Reply all
Reply to author
Forward
0 new messages