code logs -> 2007 -> Mon, 24 Sep 2007< code.20070923.log - code.20070925.log >
--- Log opened Mon Sep 24 00:00:34 2007
00:05 Chalcedon is now known as Chalcy
00:06 Chalcy is now known as Chalcedon
00:12 McMartin [~mcmartin@Nightstar-904.dsl.pltn13.sbcglobal.net] has joined #code
00:12 mode/#code [+o McMartin] by ChanServ
00:34 Mischief [~Genesis@Nightstar-7565.hsd1.md.comcast.net] has quit [Connection reset by peer]
00:34 Genesis__ [~Genesis@Nightstar-7565.hsd1.md.comcast.net] has joined #code
01:12
< MinceR>
gn
01:49 Thaqui [~Thaqui@Nightstar-26933.jetstream.xtra.co.nz] has quit [Ping Timeout]
01:54 Doctor_Nick [~nick@Nightstar-23600.hsd1.fl.comcast.net] has joined #code
02:38 Genesis__ [~Genesis@Nightstar-7565.hsd1.md.comcast.net] has quit [Connection reset by peer]
02:39 Mischief [~Genesis@Nightstar-7565.hsd1.md.comcast.net] has joined #code
02:43 ReivZzz is now known as ReivClass
04:02 Thaqui [~Thaqui@Nightstar-26933.jetstream.xtra.co.nz] has joined #code
04:02 mode/#code [+o Thaqui] by ChanServ
04:14 GeekSoldier|bed is now known as GeekSoldier|work
04:41 Syloq [Syloq@NetAdmin.Nightstar.Net] has joined #code
04:42 Syloq is now known as Syloqs-AFH
05:18
<@McMartin>
Hmm.
05:18 * McMartin mumbles
05:18
<@McMartin>
I wonder if Ophis runs on Python 2.3
05:43 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has joined #code
05:43 mode/#code [+o Forj] by ChanServ
07:07 GeekSoldier|work [~Rob@Nightstar-5968.pools.arcor-ip.net] has quit [Ping Timeout]
08:04 Vornicus is now known as Vornicus-Latens
08:32 You're now known as TheWatcher
08:42 AbuDhabi [AnnoDomini@Nightstar-29563.neoplus.adsl.tpnet.pl] has joined #Code
08:42 AnnoDomini [AnnoDomini@Nightstar-29563.neoplus.adsl.tpnet.pl] has quit [Connection reset by peer]
08:42 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: rebooting]
08:47 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has joined #code
08:47 mode/#code [+o Chalcedon] by ChanServ
10:00 GeekSoldier|work [~Rob@Nightstar-3621.pools.arcor-ip.net] has joined #code
10:07 gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has joined #Code
10:07 mode/#code [+o gnolam] by ChanServ
10:29 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
11:58 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
12:25 AbuDhabi is now known as AnnoDomini
14:01
<@jerith>
http://manetheren.cl.msu.edu/~vanhoose/humor/0332.html
14:29 ReivClass is now known as ReivZzz
14:53
< MinceR>
r4wr
14:54 * AnnoDomini rolls eyes.
14:55
< MinceR>
!eyes
16:43 Vornicus-Latens is now known as Vornicus
16:46
<@ToxicFrog>
Gnar.
16:46
<@ToxicFrog>
I think I'm going to have to implement this in terms of thoth message passes, which means an extra thread for each socket.
16:46
<@ToxicFrog>
Aah well.
16:49
< Doctor_Nick>
can anyone help me with a problem with C?
16:49
<@ToxicFrog>
Probably.
16:49
<@ToxicFrog>
Don't ask to ask; just ask.
16:50
< Doctor_Nick>
yeah
16:50
< Doctor_Nick>
lemme throw this up on my webspace
16:50
<@ToxicFrog>
We have a paster.
16:50
<@ToxicFrog>
*pastey.
16:50
< Doctor_Nick>
i have to nest a few ssh sessions here
16:50
<@ToxicFrog>
Pastebin, even.
16:52
< Doctor_Nick>
aaaaaaaa
16:52
< Doctor_Nick>
oh
16:53
< Doctor_Nick>
i thought I deleted the whole thing for a sec there :/
16:53
< Doctor_Nick>
oookay: http://doctornick.dreamhosters.com/opsys/observer.c
16:54
< Doctor_Nick>
this program just parses through /proc and spits out the values for some system variable, basically
16:55
<@ToxicFrog>
C is the wrong language for this, but ok
16:55
< Doctor_Nick>
Trust me, I didnt have a choice
16:55
< Doctor_Nick>
I certainly didnt WANT to use C :P
16:56
<@ToxicFrog>
Aah. Why does it have to be C?
16:56
< Doctor_Nick>
because that's what everyone knows how to use and that's what the TA knows
16:56
<@ToxicFrog>
Oh.
16:56
<@ToxicFrog>
Thrash the TA soundly, if learning new languages is such a hardship for him he shouldn't be in CS~
16:57
< GeekSoldier|work>
hear hear!
16:57
<@ToxicFrog>
Anyways. What's the problem?
16:57
< Doctor_Nick>
i think the logic behind it is that we have to learn enough C later on for some kernal programming, so we might as well learn it now
16:57
< Doctor_Nick>
anywayyyy
16:57
< Doctor_Nick>
the problem is, if I nest some of those function calls inside another function, or if I put the program to sleep and then call a function, I get seg faults
16:57 GeekSoldier|work is now known as GeekSoldier
16:57
< Doctor_Nick>
(by function, i mean my user defined functions i have written in thar)
16:57
<@ToxicFrog>
What does the stack trace look like?
16:58
<@ToxicFrog>
And what line does it fault on?
16:58
< Doctor_Nick>
something to do with get
16:58
< Doctor_Nick>
lemme double check
16:58
<@ToxicFrog>
...and, for that matter, are you using gdb for this or are you just eyeballing it?
16:59
< Doctor_Nick>
gdb
16:59
< Doctor_Nick>
the segfault is at fgets()
17:00
<@ToxicFrog>
Which doesn't really confer any useful information; walk back up the stack and find out what called it and with what arguments.
17:01
< Doctor_Nick>
http://pastebin.com/m1223805c
17:01
< Doctor_Nick>
print_uptime() is a function I call after I call "sleep(1)"
17:02
< Doctor_Nick>
i can call print_uptime() before sleep(1) and it will run fine, though
17:02
<@ToxicFrog>
...
17:02
<@ToxicFrog>
Ok, concerning lineBuf...
17:02
<@ToxicFrog>
Do you ever actually allocate space for it?
17:03
< Doctor_Nick>
oh.
17:03
<@ToxicFrog>
Because, er, as far as I can tell you're just declaring it and praying it doesn't point somewhere dangerous.
17:03
< Doctor_Nick>
yeah...
17:03
<@ToxicFrog>
Either malloc() space for it, or declare a static buffer.
17:03
< Doctor_Nick>
ok
17:03
<@ToxicFrog>
(a static global buffer, even, so you aren't constantly growing and shrinking it on the stack)
17:04
<@ToxicFrog>
Also, when I said "walk back up the stack and find out what called it and with what arguments", that is in fact what I meant, not "print a stack trace"
17:04
<@ToxicFrog>
Ie, something like:
17:04
<@ToxicFrog>
) level 4
17:04
< Doctor_Nick>
how do you do that
17:04
<@ToxicFrog>
) print lineBuf
17:04
< Doctor_Nick>
i was just using "bt"
17:04
<@ToxicFrog>
) print thisProcFile
17:05
<@ToxicFrog>
) print LB_SIZE+1
17:05
<@ToxicFrog>
Use "level X" (or "up" and "down") to move around in the stack, and "print EXPR" to display stuff
17:06
< Doctor_Nick>
it says it doesnt understand "level"
17:06
<@ToxicFrog>
Note that expr can be extremely complicated; stuff like "print (struct foo *)(buffer)->bar" is legal.
17:06
<@ToxicFrog>
Er. "frame X"
17:06
<@ToxicFrog>
Sorry.
17:06
<@ToxicFrog>
Also: LB_SIZE+1 is not right.
17:07
<@ToxicFrog>
Just use LB_SIZE.
17:07
< Doctor_Nick>
how large can a line buffer be?
17:07
<@ToxicFrog>
....as large as you make it.
17:07
<@ToxicFrog>
Stuff in /proc can sometimes have pretty long lines, so I'd make mine a static 2k buffer or thereabouts:
17:07
<@ToxicFrog>
// at global scope
17:07
<@ToxicFrog>
#define BUFSIZE 2048
17:07
<@ToxicFrog>
static char buffer[BUFSIZE];
17:08
<@ToxicFrog>
// in some function
17:08
< Doctor_Nick>
where does c dump global variable?
17:08
< Doctor_Nick>
variables*
17:08
<@ToxicFrog>
fgets(buffer, BUFSIZE, handle);
17:08
<@ToxicFrog>
In the .data or .bss segments of the executable.
17:08
<@ToxicFrog>
Ie, in main memory, preallocated when the program is loaded.
17:09
<@ToxicFrog>
Local variables are allocated on the stack (so be careful) and malloc'd space goes on the heap.
17:09
< Doctor_Nick>
i think the main problem is that after i sleep(), the stack pointer goes all kacky-wompus
17:10
<@ToxicFrog>
Well, remember, fgets() is writing god knows where.
17:10
<@ToxicFrog>
It's probably trashing the stack, or the malloc accounting information, or more likely both.
17:10
<@ToxicFrog>
Fix that, and then see if you still have problems.
17:10
< Doctor_Nick>
yah
17:14
<@ToxicFrog>
Also, checking the return value of thisProcFile might be wise :P
17:14
<@ToxicFrog>
Err, of fopen()
17:15
< Doctor_Nick>
yeah, i should probably check that
17:22
< Doctor_Nick>
ToxicFrog: it throws compiler warnings at me when I do a global static array
17:22
< Doctor_Nick>
observer.c:180: warning: passing arg 1 of `fgets' from incompatible pointer type
17:22
< Doctor_Nick>
and so on
17:24
< Doctor_Nick>
oh wait
17:24
< Doctor_Nick>
im dumb
17:24
< Doctor_Nick>
nvm :B
17:25
< Doctor_Nick>
woop
17:25
< Doctor_Nick>
yeah
17:25
< Doctor_Nick>
it was the pointers
17:26
< Doctor_Nick>
thanks for the assist
17:32 You're now known as TheWatcher[afk]
17:33 Doctor_Nick is now known as nick_
18:36
<@ToxicFrog>
No problem.
19:26 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has joined #code
19:26 mode/#code [+o Forj] by ChanServ
19:31 GeekSoldier is now known as GeekSoldier|ed
19:31 GeekSoldier|ed is now known as GeekSoldier|Bed
19:52 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
21:02 Chalcedon [~Chalcedon@Nightstar-2472.ue.woosh.co.nz] has joined #code
21:02 mode/#code [+o Chalcedon] by ChanServ
21:12
<@McMartin>
In other news, I have learned to use the Python distutils.
21:12
<@McMartin>
Now to work out how to make it change defaults, and to make a standalone install.sh that invokes it appropriately
21:12
<@McMartin>
Since I suspect people will bitch and moan about having to type "python setup.py install" themselves =P
21:22
< MinceR>
why not just put a shebang line on setup.py?
21:22
< MinceR>
maybe ./setup.py install works already
21:22
<@McMartin>
But they're being made to type something that isn't ./configure; make; make install and this gives many people the vapors.
21:22
<@ToxicFrog>
configure:
21:22
<@ToxicFrog>
#!/bin/sh
21:23
<@McMartin>
(And also because as stated it tends to stuff it into /usr/bin, which I don't want.
21:23
<@McMartin>
)
21:23
<@McMartin>
I need to learn how to package documentation and how to change the default prefix.
21:23
<@ToxicFrog>
echo "Wrong build system. Try 'python setup.py install' instead."
21:23
< MinceR>
echo Configure complete. Now go run "python setup.py install".
21:23
<@ToxicFrog>
exit 1
21:23
< MinceR>
:)
21:23
<@ToxicFrog>
Don't forget the exit 1! Otherwise "configure && make" won't short circuit :P
21:24
< MinceR>
:)
21:24
<@McMartin>
If they use semicolons it's non-shortcircuitable~
21:24
<@ToxicFrog>
If they're using semicolons they don't deserve our pity~
21:24
< MinceR>
or if you really want it to be hackish, write a makefile that runs that stuff on make install :>
21:24
< MinceR>
and exit 0 before it
21:27
<@McMartin>
Well, distutils can do all kinds of wacky stuff
21:28
<@McMartin>
And in fact will be where I check the dependencies, when I apply it to Blorple, I think.
21:28
<@McMartin>
http://blorple.sf.net/
21:28
<@McMartin>
Uses a homebrew install script right now, and that doesn't really work if your python or your env are in the wrong places
22:03 You're now known as TheWatcher
22:10 nick_ [~nick@Nightstar-23600.hsd1.fl.comcast.net] has quit [Quit: Konversation terminated!]
22:25 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Operation timed out]
22:31 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
22:31 mode/#code [+o ToxicFrog] by ChanServ
22:39 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has joined #code
22:39 mode/#code [+o Forj] by ChanServ
22:46 Forj [~Forj@Nightstar-2472.ue.woosh.co.nz] has quit [Quit: Gone]
23:03 AnnoDomini [AnnoDomini@Nightstar-29563.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
23:08 AnnoDomini [AnnoDomini@Nightstar-29047.neoplus.adsl.tpnet.pl] has joined #Code
23:08 mode/#code [+o AnnoDomini] by ChanServ
23:10 You're now known as TheWatcher[T-2]
23:14 You're now known as TheWatcher[zZzZ]
23:21 Vornicus [~vorn@ServicesOp.Nightstar.Net] has quit [Ping Timeout]
23:24 Vornicus [~vorn@64.252.9.ns-26300] has joined #code
--- Log closed Tue Sep 25 00:00:40 2007
code logs -> 2007 -> Mon, 24 Sep 2007< code.20070923.log - code.20070925.log >