Skip to content

Debug azure#11850

Closed
MoonlightSentinel wants to merge 1 commit intodlang:masterfrom
MoonlightSentinel:debug
Closed

Debug azure#11850
MoonlightSentinel wants to merge 1 commit intodlang:masterfrom
MoonlightSentinel:debug

Conversation

@MoonlightSentinel
Copy link
Contributor

No description provided.

@MoonlightSentinel
Copy link
Contributor Author

MoonlightSentinel commented Oct 10, 2020

Seems like it's a problem with the makefile:

src\core\sys\windows\odbcinst.d(158): Deprecation: function `core.sys.windows.odbcinst.SQLInstallTranslatorW` is deprecated - Use SQLInstallTranslatorExW instead
src\core\sys\windows\odbcinst.d(158): Deprecation: function `core.sys.windows.odbcinst.SQLInstallTranslatorW` is deprecated - Use SQLInstallTranslatorExW instead
src\core\internal\dassert.d(143): Deprecation: argument `cast(__c_long_double)v` for format specification `"%Lg"` must be `real`, not `double`
src\core\internal\dassert.d(157): Deprecation: argument `cast(idouble)v` for format specification `"%Lg"` must be `real`, not `idouble`
src\core\internal\dassert.d(147): Deprecation: argument `cast(__c_long_double)cast(real)v` for format specification `"%Lg"` must be `real`, not `double`
src\core\internal\dassert.d(147): Deprecation: argument `cast(__c_long_double)cast(ireal)v` for format specification `"%Lg"` must be `real`, not `double`

unittest
Error: 'unittest' not found

D:\a\1\druntime>dir
 Volume in drive D is Temporary Storage
 Volume Serial Number is E684-5A0E

 Directory of D:\a\1\druntime

10/10/2020  09:33 PM    <DIR>          .
10/10/2020  09:33 PM    <DIR>          ..
10/10/2020  09:29 PM    <DIR>          .circleci
10/10/2020  09:29 PM             1,312 .codecov.yml
10/10/2020  09:29 PM               156 .editorconfig
10/10/2020  09:29 PM    <DIR>          .github
10/10/2020  09:29 PM               136 .gitignore
10/10/2020  09:29 PM             2,493 appveyor.yml
10/10/2020  09:29 PM             2,973 azure-pipelines.yml
10/10/2020  09:29 PM    <DIR>          benchmark
10/10/2020  09:29 PM    <DIR>          changelog
10/10/2020  09:29 PM             2,574 CODEOWNERS
10/10/2020  09:29 PM             3,944 CONTRIBUTING.md
10/10/2020  09:29 PM    <DIR>          def
10/10/2020  09:32 PM        15,139,525 druntime.json
10/10/2020  09:29 PM               207 dub.sdl
10/10/2020  09:32 PM             2,619 errno_c_32mscoff.obj
10/10/2020  09:32 PM    <DIR>          generated
10/10/2020  09:32 PM    <DIR>          import
10/10/2020  09:29 PM                51 Jenkinsfile
10/10/2020  09:32 PM    <DIR>          lib
10/10/2020  09:29 PM             1,361 LICENSE.txt
10/10/2020  09:29 PM    <DIR>          mak
10/10/2020  09:29 PM            15,657 posix.mak
10/10/2020  09:29 PM                18 project.ddoc
10/10/2020  09:29 PM             2,784 README.md
10/10/2020  09:29 PM               492 setmscver.bat
10/10/2020  09:29 PM    <DIR>          src
10/10/2020  09:29 PM    <DIR>          test
10/10/2020  09:33 PM         1,478,144 unittest.exe  // <===
10/10/2020  09:33 PM             1,294 unittest.lib
10/10/2020  09:33 PM         6,151,130 unittest.obj
10/10/2020  09:29 PM             4,559 win32.mak
10/10/2020  09:29 PM             5,244 win64.mak
              21 File(s)     22,816,673 bytes
              13 Dir(s)  12,176,785,408 bytes free

D:\a\1\druntime>exit /B 3 
##[error]Cmd.exe exited with code '3'.

Guess dlang/druntime#3231 might help.

@rainers
Copy link
Member

rainers commented Oct 11, 2020

Seems like it's a problem with the makefile:

As mentioned in #11833 (comment) the "not found" message is a misinterpretation of the exit code by Digital Mars make at https://github.com/DigitalMars/Tools/blob/master/make.c#L1705: A crash in the exceutable unittest produces a negative result code which then makes the DMC runtime search for other locations of the program: https://github.com/DigitalMars/dmc/blob/master/src/core/SPAWN.C#L332 .

@rainers
Copy link
Member

rainers commented Oct 11, 2020

https://github.com/DigitalMars/dmc/blob/master/src/core/SPAWN.C#L332 .

This line suggests that using .\unittest to execute it should correctly report the exception code.

@Geod24
Copy link
Member

Geod24 commented Oct 11, 2020

This line suggests that using .\unittest to execute it should correctly report the exception code.

Thanks for the confirmation. Then dlang/druntime#3231 should solve this.

@WalterBright
Copy link
Member

@rainers > A crash in the exceutable unittest produces a negative result code which then makes the DMC runtime search for other locations of the program: https://github.com/DigitalMars/dmc/blob/master/src/core/SPAWN.C#L332 .

Nice work! I'm not sure what the correct fix for spawn.c is, or should I fix make.c? Let me know and I'll get it fixed.

@rainers
Copy link
Member

rainers commented Oct 11, 2020

Nice work! I'm not sure what the correct fix for spawn.c is, or should I fix make.c? Let me know and I'll get it fixed.

A simple workaround should be to just check for status != -1 instead of >= 0 at https://github.com/DigitalMars/dmc/blob/master/src/core/SPAWN.C#L332 and https://github.com/DigitalMars/dmc/blob/master/src/core/SPAWN.C#L370.

That doesn't support process exit code -1, but allowing that would be a larger refactoring (and maybe doesn't make much sense when implementing the C lib).

@WalterBright
Copy link
Member

Thanks!

@WalterBright
Copy link
Member

DigitalMars/dmc@9478d25

@WalterBright
Copy link
Member

Thanks everyone for helping out finding what turned out to be an ancient bug in dmc's runtime library.

@Geod24 Geod24 closed this Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments