Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 6th, 2008, 4:16 PM   #1
Xyhm
Programmer
 
Xyhm's Avatar
 
Join Date: Mar 2006
Posts: 60
Rep Power: 3 Xyhm is on a distinguished road
my program keeps crashing

I've developed a program that communicates with another program through anonymous pipes set up by the other program (not written by me).

The problem is that my program keeps crashing as soon as I add something more than just receiving the info. For example, if I add a simple "showMessage", it crashes, but works again if I remove it.

Here is the code:

procedure TArena.read_winboard; 
var text:string[50];
    ch:char;
begin
   while true do
   begin
      text:='';
      repeat
         read(input,ch);
         text:=text+ch;
      until ch=#10;

      //showMessage('this instruction makes the program crash');

      form1.memo1.Lines.Add(text);
 
   end;
end;

Obviously the showMessage-instruction is just an example. If I try to do any parsing of the incoming text (for example sending it to a parser-function of some sort), it crashes. But the code above, devoid of anything extra, doesn't crash, and I can tell by the ouput in the memo that everything is received as expected (and sending info the other way works as well; code not included). So the communication is working.

I hear that buffering can cause problem (even crashing?). Is the input used by that read function using a buffer? And is it that function a real systems call or a part of Delphi (internally doing the systems call)?

I'm really confused right now, and frustrated. I want to start implementing the protocol, but that's hard when not being able to parse the incoming text. Boo hoo.
Xyhm is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
hello, I'd like to write a program for my work. blake_jl Community Introductions 13 Nov 23rd, 2007 4:31 PM
Language display in program Prm753 C++ 3 May 30th, 2006 5:45 PM
Help me program this with Watcom! DBZ Other Programming Languages 3 Feb 26th, 2006 9:41 PM
Creating a program to test a program sixstringartist C 8 Jan 21st, 2006 1:15 PM
airport Log program using 3D linked List : problem reading from file gemini_shooter C++ 0 Mar 2nd, 2005 4:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:05 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC