Search the web
Sign In
New User? Sign Up
ftpbench · To develop an open-source FTP benchmark application,
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
uninitialized variable reference in Poller_poll.cc   Message List  
Reply | Forward Message #244 of 282 |

I and Vasan Sundar recently ported Poller_poll.cc to c,
and I'm using it in a fun little load test app at work.
While debugging that app, I happened to run valgrind on it,
and valgrind found an uninitialized memory bug in Poller_poll.c.
Here's the fix; the corresponding fix to the C++ version is identical.

(I'm starting to really like Valgrind... it's in debian testing,
so all I had to do to get it was 'apt-get install valgrind',
but it's a real easy compile and install from source, too.
It's at http://developer.kde.org/~sewardj/ )

--- ../se4/Poller_poll.c Fri Sep 27 15:36:17 2002
+++ Poller_poll.c Thu Oct 3 11:54:17 2002
@@ -29,6 +29,7 @@

int Poller_poll_init(Poller_poll *pp)
{
+ int i;
DPRINT(("init()\n"));

// Allocate things indexed by file descriptor.
@@ -37,6 +38,9 @@
pp->m_fd2pfdnum = (int *)malloc(sizeof(int) *
pp->m_fd2client_alloc);
if (!pp->m_fd2pfdnum)
return ENOMEM;
+ // Clear new elements
+ for (i=0; i<pp->m_fd2client_alloc; i++)
+ pp->m_fd2pfdnum[i] = -1;

// Allocate things indexed by client number.
pp->m_pfds_used = 0;




Thu Oct 3, 2002 6:33 pm

dankegel
Offline Offline
Send Email Send Email

Forward
Message #244 of 282 |
Expand Messages Author Sort by Date

I and Vasan Sundar recently ported Poller_poll.cc to c, and I'm using it in a fun little load test app at work. While debugging that app, I happened to run...
dankegel
Offline Send Email
Oct 3, 2002
6:34 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help