wilzbach / tools-test

1 stars 0 forks source link

Optlink crashes when debug info is enabled #78

Closed wilzbach closed 7 years ago

wilzbach commented 12 years ago

Note: the issue was created automatically migrated from https://issues.dlang.org

Original bug ID: BZ#8222 From: Rene Zwanenburg <renezwanenburg@gmail.com> Reported version: D2 CC: bugzilla@digitalmars.com, verylonglogin.reg@gmail.com, yebblies@gmail.com

Duplicates: BZ#6144

wilzbach commented 12 years ago

Comment author: Rene Zwanenburg <renezwanenburg@gmail.com>

I've been struggling with an Optlink crash for the last two weeks now. There's no clear offending code, it just 'sometimes happens' when hitting the build key. The crash is consistent, so when I try to recompile the exact same code Optlink will crash every time. After making some minor changes the problem will usually go away. However, at the moment I can't find a way to work around it.

The project is medium sized, 66 modules, and I have no idea how to isolate a small piece of code to reproduce the error. Like I said above, the error comes up when working on completely different parts of the code.

So far the crash only occurs when debug info has been generated, so the problem appears to be related to the presence of debug info. There's no difference between -g and -gc.

The error message I get is:

Unexpected OPTLINK Termination at EIP=00428DA3 EAX=00000240 EBX=00000541 ECX=0043F7B4 EDX=00000240 ESI=02B23DC0 EDI=0043FD44 EBP=0018FF04 ESP=0018FEF8 First=00402000

I'm not sure if the message is the same with different code. I tried to get it to fail with modified code, but you know how it works: when you try to make something fail...

I know it's not much to go on. If I should provide any additional information please let me know.

wilzbach commented 12 years ago

Comment author: Rene Zwanenburg <renezwanenburg@gmail.com>

Today I finally managed to work around the issue. The offending line was:

auto list = _messageListeners.get(listener.type, new MessageListener[0]);

But the module containing that code hasn't been touched in months. The workaround was as easy as replacing it with:

auto listPtr = listener.type in _messageListeners; auto list = listPtr ? *listPtr : new MessageListener;

I still haven't been able to get a similar crash with a reduced code base. I'll document any future problems and their workarounds here to see if there's a pattern.

wilzbach commented 11 years ago

Comment author: yebblies <yebblies@gmail.com>

Could you provide the object files to reproduce this crash? Otherwise it's probably impossible to reproduce.

wilzbach commented 11 years ago

Comment author: Denis Shelomovskii <verylonglogin.reg@gmail.com>

Could you provide the object files to reproduce this crash? Otherwise it's probably impossible to reproduce.

A testcase is attached to Issue 7139 which is also a duplicate of Issue 6144.

This issue has been marked as a duplicate of issue 6144