Thread overview
Any way to workaround Optlink crash?
Aug 31, 2009
Denis Koroskin
Aug 31, 2009
Tom S
Sep 01, 2009
Max Samukha
Sep 01, 2009
Tom S
Sep 01, 2009
Max Samukha
Sep 01, 2009
Jérôme M. Berger
Sep 01, 2009
div0
Sep 02, 2009
Jérôme M. Berger
Sep 02, 2009
grauzone
Sep 02, 2009
Nick Sabalausky
August 31, 2009
I was refactoring the following line of code:

foo(rand() % 256); -> foo(0);

and that causes Optlink to crash now. Any reason why it does so?

That particular file is just 157 lines long, but the whole project is quite big, although there are no large files. The biggest one is ~140K, it's from win32 bindings project (only defines a bunch of constants, and does little impact on output file size), that I use for a few years now, and they never caused any problem to me. My files are 40K max.

I believe that line of code has no direct relation to Optlink crash, but I still post it just to show that it's code simplification that leads to crash, not adding any new type or symbol or anything.

Thanks for any hint.
August 31, 2009
Denis Koroskin wrote:
> I was refactoring the following line of code:
> 
> foo(rand() % 256); -> foo(0);
> 
> and that causes Optlink to crash now. Any reason why it does so? 
> 
> That particular file is just 157 lines long, but the whole project is quite big, although there are no large files. The biggest one is ~140K, it's from win32 bindings project (only defines a bunch of constants, and does little impact on output file size), that I use for a few years now, and they never caused any problem to me. My files are 40K max.
> 
> I believe that line of code has no direct relation to Optlink crash, but I still post it just to show that it's code simplification that leads to crash, not adding any new type or symbol or anything.
> 
> Thanks for any hint.

I guess this is just a random instance of OPTLINK's bug. I recommend sacrificing your firstborn.

Or if that doesn't work, change the order in which you pass modules to the compiler - certain symbols (template instantiations, initializers, classinfo, etc) will end up in different object files and that might hit OPTLINK's sweet spot.

And/or compile some modules without -g. Maybe you don't need debug symbols everywhere.


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode
September 01, 2009
Tom S wrote:
> 
> And/or compile some modules without -g. Maybe you don't need debug symbols everywhere.
> 
> 

And please vote for http://d.puremagic.com/issues/votes.cgi?action=show_bug&bug_id=424. Something makes Walter think this bug is not critical.
September 01, 2009
Max Samukha wrote:
> Tom S wrote:
>> And/or compile some modules without -g. Maybe you don't need debug
>> symbols everywhere.
>>
>>
> 
> And please vote for http://d.puremagic.com/issues/votes.cgi?action=show_bug&bug_id=424. Something makes Walter think this bug is not critical.

I think he knows... But it's a lot of work to write a new linker. COFF/ELF output would not be that bad though, at least if there's some linker that supports these *and* its license allows it to be bundled with DMD.


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode
September 01, 2009
Tom S wrote:

> Max Samukha wrote:
>> Tom S wrote:
>>> And/or compile some modules without -g. Maybe you don't need debug symbols everywhere.
>>>
>>>
>> 
>> And please vote for http://d.puremagic.com/issues/votes.cgi?action=show_bug&bug_id=424. Something makes Walter think this bug is not critical.
> 
> I think he knows... But it's a lot of work to write a new linker.

I am sure it is a lot of work for a single person to do. That's why it would be nice of Walter if he gave us a hint whether the bug is fixable at all and how high it is on his priority list.

> COFF/ELF output would not be that bad though, at least if there's some linker that supports these *and* its license allows it to be bundled with DMD.
> 
> 

I doubt such a linker exists. And if it does, I doubt it is of quality good enough to replace OPTLINK.

September 01, 2009
Max Samukha wrote:
> Tom S wrote:
>> Max Samukha wrote:
>> COFF/ELF output would not be that bad though, at least if there's some
>> linker that supports these *and* its license allows it to be bundled
>> with DMD.
>
> I doubt such a linker exists. And if it does, I doubt it is of quality good enough to replace OPTLINK.
> 
	GNU ld supports these formats on *nix, windows and MacOS. It has
very good quality and its license allows it to be bundled with
anything...

		Jerome
-- 
mailto:jeberger@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr



September 01, 2009
Jérôme M. Berger wrote:
> Max Samukha wrote:
>> Tom S wrote:
>>> Max Samukha wrote:
>>> COFF/ELF output would not be that bad though, at least if there's some
>>> linker that supports these *and* its license allows it to be bundled
>>> with DMD.
>>
>> I doubt such a linker exists. And if it does, I doubt it is of quality good enough to replace OPTLINK.
>>
>     GNU ld supports these formats on *nix, windows and MacOS. It has
> very good quality and its license allows it to be bundled with anything...
> 
>         Jerome

Yeah but have you actually linked a D program with it? (esp. on 'doze)

- --
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk
September 02, 2009
"Denis Koroskin" <2korden@gmail.com> wrote in message news:h7hbe8$1sni$1@digitalmars.com...
>I was refactoring the following line of code:
>
> foo(rand() % 256); -> foo(0);
>
> and that causes Optlink to crash now. Any reason why it does so?
>
> That particular file is just 157 lines long, but the whole project is quite big, although there are no large files. The biggest one is ~140K, it's from win32 bindings project (only defines a bunch of constants, and does little impact on output file size), that I use for a few years now, and they never caused any problem to me. My files are 40K max.
>
> I believe that line of code has no direct relation to Optlink crash, but I still post it just to show that it's code simplification that leads to crash, not adding any new type or symbol or anything.
>
> Thanks for any hint.

I don't mean to sound patronizing, but you did try clearing out all the object files and doing a clean build, right?

I only point it out because I've been bit a few times by an object file that got out of date but didn't get rebuilt (especially when using rebuild and switching to a different configuration, like debug vs release...and I've been suspecting that templates might have a tendency to trigger the same problem too). It took me awhile to catch on to the fact that this was happening.


September 02, 2009
div0 wrote:
> Jérôme M. Berger wrote:
>> Max Samukha wrote:
>>> Tom S wrote:
>>>> Max Samukha wrote:
>>>> COFF/ELF output would not be that bad though, at least if there's some
>>>> linker that supports these *and* its license allows it to be bundled
>>>> with DMD.
>>> I doubt such a linker exists. And if it does, I doubt it is of quality good enough to replace OPTLINK.
>>>
>>     GNU ld supports these formats on *nix, windows and MacOS. It has
>> very good quality and its license allows it to be bundled with anything...
> 
>>         Jerome
> 
> Yeah but have you actually linked a D program with it? (esp. on 'doze)
> 
	Yes, using gdc (on both 'doze and 'nux). All you need is COFF
output from the compiler.

		Jerome
-- 
mailto:jeberger@free.fr
http://jeberger.free.fr
Jabber: jeberger@jabber.fr



September 02, 2009
div0 wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Jérôme M. Berger wrote:
>> Max Samukha wrote:
>>> Tom S wrote:
>>>> Max Samukha wrote:
>>>> COFF/ELF output would not be that bad though, at least if there's some
>>>> linker that supports these *and* its license allows it to be bundled
>>>> with DMD.
>>> I doubt such a linker exists. And if it does, I doubt it is of quality
>>> good enough to replace OPTLINK.
>>>
>>     GNU ld supports these formats on *nix, windows and MacOS. It has
>> very good quality and its license allows it to be bundled with anything...
>>
>>         Jerome
> 
> Yeah but have you actually linked a D program with it? (esp. on 'doze)

Probably that wasn't really clear: dmd on Linux uses GNU ld for linking. Walter has an ELF backend for this. Walter also wrote a backend for Mach for the MacOSX port.

> - --
> My enormous talent is exceeded only by my outrageous laziness.
> http://www.ssTk.co.uk
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iD8DBQFKnZkuT9LetA9XoXwRAv5BAJ4+P/lRQsHCVN/eDrZaAgPvHsbWZACdF/Dx
> 7CQ28E5zAM4v2aNWM9RCMms=
> =kOpB
> -----END PGP SIGNATURE-----