Menu

Strange error

2018-09-05
2018-10-02
  • E.Naumovich

    E.Naumovich - 2018-09-05

    Hi,
    after migration to v.030 I found that debug version produce assertion error like this:

    Assertion failed!
    
    Program: D:\mingw\projects\******.exe
    File: c:/mingw32/user/include/simplexlsx_last/XMLWriter.hpp, Line 304
    
    Expression: m_LightTagCounter == 0
    
    Process returned 3 (0x3)   execution time : 19.114 s
    Press any key to continue.
    

    while with v029 everything was fine.
    Just in case for all cells I also did like this:

    CellDataStr wsStr;
     wsStr.style_id = 0;
     CellDataDbl wsDbl;
     wsDbl.style_id = 0;
     CellDataInt wsInt;
     wsInt.style_id = 0;
    

    but it not help. Any idea?
    Regards, EN.

     

    Last edit: E.Naumovich 2018-09-05
  • Alexandr Belyak

    Alexandr Belyak - 2018-09-05

    Hi,
    This assertion error should occur when the XML-file is incorrectly created.
    It's very strange that you do not get this assertion error with v029.
    Difference between v029 and v030 only in line 816 of SimpleXlsxDef.h.

    Is this problem stable?
    Can you run your debug version under the debugger and see the stack of function calls before the assertion error?

     
  • E.Naumovich

    E.Naumovich - 2018-09-05

    I`ll try tomorrow.
    More strange that in "release" version nothing bad happens and Excel opens generated file.

     
  • E.Naumovich

    E.Naumovich - 2018-09-06

    OK, I found issue: "debug" version of main cannot be mixed with "release" library: in such case case varible m_LightTagCounter may be not initialized. And in general instances of the "XMLWriter" are not properly initialized. However, i wander if functions

    inline void DebugCheck****
    

    can be organized in diffferent manner. Now they just trap errors, but not provide proper line number.

     

    Last edit: E.Naumovich 2018-09-06
  • E.Naumovich

    E.Naumovich - 2018-09-07

    Hi ,
    I made a correction for XMLWriter.hpp to avoid conflicts between release and debug code. to produce more useful assert output. My version is attached.

     

    Last edit: E.Naumovich 2018-09-08
  • Alexandr Belyak

    Alexandr Belyak - 2018-09-09

    Hi,
    Sorry for the long response and thank you for research of the problem and its possible solution.
    I believe that the problem is due to the inclusion of the file "XMLWriter.hpp" in Worksheet.h, which is accessible from the main application.
    The XMLWriter has a different internal structure between "debug" and "release" modes (see definition of m_LightTagCounter).
    To avoid conflicts between "release" and "debug" modes I changed "Worksheet.h" and "Worksheet.cpp", please see attachment.

     
  • E.Naumovich

    E.Naumovich - 2018-09-24

    Hi,
    now it exit through assert in both cases: debug and release with NDEBUG.
    I used my version of the header. I not found "NDEBUD" switch in Worksheet. * files.

     
  • Alexandr Belyak

    Alexandr Belyak - 2018-09-24

    Hi,
    Hmm, a strange situation. Can you provide a minimal working project with this error?

    I was talking about the "NDEBUD" switch in the file "XMLWriter.hpp" which was included in "Worksheet.h". Because of this XMLWriter class could have a different internal structure in object file of the library and in the main application.

    I'll try to explain by example. See the source code for version 0.30 of the library.
    We compile the library in release with NDEBUG. The XMLWriter class will not contain m_LightTagCounter (because NDEBUG).
    We compile the main application in debug. The compiler has access to XMLWriter via "Worksheet.h". And in this case the compiler find that XMLWriter class contain m_LightTagCounter (because "debug").
    All methods from "Worksheet.h" that uses m_XMLWriter will use missing m_LightTagCounter (because library compiled with NDEBUG). This is an undefined behavior.

    For this reason, I changed code in "Worksheet.h" and "Worksheet.cpp".

     
  • E.Naumovich

    E.Naumovich - 2018-09-24

    Hi,
    Now I'm out of office until the end of the week. As soon as I can I'll make test project.

     
  • E.Naumovich

    E.Naumovich - 2018-10-01

    Hi,
    after I rebuilt evertything carefully with your new "Worksheet.h" and "Worksheet.cpp" problems dissapeared. Likely I had mixed obj files,
    Thank you,
    E.N.

     
  • Alexandr Belyak

    Alexandr Belyak - 2018-10-02

    Hi,
    thanks for testing and good news. I really appreciate your help in the development of the project.

    Best regards,
    Alexander

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.