Skip to content

Comments

Revert "reimplement std.traits.ParameterStorageClassTuple()"#5469

Merged
WalterBright merged 1 commit intomasterfrom
revert-5427-ParameterStorageClassTuple
Jun 12, 2017
Merged

Revert "reimplement std.traits.ParameterStorageClassTuple()"#5469
WalterBright merged 1 commit intomasterfrom
revert-5427-ParameterStorageClassTuple

Conversation

@andralex
Copy link
Member

Reverts #5427. Let's see if this takes care of the errors in vibe.

@andralex
Copy link
Member Author

cc @wilzbach @WalterBright

@CyberShadow
Copy link
Member

Hmm, Jenkins can't test reverts? @MartinNowak

@dnadlinger
Copy link
Contributor

dnadlinger commented Jun 11, 2017

Huh? I thought reverts were just regular commits? @andralex: Perhaps just redo/amend the commit and force-push it to try again?

@CyberShadow
Copy link
Member

They're on a branch on the dlang org's repo, instead of a fork.

@PetarKirov
Copy link
Member

PetarKirov commented Jun 11, 2017

@CyberShadow @klickverbot I don't follow. According to Jenkins, this PR fixes the regression, although vibe.d still fails*. Here's the result of testing a different PR which clearly shows that regression is present there, but no with this PR.

*The compilation failure is in libasync 0.8.3 (a dependency of vibe.d). The compiler accuses this function of throwing, but both of the function's it calls are nothrow and also ~this() of throwing, the later probably caused by the following call chain: EventLoop.~this() (implicit) -> EventLoopImpl.~this() (implicit) -> HashMap.~this() -> freeArray -> Allocator.free. The last one doesn't seem to be marked as nothrow and I don't know how it did work at the time the code was written.

@CyberShadow
Copy link
Member

Oh, I was clicking on the continuous-integration/jenkins/branch CI status, not /pr-merge, which looks very different.

@CyberShadow
Copy link
Member

The compiler accuses this function of throwing

@ZombineDev Since you've looked at this already, any chance you can separate it into a self-contained test case? Would be easy to bisect it then.

@PetarKirov
Copy link
Member

I am on the phone now, but I can try to find some time tomorrow.

Copy link
Contributor

@wilzbach wilzbach left a comment

Choose a reason for hiding this comment

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

Reverts #5427. Let's see if this takes care of the errors in vibe.

@andralex thanks a lot!
As @ZombineDev has explained and we can see, reverting this does fix the regression, we just seem to have uncovered another one.

So I would be in favor of pushing the revert and looking at the Jenkins output on the resubmission.

@CyberShadow
Copy link
Member

I am on the phone now, but I can try to find some time tomorrow.

No problem, I see it's easy to reproduce so I'll bisect it myself.

@CyberShadow
Copy link
Member

libasync regression introduced by dlang/dmd#6816

@andralex
Copy link
Member Author

@wilzbach do you think you can help @WalterBright repro the vibed test environment so he can repro the problem locally?

@CyberShadow
Copy link
Member

Running a reduction now.

@CyberShadow
Copy link
Member

Running a reduction now.

Here's a reduced example that fails only with #5427:

void async(ARGS...)(ARGS)
{
	import std.functional;

	static void compute(ARGS)
	{
	}

	toDelegate(&compute);
}

alias test = async!(int, int);

@WalterBright
Copy link
Member

I added it to #5474

@WalterBright
Copy link
Member

@CyberShadow what is the error message you see?

@CyberShadow
Copy link
Member

../dmd.bad/bin/../import/std/traits.d(1046): Error: parameter index must be in range 0..1 not 1LU
../dmd.bad/bin/../import/std/traits.d(1047): Error: template instance std.traits.ParameterStorageClassTuple!(void function(int, int) pure nothrow @nogc @safe).StorageClass!1LU error instantiating
../dmd.bad/bin/../import/std/traits.d(1052):        instantiated from here: StorageClass!0LU
../dmd.bad/bin/../import/std/typecons.d(4273):        instantiated from here: ParameterStorageClassTuple!(void function(int, int) pure nothrow @nogc @safe)
../dmd.bad/bin/../import/std/typecons.d(4170):        instantiated from here: generateParameters!("FuncInfo_doIt", void function(int, int) pure nothrow @nogc @safe)
../dmd.bad/bin/../import/std/functional.d(1224):        ... (2 instantiations, -v to show) ...
test.d(9):        instantiated from here: toDelegate!(void function(int, int) pure nothrow @nogc @safe)
test.d(12):        instantiated from here: async!(int, int)
../dmd.bad/bin/../import/std/functional.d(1224): Error: CTFE failed because of previous errors in generateFunction
core.exception.AssertError@ddmd/argtypes.d(201): Assertion failure
----------------
../dmd.bad/bin/dmd() [0x4fb21f]
../dmd.bad/bin/dmd(_ZN10toArgTypes10ToArgTypes12argtypemergeEP4TypeS2_j+0xae) [0x4fa99e]
../dmd.bad/bin/dmd(_ZN10toArgTypes10ToArgTypes5visitEP10TypeStruct+0x3b6) [0x4faffe]
../dmd.bad/bin/dmd(_ZN10TypeStruct6acceptEP7Visitor+0x1d) [0x5eb73d]
../dmd.bad/bin/dmd(_Z10toArgTypesP4Type+0x41) [0x4fa5c9]
../dmd.bad/bin/dmd(_ZN17StructDeclaration12finalizeSizeEv+0x214) [0x564bf4]
../dmd.bad/bin/dmd(_ZN20AggregateDeclaration13determineSizeE3Loc+0xd6) [0x4f8a4e]
../dmd.bad/bin/dmd(_ZN20AggregateDeclaration9semantic2EP5Scope+0x54) [0x4f842c]
../dmd.bad/bin/dmd(_ZN17AttribDeclaration9semantic2EP5Scope+0x76) [0x4fd64e]
../dmd.bad/bin/dmd(_ZN14DeclarationExp8semanticEP5Scope+0x3cc) [0x5917d4]
../dmd.bad/bin/dmd(_ZN24StatementSemanticVisitor5visitEP12ExpStatement+0x52) [0x61c9d2]
../dmd.bad/bin/dmd(_ZN12ExpStatement6acceptEP7Visitor+0x1a) [0x61108a]
../dmd.bad/bin/dmd(ddmd.statement.Statement ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*)+0x46) [0x62a78e]
../dmd.bad/bin/dmd(_ZN24StatementSemanticVisitor5visitEP17CompoundStatement+0xe8) [0x61cc80]
../dmd.bad/bin/dmd(_ZN17CompoundStatement6acceptEP7Visitor+0x1a) [0x611842]
../dmd.bad/bin/dmd(ddmd.statement.Statement ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*)+0x46) [0x62a78e]
../dmd.bad/bin/dmd(_ZN15FuncDeclaration9semantic3EP5Scope+0x12b9) [0x5b0b31]
../dmd.bad/bin/dmd(_ZN16TemplateInstance9semantic3EP5Scope+0x12d) [0x57786d]
../dmd.bad/bin/dmd(_ZN16TemplateInstance12trySemantic3EP5Scope+0x55) [0x57af75]
../dmd.bad/bin/dmd(_ZN16TemplateInstance8semanticEP5ScopeP5ArrayIP10ExpressionE+0xc9a) [0x57721a]
../dmd.bad/bin/dmd(void ddmd.dtemplate.functionResolve(ddmd.declaration.Match*, ddmd.dsymbol.Dsymbol, ddmd.globals.Loc, ddmd.dscope.Scope*, ddmd.root.array.Array!(ddmd.root.rootobject.RootObject).Array*, ddmd.mtype.Type, ddmd.root.array.Array!(ddmd.expression.Expression).Array*)+0x170) [0x56e5b0]
../dmd.bad/bin/dmd(_Z15resolveFuncCall3LocP5ScopeP7DsymbolP5ArrayIP10RootObjectEP4TypePS4_IP10ExpressionEi+0xc6) [0x5b792e]
../dmd.bad/bin/dmd(_ZN7CallExp8semanticEP5Scope+0x2953) [0x59b013]
../dmd.bad/bin/dmd(_ZN24StatementSemanticVisitor5visitEP12ExpStatement+0x52) [0x61c9d2]
../dmd.bad/bin/dmd(_ZN12ExpStatement6acceptEP7Visitor+0x1a) [0x61108a]
../dmd.bad/bin/dmd(ddmd.statement.Statement ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*)+0x46) [0x62a78e]
../dmd.bad/bin/dmd(_ZN24StatementSemanticVisitor5visitEP17CompoundStatement+0xe8) [0x61cc80]
../dmd.bad/bin/dmd(_ZN17CompoundStatement6acceptEP7Visitor+0x1a) [0x611842]
../dmd.bad/bin/dmd(ddmd.statement.Statement ddmd.statementsem.semantic(ddmd.statement.Statement, ddmd.dscope.Scope*)+0x46) [0x62a78e]
../dmd.bad/bin/dmd(_ZN15FuncDeclaration9semantic3EP5Scope+0x12b9) [0x5b0b31]
../dmd.bad/bin/dmd(_ZN16TemplateInstance9semantic3EP5Scope+0x12d) [0x57786d]
../dmd.bad/bin/dmd(_ZN6Module9semantic3EP5Scope+0x6c) [0x55a46c]
../dmd.bad/bin/dmd(int ddmd.mars.tryMain(ulong, const(char)**)+0x32ae) [0x5d8bf6]
../dmd.bad/bin/dmd(_Dmain+0x27) [0x5d9927]
../dmd.bad/bin/dmd(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x1f) [0x70566b]
../dmd.bad/bin/dmd(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x7055be]
../dmd.bad/bin/dmd(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x705624]
../dmd.bad/bin/dmd(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x7055be]
../dmd.bad/bin/dmd(_d_run_main+0x1dc) [0x705538]
../dmd.bad/bin/dmd(main+0x17) [0x5da01f]
/usr/lib/libc.so.6(__libc_start_main+0xf1) [0x7fd7d0a21511]

@WalterBright
Copy link
Member

Ok, I'm getting the same one. Thanks!

@CyberShadow
Copy link
Member

Oh and I guess if a Phobos template can trigger an assertion error in the compiler, then that makes for a separate bug.

@WalterBright
Copy link
Member

../dmd.bad/bin/dmd(_Z10toArgTypesP4Type+0x41) [0x4fa5c9]
../dmd.bad/bin/dmd(_ZN17StructDeclaration12finalizeSizeEv+0x214) [0x564bf4]

is a well known dmd bug fixed by dlang/dmd#6875

@wilzbach
Copy link
Contributor

wilzbach commented Jun 12, 2017

is a well known dmd bug fixed by dlang/dmd#6875

Uhm .. I do have another test, which proofs that it's not fixed by dlang/dmd#6875 ;-)

See; dlang/dmd#6894

@MartinNowak MartinNowak deleted the revert-5427-ParameterStorageClassTuple branch June 12, 2017 09:24
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.

6 participants