AOLserver Chat Logs

2007/08/30

IRC [08:24] <cacrus> Dossy are u dere ?
IRC [08:25] <cacrus> daguz: yes the build worked , but it was not the tcl version issue , i used Dossy's recommenbed -nostartfiles method and now i have it with the latest tcl version 8.4.15
IRC [09:59] <cacrus> i am trying to figure out the segmentation faults given by nsthreadtest , using gdb , can anyone assist ?
IRC [10:17] *** cacrus parted the chat.
IRC [11:52] <Dossy_> wow, sourceforge project shell server at load 11.0 -- barely usable
IRC [11:52] <Dossy_> I can't set up Trac there. ugh
IRC [12:26] *** holycow joined the chat.
IRC [12:34] <Spark> Dossy_: about tclvar.c
IRC [12:34] <Spark> why are there two levels of hash tables
IRC [12:34] <Spark> if you want to set, it seems there are 3 params, array, var, new value
IRC [13:20] *** partymola joined the chat.
IRC [13:41] <Dossy_> Spark: right
IRC [13:41] <Dossy_> as of Tcl 8.something, Tcl arrays are "special" unfortunately
IRC [13:42] <partymola> so special that sometimes they drive me nuts :D
IRC [13:43] <Spark> in what way are they special? :)
IRC [13:46] <Dossy_> :)
IRC [13:47] <Dossy_> before, in Tcl 7, when "everything is a string" ... Tcl arrays were really strange
IRC [13:47] <Dossy_> think "foo(bar)" was just another variable name--not an "array"
IRC [13:47] <Dossy_> now, Tcl arrays are individual hashtables themselves
IRC [13:48] <Dossy_> so, you now have two levels of hashtables :)
IRC [13:48] <Spark> so before, a hashtable was just a way of dynamically making variables
IRC [13:48] <Spark> or something like that
IRC [13:48] <Dossy_> think variable "foo(bar)" is the key bar in hashtable foo. variable "baz" is the key baz in hashtable ""
IRC [13:48] <Spark> sort of like what you do in bash using exec
IRC [13:48] <Spark> are the brackets needed?
IRC [13:49] <Dossy_> in what way?
IRC [13:49] <Dossy_> Do you have a particular example to illustrate your idea?
IRC [13:50] <Spark> in bash you can create new environment variables to fake a hashtable
IRC [13:50] <Spark> so if you want a new entry, you do eval MYHASH_$KEY=$MYVAL
IRC [13:50] <Spark> or something like that
IRC [13:51] <Spark> re: are the brackets needed, if the purpose is to ensure the names won't clash with existing variables, you just need to use any arbitrary character which isn't allowed in an identifier, like : or something?
IRC [13:53] <partymola> i use to use brackets when problems may arise, like when using strange identifiers, or reference something which name is formed by two diff variables like ${object}_${method}
IRC [13:54] <partymola> anyways, i call them "curly braces"
IRC [13:58] <Spark> you call () curly braces?
IRC [14:00] <partymola> no, { }
IRC [14:00] <Dossy_> oh, curly braces.
IRC [14:00] <Dossy_> () are parenthesis.
IRC [14:00] <Dossy_> [] are brackets, or square brackets.
IRC [14:01] <partymola> yep
IRC [14:01] * partymola nods to what Dossy said
IRC [14:01] <Dossy_> if you want to use Tcl arrays, yes, the () are required.
IRC [14:01] <Dossy_> kind of. there's also the Tcl [array] command :)
IRC [14:01] <partymola> yep, it's arrayname(key)
IRC [14:01] <Spark> i don't know much about tcl unfortunately
IRC [14:01] <Spark> i had a quick look at the syntax
IRC [14:02] <Spark> but then i forgot it again :)
IRC [14:02] <partymola> Spark: it's easy to learn once you get to it ;)
IRC [14:02] <Spark> most things are
IRC [14:02] <partymola> and if u don't get to it... make ur own wrapper to array functions lol
IRC [14:03] <Spark> i can convert the tclvar.c code into the toy language code that we're using as a case study for this analysis without actually understanding what it does :)
IRC [14:03] <Spark> but it would be interesting to know anyway
IRC [14:03] <Spark> the language i'm converting it into is java-like, and the analysis doesn't understand libraries so i'm writing a Tcl_HashTable too :)
IRC [14:03] <Spark> the other calls i can probably replace with stubs, or writes into the interpreter object
IRC [14:04] <Dossy_> heh
IRC [14:06] <partymola> zomg! Spark is killing TCL!
IRC [14:06] <Spark> i've assumed the "var" in tclvar.c is configuration parameters within the webserver or something like that
IRC [14:06] <partymola> Spark: where are you from? ;)
IRC [14:06] <Spark> london
IRC [14:07] * partymola sends some polish guys to stop Spark
IRC [14:07] <partymola> they're all around England... they're tracing your position atm lol
IRC [14:08] <Spark> Dossy_: so what are used as keys in each hashtable (i see they're both strings)
IRC [14:09] <Dossy_> what do you mean?
IRC [14:09] <Spark> how is this code used
IRC [14:09] <Spark> the hashtables start off empty, who puts what into them, and who reads what out of them
IRC [14:10] <Dossy_> Look at the comment at the top of the file:
IRC [14:10] <Dossy_> /*
IRC [14:10] <Dossy_> * tclvar.c --
IRC [14:10] <Dossy_> *
IRC [14:10] <Dossy_> * Support for the old ns_var and new nsv_* commands.
IRC [14:10] <Dossy_> */
IRC [14:10] <Dossy_> application code uses them.
IRC [14:11] <Dossy_> AOLserver is, for the most part, just an application server.
IRC [14:11] <Spark> i don't know enough about aolserver itself, you see :)
IRC [14:12] <Spark> so it's like a bank of global variables that you can use for whatever?
IRC [14:17] <Dossy_> yeah. i guess you can call it that.
IRC [14:17] <Dossy_> thread-shared variables
IRC [14:18] <Spark> ahh right
IRC [14:18] <Spark> shared between instances of Tcl_Interp
IRC [14:20] <Spark> i'm not sure how this interface appears to the code, NsTclNsvSetObjCmd usually takes 4 params, of which argv[0] is not used, can you give an example of what argv[1-3] might be?
IRC [14:21] <Spark> it gets the array at argv[1], and sets the key argv[2] to argv[3]
IRC [14:21] <Spark> is this just to give you a bit of name spacing or something?
IRC [14:22] <Spark> module.var = val
IRC [14:25] <Dossy_> FYI, the beginnings of the Trac setup are here: http://static.panoptic.com/aolserver/trac
IRC [14:25] <Dossy_> I need to get someone at AOL to point DNS for dev.aolserver.com at that, though
IRC [14:25] <Dossy_> spark: yeah, a kind of namespacing, if you want to look at it that way
IRC [14:26] <Dossy_> you might do:
IRC [14:26] <Dossy_> nsv_set arrayname key value
IRC [14:26] <Dossy_> nsv_get arrayname key
IRC [14:26] <Spark> ah ok
IRC [14:26] <Spark> well that all makes sense now, thanks :)
IRC [14:26] <Spark> it amazes me there are so many functions for doing various things to the data
IRC [14:27] <Dossy_> my bad, http://static.panoptic.com/aolserver/trac/
IRC [14:27] <Spark> oh, and why does NsTclVarObjCmd exist?
IRC [14:27] <Spark> it's so you can pass the operation as an argument
IRC [14:27] <Spark> kinda like an eval?
IRC [14:28] <Spark> it seems it doesn't support as many operations as using the interface directly though
IRC [14:29] <Dossy_> ObjCmd's are to expose the C API to the Tcl interp
IRC [14:30] <Spark> the c api as in NsTclNsvSetObjCmd etc?
IRC [14:31] <Spark> i assumed they were registered by something else
IRC [14:32] <Dossy_> no
IRC [14:32] <Dossy_> the whole LockArray() and UnlockArray() etc.
IRC [14:33] <Dossy_> (...)ObjCmd()'s are invoked by the Tcl interp in response to a Tcl script chunk
IRC [14:33] <Spark> ah right, they allow you to do things to the top level
IRC [14:33] <Spark> oh, hmm?
IRC [14:35] <Spark> right yeah, it doesn't call LockArray, but it does iterate over the buckets looking for the right array, and then does things to that array
IRC [14:35] <Spark> it seems
IRC [14:36] <Spark> which is kinda what LockArray does, only LockArray uses a hash algorithm to get straight to the right bucket
IRC [14:36] <Spark> hang on i'm talking crap
IRC [14:38] <Spark> NsTclVarObjCmd accesses itPtr->servPtr->var.table
IRC [14:38] <Spark> whereas LockArray is all about itPtr->servPtr->nsv.buckets
IRC [14:38] <Spark> it's a completely different kettle of fish
IRC [14:51] *** holycow parted the chat.
IRC [14:58] *** Dossy_ parted the chat.
IRC [15:05] *** Dossy_ joined the chat.
IRC [15:06] *** Dossy_ parted the chat.
IRC [15:08] *** cacrus joined the chat.
IRC [15:16] <cacrus> Dossy: thanks for your reply on segmentation fault , however the latest CVS version of aolserver has the same problem , even when compiled static . The version which can be downloaded from aoslerver worked fine when i did --enable-static ... I am just hoping that its a nsthreadtest problem and aolserver will be fine :)
IRC [15:18] *** Dossy_ joined the chat.
IRC [15:26] <Dossy_> who #aolserver
IRC [15:26] <Dossy_> /quote who #aolserver
IRC [15:29] <Dossy_> /quote who #aolserver
IRC [15:31] <cacrus> Dossy did u just join ?
IRC [15:37] <Dossy_> /quote who #aolserver
IRC [15:37] <Dossy_> yeah
IRC [15:38] <Dossy_> /quote who #aolserver
IRC [15:38] <Dossy_> argh
IRC [15:38] <Dossy_> pidgin won't let me send /quote through tcl plugin. d arn
IRC [15:41] <cacrus> iam pasting my message i typed earlier
IRC [15:41] <cacrus> Dossy: thanks for your reply on segmentation fault , however the latest CVS version of aolserver has the same problem , even when compiled static . The version which can be downloaded from aoslerver worked fine when i did --enable-static ... I am just hoping that its a nsthreadtest problem and aolserver will be fine
IRC [16:03] *** Dossy_ parted the chat.
IRC [16:03] *** Dossy_ joined the chat.
IRC [16:15] *** Dossy_ parted the chat.
IRC [16:15] *** Dossy_ joined the chat.
IRC [16:16] *** Dossy_ parted the chat.
IRC [16:16] *** Dossy_ joined the chat.
IRC [16:19] *** Dossy_ parted the chat.
IRC [16:20] *** Dossy_ joined the chat.
IRC [16:34] *** Dossy_ parted the chat.
IRC [17:46] *** Dossy_ joined the chat.
IRC [18:00] <cacrus> daguz: I have the segmentation fault as well ,
IRC [18:01] <cacrus> i just tried it , using aoslerver cvs and tcl 8.4.15 , segmentation fault running nsd
IRC [18:03] <cacrus> i can run gdb on core dump , is there anyone online who can look into this
IRC [18:17] *** cacrus parted the chat.