Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #131 (closed defect: fixed)

Opened 1 month ago

Last modified 4 weeks ago

LDC segfaults randomly on Windows.

Reported by: Redien Assigned to:
Priority: trivial Milestone:
Component: backend Version: Both
Keywords: Cc:

Description

The way environment variables are read, through a 3rd main() argument is a non-standard but is seemingly supported on Posix systems, MinGW/Windows does not which causes random segfaults to occur. I am attaching a patch with a workaround using GetEnvironmentStringsA() on Windows.

Attachments

win_envp_fix.patch (4.0 kB) - added by Redien on 11/24/08 13:16:00.
envp.diff (7.3 kB) - added by elrood on 11/24/08 17:01:36.
removes env handling code

Change History

11/24/08 13:16:00 changed by Redien

  • attachment win_envp_fix.patch added.

11/24/08 17:00:26 changed by elrood

I'd like to propose going the opposite way. Since noone really seems to have a clue what the ominous sanitizing the environment for gcc LLVM does seems to be good for, let alone if it has any appliance for LDC whatsoever, why not see if we can get rid of it altogether and avoid yet another modification to the DMDFE and more platform specific code.
The diff obviously needs to be thoroughly tested before we can be sure it doesn't do any harm, but a few testruns seem to indicate the env code is indeed redundant.

11/24/08 17:01:36 changed by elrood

  • attachment envp.diff added.

removes env handling code

12/14/08 10:31:43 changed by ChristianK

  • status changed from new to closed.
  • resolution set to fixed.
  • component set to backend.

Removed sanitizing code in [850]. Thanks.

Copyright © 2008, LDC Development Team.