2009-05-03T00:07:54 *** syslogd_ has joined #glendix 2009-05-03T00:24:39 *** syslogd has quit IRC 2009-05-03T00:25:54 *** syslogd_ is now known as syslogd 2009-05-03T05:07:45 jrm8005, do you think there is something wrong with this code? http://pastebin.com/d62ef5b72 2009-05-03T05:07:46 Title: C pastebin - collaborative debugging tool (at pastebin.com) 2009-05-03T05:08:19 kernel crashes if I type something starting with "connect ", some issue inside the if structure 2009-05-03T05:10:14 the while will always go off the end of tmp and dereference null 2009-05-03T05:12:29 well, not alwys always, but 2009-05-03T05:15:00 jrm8005, I am not sure what you mean... 2009-05-03T05:15:20 well, if you give it a string without : or !, it will segfault 2009-05-03T05:16:00 also possible that TMPSIZE is too sall 2009-05-03T05:16:05 small* 2009-05-03T05:16:20 hmm 2009-05-03T05:16:29 TMPSIZE is 128 2009-05-03T05:16:30 or, port might not always be 5. 2009-05-03T05:16:35 its a #define here 2009-05-03T05:16:47 if you give it 80 instead of 00080, it will fault 2009-05-03T05:16:48 ya... true, but I am only testing 2009-05-03T05:16:57 oh 2009-05-03T05:17:20 I entered, "connect 172.16.1.20:8080" 2009-05-03T05:17:30 is that recipie for segfault 2009-05-03T05:17:33 at the port? 2009-05-03T05:18:01 yep 2009-05-03T05:18:06 try 08080 2009-05-03T05:19:13 nope, still crashed 2009-05-03T05:19:41 my VM reboots if I send "connect " 2009-05-03T05:21:33 *** synchris_ has joined #glendix 2009-05-03T05:22:27 try putting more printks in to isolate the line of code? 2009-05-03T05:22:54 but it does not segfault, it just reboots 2009-05-03T05:23:23 i have no experience with VMs. 2009-05-03T05:23:44 jrm8005, is there a better way to copy from string until a delimiter? 2009-05-03T05:24:40 this is a simple string processing problem I am stuck with... I have "connect www.google.com:80" 2009-05-03T05:24:52 how do I get the url and the port out? 2009-05-03T05:25:04 what youre doing seems fine. 2009-05-03T05:25:15 extract the code and make a userspace program out of it. 2009-05-03T05:25:19 debug it that way. 2009-05-03T05:25:26 hmm 2009-05-03T05:27:05 and you said "00080" because of my port[4] = '\0' ?? 2009-05-03T05:27:27 well, you strncp 5 elements... oh wait. 2009-05-03T05:27:49 hm. 2009-05-03T05:27:57 yeah, you're not going to want to do it like that. 2009-05-03T05:28:09 because you'll have up to 5 digits. 2009-05-03T05:28:22 I know, tell me a better way, can I do sizeof(tmp) 2009-05-03T05:28:23 you might have to copy the port like you do the hostname. 2009-05-03T05:28:30 looking for \0 2009-05-03T05:28:45 which I am not sure exists in tmp 2009-05-03T05:28:50 well, sizeof is ok, but this is small 2009-05-03T05:29:03 actually, shouldn't tmp be null terminated? 2009-05-03T05:29:15 it should but I am not sure 2009-05-03T05:29:16 I guess if it isn't, you shoudl use sizeof. 2009-05-03T05:29:30 but I really think you should write the algorithm in userspace and fully debug it. 2009-05-03T05:29:52 sure, not a bad idea 2009-05-03T05:30:00 ok, let me work this out 2009-05-03T05:31:27 I am first testing by commenting out the port part completely 2009-05-03T05:31:32 just get the url out 2009-05-03T05:31:37 printk it 2009-05-03T05:31:47 ok, laters... 2009-05-03T05:31:51 kk 2009-05-03T05:31:55 have fun, and good hunting 2009-05-03T05:31:56 thanks for the pointers 2009-05-03T05:36:06 *** synchris has quit IRC 2009-05-03T07:49:39 *** jrm8005 has quit IRC 2009-05-03T10:44:59 *** Murmuria has quit IRC 2009-05-03T18:02:25 *** jrm8005 has joined #glendix 2009-05-03T18:21:35 *** chiky_cin has joined #glendix 2009-05-03T18:48:15 *** Murmuria has joined #glendix 2009-05-03T19:43:15 jrm8005, I have trouble with sock->ops->connect 2009-05-03T19:43:46 would you be able to help in regard to this? 2009-05-03T19:49:20 let's see the code 2009-05-03T19:49:52 I just hg-updates 2009-05-03T19:49:59 updated* what should I look at? 2009-05-03T19:50:36 jrm8005, http://pastebin.com/d70968036 2009-05-03T19:50:37 Title: C pastebin - collaborative debugging tool (at pastebin.com) 2009-05-03T19:50:50 the code on repo works perfectly 2009-05-03T19:51:06 I added socknet_connect and kernel crashes 2009-05-03T19:51:52 I am doing it like ksocket, but they dont have a client side example, they only implemented a server side example usage 2009-05-03T19:52:06 hm, are you sure that dir->d_inode->i_private is really a socket? 2009-05-03T19:52:30 should be, no error with sock_create 2009-05-03T19:54:04 the code on pastebin executes without error, but when I uncomment that one socknet_connect line, kernel crashes 2009-05-03T19:54:25 I cant even test this in userspace now... 2009-05-03T19:56:42 Murmuria: I don't know. 2009-05-03T19:57:19 thought so :-( Any documentation I can find on how to set the adr? 2009-05-03T19:57:33 look at the ksocket stuff? 2009-05-03T19:57:36 linux forums are often unreliable 2009-05-03T19:57:47 they dont need to do it like this 2009-05-03T19:57:57 the server is setting it up like a listener 2009-05-03T19:58:10 I am writing a client that connects to a server 2009-05-03T19:58:13 hm, try looking in lxr for uses of sockaddr_in 2009-05-03T19:58:34 I see 2009-05-03T19:58:46 * Murmuria goes fishing 2009-05-03T20:17:22 *** chiky_cin has quit IRC 2009-05-03T20:57:26 *** ChanServ has quit IRC 2009-05-03T21:01:58 *** ChanServ has joined #glendix 2009-05-03T21:01:58 *** irc.freenode.net sets mode: +o ChanServ 2009-05-03T21:08:39 *** chiky_cin has joined #glendix 2009-05-03T21:09:48 *** chiky_cin has quit IRC 2009-05-03T21:17:34 *** chiky_cin has joined #glendix 2009-05-03T21:17:49 *** chiky_cin has left #glendix