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

Bug in rev.180: Hangs due to an unmatched parenthese

 
Post new topic   Reply to topic     Forum Index -> Poseidon
View previous topic :: View next topic  
Author Message
John Kiro



Joined: 18 Nov 2006
Posts: 18

PostPosted: Sat Nov 25, 2006 5:08 am    Post subject: Bug in rev.180: Hangs due to an unmatched parenthese Reply with quote

Hello

The following line in the attached source file causes Poseidon rev.180 to hang (seems like an infinite loop):

Code:

return (cast(CMDIView)GetWindowLong(GetActiveChild(),0);



- Problem is gone if I remove the leftmost parenthese, which is unmatched.
- The bug doesn't exist in version 0.21
- It occurs only when I open the project. But if the project is already open, then adding such statement causes no problem.

(last line in source code below)

Regards
John

Code:

import std.stdio;

class Point {

private {
   int m_x;
   int m_y;
}

   void MovePoint(int x, int y)
   {
      m_x+=x;
      m_y+=y;
   }
   this(int x, int y)
   {
      m_x = x;
      m_y = y;
   }

};

void main()
{
   writefln("Hello World of D language");
   Point p1=new Point(3,4);
   writefln("First point coordinates is (?d,?d)",p1.m_x,p1.m_y);
   Point p2=new Point(1,2);
   writefln("Second point coordinates is (?d,?d)",p2.m_x,p2.m_y);
   p1.MovePoint(6,7);
   writefln("First point coordinates, after being moved, is (?d,?d)",p1.m_x,p1.m_y);

   Point[10] arrPts;      //array of 10 points

   foreach(Point p; arrPts)
   {
      p=new Point(4,4);
      writefln("Initial Point values are (?d,?d)",p.m_x,p.m_y);
      p.m_x=1;
      p.m_y=2;
      writefln("Current Point values are (?d,?d)",p.m_x,p.m_y);
   }
   return (cast(CMDIView)GetWindowLong(GetActiveChild(),0);

}
Back to top
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Sun Nov 26, 2006 11:47 am    Post subject: Re: Bug in rev.180: Hangs due to an unmatched parenthese Reply with quote

Quote:
- Problem is gone if I remove the leftmost parenthese, which is unmatched.

Unmatch parenthesis should throw an exception. please check this message: http://www.dsource.org/forums/viewtopic.php?t=2035.

Quote:
- It occurs only when I open the project. But if the project is already open, then adding such statement causes no problem.

At this time, Poseidon doesn't dynamic parse the code, it parse code when load the project or save file(s).


I've tried to fix this bug by modified tokenScanner.d, please check it Very Happy
Back to top
View user's profile Send private message Send e-mail
John Kiro



Joined: 18 Nov 2006
Posts: 18

PostPosted: Sun Nov 26, 2006 1:24 pm    Post subject: Reply with quote

It's OK now Smile

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



Joined: 18 Nov 2006
Posts: 18

PostPosted: Sun Nov 26, 2006 4:13 pm    Post subject: Reply with quote

Hi Again

Another bug is that frequently, an access violation exception is thrown while I'm trying to type text.

Example:

This code is OK:

Code:

long w=5;


But if I try to type it as:

Code:

long wz=57;


Then I have the exception (as if a problem sometimes occurs when some tokens have multi characters).

Regards
John
Back to top
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Mon Nov 27, 2006 8:47 am    Post subject: Reply with quote

Umm......it seems OK to me, I need more information to fix the bug Embarassed
Back to top
View user's profile Send private message Send e-mail
John Kiro



Joined: 18 Nov 2006
Posts: 18

PostPosted: Fri Jan 05, 2007 7:04 am    Post subject: Reply with quote

Hi Kuan Hsu

In order to reproduce the bug, just open a project, play with it for sometime, and try to insert some text inside a line. You may succeed to catch it Wink
I still don't have a specific case in which the access violation starts to occur.. Sorry..

Regards
Back to top
View user's profile Send private message
Kuan Hsu



Joined: 15 Apr 2006
Posts: 143
Location: Taiwan

PostPosted: Sun Jan 07, 2007 10:22 pm    Post subject: Reply with quote

Hmm.....when except access violation, is it occur continuously?

If yes, try to save the file( reset the parser ), if the error turn to be disappear, maybe I know the bug where is......
Back to top
View user's profile Send private message Send e-mail
John Kiro



Joined: 18 Nov 2006
Posts: 18

PostPosted: Mon Jan 08, 2007 2:40 pm    Post subject: Reply with quote

Hi Kuan

I guess it happens after I build a project, that generates some compilation errors (not sure).

What happens is that when I type 1 char it's OK, when I type another one, I get the "access violation" msg box. The char is added, but I get the msg box every pair of chars. I think that it doesn't occur with some chars (may be the '=' or the ')').

The problem disapears only after close/open the whole project.

hope this helps Wink
Try to experiment with a project having several errors (syntax errors,...)

Regards
John
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Poseidon All times are GMT - 6 Hours
Page 1 of 1

 
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