Max

I think replacing the line AsioClient:48:

*m_input_buffer = '\0';

with

memset(m_input_buffer, '\0', INPUT_BUFFER_SIZE);

might fix your segfault. Let me know if it works.


Thanks
Naveen

On Tue, Jun 22, 2010 at 7:24 PM, Max Bossino <m...@miragroupware.org> wrote:

> Hi Naveen,
>
> On 23 Jun 2010, at 00:03, naveen akarapu wrote:
>
> > It could be because of the absence of an '\0' at the end of the string
> returned by front(). Because it's not segfaulting for me, I will run the
> code in gdb and look for anything suspicious.
>
> Thank you for the help!
>
> > Just to confirm that this is the problem, can you try commenting out this
> part of the code in your copy and run. It should segfault again where this
> variable is used.
>
> I commented out the line you suggested and compiled Mira Client again.
>
> I then followed the same usage procedure. This time, when running Mira
> Client as a standalone application, it exited with a 'Segmentation fault'
> after logging in, as before. However, when I tried running it in GDB, it did
> not Segfault - it logged in without a problem.
>
> So, I decided to try something else, as well. The other reference I found
> to front() in that file was on line 253, so I replaced that line with:
>
> // ------
> cout << "line 253" << endl;
> Msg::Parse( m_message_queue.front() );
> cout << "line 255" << endl;
> // ------
>
> When I recompiled and ran Mira Client, this is the output I got after
> logging in:
>
> ------
> $ ./mira_client
> FilesUtility Loaded
> 127.0.0.1
> adding to buffer...
> bytes_transferred: 3
> line 253
> Segmentation fault
> ------
>
> So it seems that you are right! The problem is with that line of output.
>
> Funnily enough, I only got the Segfault shown above when I tested the log
> in for a second time with my modified Mira Client... The first time I tried
> it, even though Mira Client wasn't running in GDB, it didn't Segfault. Just
> thought it might be worth pointing out, but obviously this bug is
> temperamental, somehow!
>
> For the record: I am running Ubuntu 9.10 with CMake 2.8.0, Qt 4.6.1 and
> Boost 0.42.
>
> Regards,
>
> Max Bossino
> Project Manager
> http://miragroupware.org
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Mira-development mailing list
> Mira-development@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mira-development
>
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Mira-development mailing list
Mira-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mira-development

Reply via email to