User Tag List

Results 1 to 9 of 9

Thread: Parser: Lexical Errors May Cause Crash

  1. #1
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,760
    Level
    21
    vBActivity - Bars
    Lv. Percent
    68.7%

    Sick Bug Parser: Lexical Errors May Cause Crash

    Moosh reported this to me yesterday:

    If a script contains a lexical error (tested with CHAR_DOUBLEQUOTE) and the script is over a certain length (greater than 16.4 KB), ZC will crash while parsing it.

    I've tested this, and can confirm it. The easiest fix would possibly be to halt the compiler on a lexical error, which I think would be best in general; but finding the cause of this would probably be good.

    Affects 2.50.2; tested with Win 7.

  2. #2
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    Wait? ZC Doesn't parse scripts, Do you mean ZQuest?

  3. #3
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,815
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,933
    Level
    33
    vBActivity - Bars
    Lv. Percent
    23.44%
    I've never been able to reproduce any of these compiler crashes over the years.

    Can you try running it in the debugger next time you test it?
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  4. #4
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    Me neither, it's quite weird. I do get lexical errors from double quotes some times though. "Which you shouldn't it parses as an array of shorts if you set it up as such"

  5. #5
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,760
    Level
    21
    vBActivity - Bars
    Lv. Percent
    68.7%
    I'm going to force a compiler halt for lexical errors. That's the only easy solution, and IMO no lexing error should be suppressed, except truncation; as Joe user won't even notice them in their rush to compile.

    I could just add SINGLEQUOTE as a halt though, or better still, make ' return the same as DOUBLEQUOTE so that we can just use the char to input QUOTEDSTRINGS. (i.e. Both ' and " would be read the same way.)

    @Tamamo : Aye, I meant ZQuest.

  6. #6
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    Unfortunately the way it's set up now, single quotes are for characters I think, and double quotes for strings. At least I think that's it.

  7. #7
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    Has this only been confirmed with double quotation marks? That's the only thing I'm seeing a problem with. That would be from trying to read everything after it as a single string; it wouldn't even get as far as detecting an error.

    Edit: Nope, I'm wrong. It was crashing printing the error. Considering this fixed unless someone can confirm another cause.
    Last edited by Saffith; 07-13-2016 at 05:37 PM.

  8. #8
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,760
    Level
    21
    vBActivity - Bars
    Lv. Percent
    68.7%
    Quote Originally Posted by Saffith View Post
    Has this only been confirmed with double quotation marks? That's the only thing I'm seeing a problem with. That would be from trying to read everything after it as a single string; it wouldn't even get as far as detecting an error.

    Edit: Nope, I'm wrong. It was crashing printing the error. Considering this fixed unless someone can confirm another cause.
    Can you elaborate on the exact cause of this, please, and what you changed?


    Quote Originally Posted by Tamamo
    Unfortunately the way it's set up now, single quotes are for characters I think, and double quotes for strings. At least I think that's it.
    They return SINGLECHAR, so, I may as well leave them be, but making the compiler halt on lexing errors is just common sense.

  9. #9
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,430
    Level
    24
    vBActivity - Bars
    Lv. Percent
    69.57%
    sprintf overflow. The error message buffer only has room for 511 characters.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social