Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

SyntaxEdit stack overflow

Hopefully you can reproduce this. I tried to compile the MegaDemo in C++Builder XE6, using the latest SyntaxEdit but got this error:
[bcc32 Error] d_Main.cpp(10): E2209 Unable to open include file 'DesignIntf.hpp'

When loading this file into the editor:
http://www.htmlvalidator.com/test/target.zip

I get a stack overflow: First chance exception at $009F6D3C. Exception class $C00000FD with message 'stack overflow at 0x009f6d3c'. Process cse.exe (15908)

:009f6d3c Lmdseddocument::_16582
:0099ec53 ; ExecPrim
:0099e3ee Lmdregexpr::TLMDRegExp::Exec + 0x2A
:00a0bc54 ; _16683
:00a0c0b3 ; _16685
:00a0a501 ; _16663
:00a0c4b8 Lmdsedparser::TLMDEditParser::GetParsedLine + 0x8
:009d3ca7 ; _16791
:009d452f ; _16801
:009d4645 ; _16804

Here is some of my code:
if ( (Edit) && (Document) ) {
TLMDViewSettings vs; vs=Edit->ViewSettings; // new 2009-06-17 - for new "precise scrollbars"
vs << vsPreciseScrollbars; // for debugging (added 2014-08-04)
Edit->BeginUpdate();
Edit->Document=NULL; // clear to help make sure the current document is not processed is changing to precise scrollbars
Edit->ViewSettings=vs; // change first - before setting document
Edit->Document=Document;
Edit->EndUpdate(); // stack overflow here
}
}

It happens on the EndUpdate() line above, with the target.html file I mentioned, and with vsPreciseScrollbars enabled. It doesn't happen if vsPreciseScrollbars is not enabled.

Can you reproduce and fix?

Thanks.

Comments

  • 12 Comments sorted by Votes Date Added
  • Actually, even if vsPreciseScrollbars is not enabled, I can still get a stack overflow if I scroll down far enough.
  • edited August 2014 Posts: 192Vote Up0Vote Down
    Getting crashes in more files as well. Just got this:
    First chance exception at $00A0D226. Exception class $C00000FD with message 'stack overflow at 0x00a0d226'. Process cse.exe (11048)

    :00a0d226 Lmdsedutils::TLMDCharSeq::GetChar + 0xA
    :0099ed47 ; ExecPrim
    :0099e4e2 Lmdregexpr::TLMDRegExp::Exec + 0x2A
    :00a0bd48 ; _16683
    :00a0c1a7 ; _16685
    :00a0a5f5 ; _16663
    :00a0c5ac Lmdsedparser::TLMDEditParser::GetParsedLine + 0x8
    :009d3d9b ; _16791
    :009d4469 ; _16798
    :009d42e9 Lmdsedview::_16795 + 0x15

    Seems to be caused by one of these lines:
      Edit->EnsureOffsetIsVisible(goodoffset);
      Edit->CursorOffset=goodoffset;

    Please... this is a serious problem for me... can you look into it and see if you can reproduce it using the example file I linked to in the first post?

    And here is another file that causes the issue mentioned in this post:
  • Hi,

    I'm currently looking....
  • Thanks. Were you able to reproduce the problem?
  • Yes, I can reproduce stack overflow, just by scroliing your document or by doing SelectAll (Ctrl+A) action.
  • Hi again, 

    So, I've found the issue. Its in the very long **string literal**, contained in the test file. Search for the following string:

    if('Template Instance Id =1524001,Jsp=Template_Home5.jsp....

    The actual problem here is that the stack size is just insufficient. So, a simple workaround is to increase application's stack size (in project's options).

    I think currently what also can be done. Probably I will remove all local variables from the problematic recursive method (which is TLMDRegExp.MatchPrim), replacing tham with a heap allocated data.
  • Great! I'm glad you found the problem. When will the version with the "heap fix" be available? That seems to be the superior solution.

    Thanks,
    Albert

  • edited August 2014 Posts: 192Vote Up0Vote Down
    I could really use a fix for this. My program crashing with a stack overflow is not acceptable.

    I tried quadrupled the maximum stack size to 4MB and that didn't work. I doubled that and even that was not enough. It did work at 40MB but that's like 40 times the default max stack size.

    Can you fix this so that an "insane" stack size is not needed?
  • >>Can you fix this so that an "insane" stack size is not needed?<<
    Release 2014.5 is available since 12-Aug-2014, see announcement in this forum.
  • edited August 2014 Posts: 192Vote Up0Vote Down
    Fantastic... going to install it now. I was expecting to get an email about the update but I guess you didn't send one or haven't sent it yet.

    UPDATE: Still getting a stack overflow. :(
  • edited August 2014 Posts: 192Vote Up0Vote Down
    I just updated and the good news is that the file in the target.zip does not crash anymore, but the file in the sitepoint.zip still causes a stack overflow.

    Perhaps there is another issue that needs a fix.

    Can you reproduce the stack overflow with the sitepoint.zip file?
Sign In or Register to comment.