FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Linux Linking issues
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic     Forum Index -> Mango
View previous topic :: View next topic  
Author Message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Apr 11, 2004 5:14 pm    Post subject: Reply with quote

You might also try reducing the number of worker threads from 20 to 1, at line 963 in unittest.d.

If testHttpServer() subsequently executes cleanly, it tells us something quite significant.
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Sun Apr 11, 2004 5:44 pm    Post subject: Reply with quote

I haven't been able to run this successfully with any more than 1 thread. And I had to be root, and it only worked once. This one time working, I hit enter, and it ran for a bit, and just hung there. Ctrl-C didn't stop it, and I closed my shell window. The processes could not be killed and it took a reboot. After the reboot, I don't see the pid's in ps -ef | grep dsc, but I also can't run DSC at all. Not as root, not as me. The error is always Unable to bind socket.

I'll watch the forum tonight, but for now, I think I'll work on the project pages for dsource. I have a feeling Kris may be able to post something to SVN, and if it's a good idea, we could put a Beta .zip file on the downloads page.
_________________
I really like the vest!
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Apr 11, 2004 5:55 pm    Post subject: Reply with quote

I've gotta' go out for a few hours, but I'll check in later.

- Kris
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 6:25 pm    Post subject: Reply with quote

I don't experience the issues that Brad is having. I'm using Gentoo Linux with kernel 2.6 with the "native POSIX thread library." (an adaption for glibc that's supposed to improve linux thread performance).

When I lowered the number of threads to 1 in unittest, the only difference seems to be that I don't get core dumps. I still get the repeated message: "Socket accept() failed" though. Nothing else.... that is unless I try to restart "dsctest" to promptly in which case I get "Unable to bind socket" (which you explained already).

Got to go to work. I'll finish covering this later.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 8:01 pm    Post subject: Reply with quote

What's the difference between memcmp and memicmp such that it affects the operation of this library?
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Sun Apr 11, 2004 8:04 pm    Post subject: Reply with quote

I know that it compares two blocks of memory to see if they're similar, and that memicmp is case-insensitive, but I don't know why it caused a problem with these libs.

BTW, I am also running Gentoo with a 2.6 kernel, but I haven't compiled NPTL in yet. It has given us great performance at work on our Tomcat application servers, so I guess I should do it on my laptop here.
_________________
I really like the vest!
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 8:17 pm    Post subject: Reply with quote

Yeah... I kind of jumped the gun and figured out the difference after I posted. Smile I'm thinking there should be a way to get it working. I'm just not so sure how currently.

NPTL seems acceptably stable. I know it works flawlessly for the most part; so far, I've run into just one tool that doesn't tolerate the changeover. But it was one that I could do without. It's probably fixed by now anyway.

That's one problem with Gentoo Linux: I get a greedy streak that causes me to try to compile tons of gadgetry from the portage tree, whether I need the tools or not. Smile

Later,

John
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 9:05 pm    Post subject: Reply with quote

Regarding memicmp(). I've searched the libc.a file archive

ar -t libc.a | grep "memicmp"

and apparently it just doesn't exist on the Linux systems. I find this strange, and I'm interested to know if there is some replacement. But I guess we knew this already; I just had to make double sure. Smile
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 9:15 pm    Post subject: Reply with quote

Just curious, but why doesn't a string compare function work in this spot.

Because I can certainly find a function that fits the bill for strings similar to what memicmp does in the generalized sense. Doesn't the string compare achieve the same thing?

int strncasecmp( const char* s1, const char* s2, size_t n ) ;

is available on Linux systems, it seems.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 9:36 pm    Post subject: Reply with quote

Sorry if I keep rambling on....

I tested out the servlet unittest again, and it does seem to work fine. I pointed my brower at 127.0.0.1 and the servlet spat out a bunch of pertinent data to the console (of course,, it is still on the 1 thread setting). It just seems to be the Http Server test that doesn't work properly as I showed above.

By the way, I don't know if this could hurt anything, but I did compile the "strncasecmp()" function into the TokenStack in place of the memicmp():

extern (C) int strncasecmp (char *, char*, uint); // added lin 48

and...

return strncasecmp (cast(char *)target, cast(char *)match, length) == 0;

in method isMatch of same file.

Casting the D strings to (char *) without terminating with a zero seems safe here because Kris already tests the lengths of the strings prior to calling the function. Do you think there is anything wrong with this? Anyway it seems to work fine (well it compiles/links/runs fine so far).
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 9:54 pm    Post subject: Reply with quote

Starting to test other unittests on Linux:

-- testFileSize() : works!

-- testFilePath(): --------> seg faults/core dump

But I see that DOS type path designation in the sample seems to be used...."c:\1\2\3\4\abc.foo.bar"

-- testFileList(): --------> exception: Error: AssertError Failure dsc/io/FileProxy.d(479)

Ah... but I see that FileProxy.toList() in version(linux) is commented out and ended with an "assert(0);"

So these errors are really not significant. I'll continue on more unittests later.
Back to top
View user's profile Send private message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 11, 2004 11:37 pm    Post subject: Reply with quote

Linux dsc unttests continued:

-- testToken1 : works!

-- testColumn : -----> ouputs: 1 20 test
then: segmentation fault (core dumped)

-- testSocket : works! downloads/displays html from walter's site

-- testStdin : works!

-- testBuffer : works!

-- testToken3: -----> no output to console? (just "done")

-- testFileRegex : seems to work!

-- testLineRegex : seems to work!

-- testSocketRegex : seems to work!

-- testRandomAccess : works!

-- testCompositeIO : works!

-- testDirectIO : works!

-- testHttpServer : -----> not working as described in previous posts

-- testServerEngine : seems to work! as described in previous posts

-- testUri : -----> ArrayBoundsError Uri (513)

Actually, I should also be running these tests in Windows too. I'll continue on that later.
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Mon Apr 12, 2004 1:38 am    Post subject: Reply with quote

JJR wrote:
-- testColumn : -----> ouputs: 1 20 test
then: segmentation fault (core dumped)

That's one of the Interface-related bug. Fixed in DMD v0.83

JJR wrote:
-- testUri : -----> ArrayBoundsError Uri (513)

That's a weird one. Should have broken on Win32 also ... I'll check into it when I get home tonight
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Mon Apr 12, 2004 3:44 am    Post subject: Reply with quote

JJR wrote:
-- testFilePath(): --------> seg faults/core dump

But I see that DOS type path designation in the sample seems to be used...."c:\1\2\3\4\abc.foo.bar"


Ahh ... a problem in the test case itself (not checking whether there actually was a parent before printing the output). I'll strengthen that up for next go around, but meantime you might change unittest.d line 776 to this instead:

Code:
Stdout << path << Stdout.newline;
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Mon Apr 12, 2004 3:56 am    Post subject: Reply with quote

JJR wrote:
-- testUri : -----> ArrayBoundsError Uri (513)


Sloppy stuff on my part: can you change line 513 in Uri.d to read
Code:
                // take a peek first, to see if there's work to do
                if (memchr (s, '?', s.length))


instead of
Code:
                // take a peek first, to see if there's work to do
                if (memchr (&s[0], '?', s.length))


Sorry about that ...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Mango All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group