Skip to content

[dmd-cxx]: Fix the auto-tester and copy dmd to $(GENERATED)/$(OS)/$(BUILD)/$(MODEL)#7953

Merged
ibuclaw merged 1 commit intodlang:dmd-cxxfrom
wilzbach:auto-tester-dmd-cxx
Mar 4, 2018
Merged

[dmd-cxx]: Fix the auto-tester and copy dmd to $(GENERATED)/$(OS)/$(BUILD)/$(MODEL)#7953
ibuclaw merged 1 commit intodlang:dmd-cxxfrom
wilzbach:auto-tester-dmd-cxx

Conversation

@wilzbach
Copy link
Contributor

This should ideally fix the auto-tester build for dmd-cxx as Travis is already passing too.

See also: #7595

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach wilzbach force-pushed the auto-tester-dmd-cxx branch from 6c1ec1a to dc71e70 Compare February 25, 2018 00:35
@wilzbach wilzbach added the Review:WIP Work In Progress - not ready for review or pulling label Feb 25, 2018
@wilzbach
Copy link
Contributor Author

wilzbach commented Feb 25, 2018

Hmm, Phobos still fails to build.
The error can be reproduced by running make -f posix.mak checkwhitespace locally.
Here with a more verbose error message:

std/uni.d: Error: generated function std.uni.InversionList!(GcPolicy).InversionList.Intervals!(CowArray!(GcPolicy)).Intervals.__xopEquals errors compiling the function
make: *** [posix.mak:520: checkwhitespace] Error 1

@dkgroot you mentioned on Slack that dmd-cxx works for you?

We could also just stub out checkwhitespace at dmd-cxx for now and see whether we get the testsuite running.

edit: -> see dlang/phobos#6220

@dkgroot
Copy link
Contributor

dkgroot commented Feb 26, 2018

@wilzbach
Not sure how i got through last time i check (Maybe i only ran compile).

With the current version (ie: dmd + druntime + phobos using branch 'dmd-cxx'), compilation runs fine (still), using: make -f posix.mak BUILD=debug ENABLE_DEBUG=1 PIC=1 DMD=../dmd/src/dmd. Note: i am not seeing the checkwhitespace you mentioned.

running the unittests for druntime, i get:

make[1]: Entering directory '/data/develop/dmd/dmd-cxx/druntime/test/exceptions'
/data/develop/dmd/dmd-cxx/dmd/src/dmd -m64 -w -I../../src -I../../import -Isrc -defaultlib= -debuglib= -dip1000 -fPIC -L/data/develop/dmd/dmd-cxx/druntime/generated/linux/debug/64/libdruntime.a -g -debug -ofgenerated/linux/debug/64/unknown_gc src/unknown_gc.d
DMD v2.069-devel-daf285aea-dirty DEBUG
Testing unknown_gc
./generated/linux/debug/64/unknown_gc  2>&1 1>/dev/null | grep -qF "'unknowngc'"
Segmentation fault (core dumped)
Testing line_trace

Meaning something goes wrong in catching the thrown exception.

running the unittests for phobos:, i get:

generated/linux/debug/64/unittest/test_runner std.outbuffer
generated/linux/debug/64/unittest/libphobos2-ut.so(_D4core7runtime18runModuleUnitTestsUZ19unittestSegvHandlerUNbiPS4core3sys5posix6signal9siginfo_tPvZv+0x3a)[0x7f8eaf0598ca]
/lib/x86_64-linux-gnu/libc.so.6(+0x37140)[0x7f8ea949f140]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D4core4stdc6stdarg7va_copyFNbJPS4core4stdc6stdarg13__va_list_tagPS4core4stdc6stdarg13__va_list_tagPvZv+0x2d)[0x7f8eaf063575]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D3std9outbuffer9OutBuffer7vprintfMFNbNeAyaPS4core4stdc6stdarg13__va_list_tagZv+0xca)[0x7f8ead4d67ba]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D3std9outbuffer9OutBuffer6printfMFNeAyaYv+0xa0)[0x7f8ead4d6950]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D3std9outbuffer16__unittestL378_4FNfZv+0xa2)[0x7f8ead4d6d4a]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D3std9outbuffer9__modtestFZv+0x13)[0x7f8ead4e41c3]
generated/linux/debug/64/unittest/test_runner(+0x16bb)[0x55e8458d26bb]
generated/linux/debug/64/unittest/test_runner(+0x160a)[0x55e8458d260a]
generated/linux/debug/64/unittest/test_runner(+0x1450)[0x55e8458d2450]
generated/linux/debug/64/unittest/libphobos2-ut.so(runModuleUnitTests+0xbc)[0x7f8eaf05981c]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZv+0x1e)[0x7f8eaf082f2e]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ7tryExecMFMDFZvZv+0x34)[0x7f8eaf082ebc]
generated/linux/debug/64/unittest/libphobos2-ut.so(_d_run_main+0x381)[0x7f8eaf082e29]
generated/linux/debug/64/unittest/test_runner(+0x1aa6)[0x55e8458d2aa6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f8ea94891c1]
generated/linux/debug/64/unittest/test_runner(+0x121a)[0x55e8458d221a]
posix.mak:376: recipe for target 'unittest/std/outbuffer.run' failed
make: *** [unittest/std/outbuffer.run] Segmentation fault (core dumped)

So there still is a little work to do.
I am not really sure how/where to get started with either of these two bugs.

@dkgroot
Copy link
Contributor

dkgroot commented Feb 26, 2018

@ibuclaw Are you able to pass the druntime/phobos 'dmd-cxx' branch unittests using gdc ?

@ibuclaw
Copy link
Member

ibuclaw commented Feb 26, 2018

I can report back in a couple hours on that. Upstream gdc itself mirrors the 2.076.1 branch - plus some platform updates.

@ibuclaw
Copy link
Member

ibuclaw commented Feb 27, 2018

@dkgroot - Actually, I don't think I can say because there's so many things in dmd's rt modules that just don't work with gdc.

Judging from this stack trace you gave.

generated/linux/debug/64/unittest/libphobos2-ut.so(_D4core4stdc6stdarg7va_copyFNbJPS4core4stdc6stdarg13__va_list_tagPS4core4stdc6stdarg13__va_list_tagPvZv+0x2d)[0x7f8eaf063575]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D3std9outbuffer9OutBuffer7vprintfMFNbNeAyaPS4core4stdc6stdarg13__va_list_tagZv+0xca)[0x7f8ead4d67ba]
generated/linux/debug/64/unittest/libphobos2-ut.so(_D3std9outbuffer9OutBuffer6printfMFNeAyaYv+0xa0)[0x7f8ead4d6950]

Problems with va_list tend to point towards dmd's backend code generator.

@ibuclaw
Copy link
Member

ibuclaw commented Feb 27, 2018

I can report back in a couple hours on that. Upstream gdc itself mirrors the 2.076.1 branch - plus some platform updates.

The version of druntime/phobos that is in gdc's tree does pass all unittests in CI.

https://semaphoreci.com/d-programming-gdc/gdc/branches/master/builds/512

@dkgroot
Copy link
Contributor

dkgroot commented Feb 28, 2018

@wilzbach Have you been able to run the dmd-cxx unittests and/or found the cause for the va_args issue ? I have been looking, but cannot find the cause.

@ibuclaw
Copy link
Member

ibuclaw commented Mar 3, 2018

Ah, bugger. Looks like the assert failure in the auto-tester is issue 15149. But there's a typo in one of the conditions.

PR here for testing: D-Programming-GDC/gdc#629

@ibuclaw
Copy link
Member

ibuclaw commented Mar 3, 2018

make[1]: Entering directory '/data/develop/dmd/dmd-cxx/druntime/test/exceptions'
/data/develop/dmd/dmd-cxx/dmd/src/dmd -m64 -w -I../../src -I../../import -Isrc -defaultlib= -debuglib= -dip1000 -fPIC -L/data/develop/dmd/dmd-cxx/druntime/generated/linux/debug/64/libdruntime.a -g -debug -ofgenerated/linux/debug/64/unknown_gc src/unknown_gc.d
DMD v2.069-devel-daf285aea-dirty DEBUG
Testing unknown_gc
./generated/linux/debug/64/unknown_gc  2>&1 1>/dev/null | grep -qF "'unknowngc'"
Segmentation fault (core dumped)
Testing line_trace

This segfault happens because va_start does not initialize the argptr.

@ibuclaw
Copy link
Member

ibuclaw commented Mar 3, 2018

With all referenced PRs merged in, I think the auto-tester should be able to get as far as passing the druntime and phobos unittests.

@ibuclaw
Copy link
Member

ibuclaw commented Mar 3, 2018

Windows (dmc) has a very interesting error message:
https://auto-tester.puremagic.com/show-run.ghtml?projectid=17&runid=3057204&isPull=true

case STCreturn | STCref:   result = SRReturnRef;   break;    <--
case STCreturn | STCscope: result = SRReturnScope; break;    <--
case STCref    | STCscope: result = SRRefScope;    break;
case STCreturn | STCref | STCscope:    <--

Looks like there's a bug in dmc to me, as if it overflows on STCreturn, and so doesn't see the value.

@ibuclaw ibuclaw force-pushed the auto-tester-dmd-cxx branch from dc71e70 to 0532a2d Compare March 4, 2018 17:51
@wilzbach wilzbach requested a review from ibuclaw as a code owner March 4, 2018 17:51
@ibuclaw
Copy link
Member

ibuclaw commented Mar 4, 2018

Rebased as other PRs have been merged.

Copy link
Member

@ibuclaw ibuclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Druntime and Phobos builds in the auto-tester.

Testsuite fails, but then again that's fine, as I don't think any attempt has been made to sync the testsuite yet.

@ibuclaw
Copy link
Member

ibuclaw commented Mar 4, 2018

@wilzbach - Let's merge so that it isn't sitting around.

@ibuclaw ibuclaw merged commit 2889afc into dlang:dmd-cxx Mar 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Legacy:C++ Port Review:WIP Work In Progress - not ready for review or pulling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants