PDA

View Full Version : Long function names cause data corruption


Jokkey
14-Jan-2010, 06:58 PM
If the call stack contains a call to a function with a very long name, it apparently overflows some internal data structure within EurekaLog. As a result:


If I click the "click here to see details" link before sending the error report, gibberish characters appear in the call stack where the very long name should be.
The error log that's sent to the developer is truncated at that point where the very long name occurs.
As a result, after importing the error log into the EurekaLog Viewer, the Call Stack, Modules, Processes, Assembler, and CPU tabs for that entry are all empty.

The function name limit seems to be somewhere around 130 characters. Because we're using C++ and are making moderately heavy use of templates, it's not unusual for template-instantiated C++-mangled function names to be 200 characters long or longer. (For example, I first saw this problem with a function template called ShowNewModal, but after instantiation and overloading and mangling, its name is @%ShowNewModal$11TReportForm14MachineStoragep16glo bal_variablesp11engine_infop17wglobal_variablesp12 TMachineForm%$qrx14MachineStoragerxp16global_varia blesrxp11engine_inforxp17wglobal_variablesrxp12TMa chineForm$i.)

This is in C++Builder 2009 with EurekaLog 6.0.22 Professional.

Alex
15-Jan-2010, 06:06 AM
Hi,

We were able to identify and fix this issue. There should be a new RC version soon. I'll drop here a note, when it'll be available.

Unfortunately, EurekaLog uses ShortString to store debug information. I believe that this is done to avoid dynamic allocation. Even more: it uses high-order bit as special flag. So, all idents are limited to 127 characters max. Idents, which are longer than 127 characters, will be truncated (in fixed version, right now they produce garbage).

I think that EurekaLog v7 will not have this limitation.

Jokkey
15-Jan-2010, 12:28 PM
Thanks for the quick reply.

Truncation is fine for our purposes; the beginning of the (C++ mangled) function name plus the line number is plenty of information to find the problem.

Alex
15-Jan-2010, 05:08 PM
Hi,

The new RC is available for download from our area for registered customers: https://www.eurekalog.com/login.php

Can you download, install it and check if your issue was solved?

Jokkey
18-Jan-2010, 01:36 PM
This fixes the issue. Thanks.

However, after installing the RC, I am getting the following error when I start RAD Studio 2009:

Cannot load package 'CExceptionExpert12.' It contains unit 'ETypes,' which is also contained in package 'ExceptionExpert12'.
Do you want to attempt to load this package the next time a project is loaded?


This message appears to be harmless (EurekaLog still works), and it may just be a problem with the test machine I was using. (I didn't try installing the RC on my primary development machine.)

Alex
18-Jan-2010, 05:07 PM
Hi,

Thanks for the feedback.

Cannot load package 'CExceptionExpert12.' It contains unit 'ETypes,' which is also contained in package 'ExceptionExpert12'.
It appears to be mixed installations. Looks like one installation installed expert for C++ Builder only and the second one installed expert for Delphi/RAD (Delphi + Builder).
I recommend to reinstall EurekaLog by following these guidelines: http://blog.eurekalog.com/reinstallation-of-eurekalog/

You can also try to solve this issue manually: check your package settings (Component/Install Packages). Remove all EurekaLog's packages and add only 1 package (ExceptionExpert12.bpl).

Jokkey
18-Jan-2010, 05:55 PM
It appears to be mixed installations. Looks like one installation installed expert for C++ Builder only and the second one installed expert for Delphi/RAD (Delphi + Builder).
I recommend to reinstall EurekaLog by following these guidelines: http://blog.eurekalog.com/reinstallation-of-eurekalog/

You can also try to solve this issue manually: check your package settings (Component/Install Packages). Remove all EurekaLog's packages and add only 1 package (ExceptionExpert12.bpl).

Thanks for the help. Since I'm only having this problem on my test machine, for now, I'll wait and see if it becomes an issue on my primary development machine.

Alex
19-Jan-2010, 05:57 AM
Hi,

You're welcome ;)