Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler error: unhandled exception: index out of bounds, the container is empty [IndexError] #17704

Open
stefantalpalaru opened this issue Apr 12, 2021 · 5 comments

Comments

@stefantalpalaru
Copy link
Contributor

replication instructions

git clone https://github.com/status-im/nimbus-eth2.git
cd nimbus-eth2
git checkout unstable
make -j8 update
# replace with your own Nim build from the "version-1-2" branch
PATH="/src/77_DLD/CODE/00_github/Nim/bin/:${PATH}"; rm -rf nimcache; make -j8 USE_SYSTEM_NIM=1 V=1 all_tests

stack trace

/mnt/sda3/storage/CODE/00_github/Nim/compiler/nim.nim(118) nim
/mnt/sda3/storage/CODE/00_github/Nim/compiler/nim.nim(95) handleCmdLine
/mnt/sda3/storage/CODE/00_github/Nim/compiler/cmdlinehelper.nim(77) loadConfigsAndRunMainCommand
/mnt/sda3/storage/CODE/00_github/Nim/compiler/main.nim(193) mainCommand
/mnt/sda3/storage/CODE/00_github/Nim/compiler/main.nim(95) commandCompileToC
/mnt/sda3/storage/CODE/00_github/Nim/compiler/modules.nim(143) compileProject
/mnt/sda3/storage/CODE/00_github/Nim/compiler/modules.nim(84) compileModule
/mnt/sda3/storage/CODE/00_github/Nim/compiler/passes.nim(216) processModule
/mnt/sda3/storage/CODE/00_github/Nim/compiler/passes.nim(86) processTopLevelStmt
/mnt/sda3/storage/CODE/00_github/Nim/compiler/sem.nim(604) myProcess
/mnt/sda3/storage/CODE/00_github/Nim/compiler/sem.nim(572) semStmtAndGenerateGenerics
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semstmts.nim(2308) semStmt
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(1006) semExprNoType
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(2801) semExpr
/mnt/sda3/storage/CODE/00_github/Nim/compiler/importer.nim(218) evalImport
/mnt/sda3/storage/CODE/00_github/Nim/compiler/importer.nim(188) impMod
/mnt/sda3/storage/CODE/00_github/Nim/compiler/importer.nim(158) myImportModule
/mnt/sda3/storage/CODE/00_github/Nim/compiler/modules.nim(98) importModule
/mnt/sda3/storage/CODE/00_github/Nim/compiler/modules.nim(84) compileModule
/mnt/sda3/storage/CODE/00_github/Nim/compiler/passes.nim(210) processModule
/mnt/sda3/storage/CODE/00_github/Nim/compiler/passes.nim(86) processTopLevelStmt
/mnt/sda3/storage/CODE/00_github/Nim/compiler/sem.nim(604) myProcess
/mnt/sda3/storage/CODE/00_github/Nim/compiler/sem.nim(572) semStmtAndGenerateGenerics
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semstmts.nim(2308) semStmt
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(1006) semExprNoType
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(2768) semExpr
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semstmts.nim(2248) semStmtList
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(2678) semExpr
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(987) semDirectOp
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(836) semOverloadedCallAnalyseEffects
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semcall.nim(566) semOverloadedCall
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semcall.nim(527) semResolvedCall
/mnt/sda3/storage/CODE/00_github/Nim/compiler/seminst.nim(400) generateInstance
/mnt/sda3/storage/CODE/00_github/Nim/compiler/seminst.nim(148) instantiateBody
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(1764) semProcBody
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(2768) semExpr
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semstmts.nim(2248) semStmtList
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semexprs.nim(2791) semExpr
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semtempl.nim(675) semTemplateDef
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semtempl.nim(581) semTemplBody
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semtempl.nim(349) semTemplBodySons
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semtempl.nim(382) semTemplBody
/mnt/sda3/storage/CODE/00_github/Nim/compiler/semtempl.nim(114) semMixinStmt
/mnt/sda3/storage/CODE/00_github/Nim/compiler/lookups.nim(51) considerQuotedIdent
/mnt/sda3/storage/CODE/00_github/Nim/lib/system/fatal.nim(49) sysFatal
Error: unhandled exception: index out of bounds, the container is empty [IndexError]
make: *** [Makefile:232: all_tests] Error 1
$ nim -v
Nim Compiler Version 1.2.11 [Linux: amd64]
Compiled at 2021-04-12
Copyright (c) 2006-2020 by Andreas Rumpf

git hash: fe8b84496ffe40cd86b9db688cf5494187b437e4
active boot switches:
@timotheecour
Copy link
Member

please minimize and test against devel (like all other bug reports)

@narimiran
Copy link
Member

narimiran commented Apr 13, 2021

test against devel

They (Status) use Nim 1.2.x and this was caught as a part of the testing of 1.2.12 RC.

@narimiran
Copy link
Member

Fixed by 6238f2e, will be available in the nightlies tomorrow morning.

@stefantalpalaru In the mean time, you can checkout version-1-2 branch and test it. I've tested locally, and for me the command you posted in OP works now.

@timotheecour
Copy link
Member

this will probably unblock OP, but before closing this issue, we should still minimize and see whether root problem occurs on devel, because based on 6238f2e it's likely that #17255 would cause the problem on devel.

@stefantalpalaru
Copy link
Contributor Author

you can checkout version-1-2 branch and test it

Yes, it works now. Thanks!

we should still minimize

Easier said than done.

see whether root problem occurs on devel

I can't compile Nimbus-eth2 programs with Nim devel. First it fails with:

/mnt/sde1/storage/nimbus-eth2/vendor/nim-libp2p/libp2p/protocols/pubsub/gossipsub.nim(297, 38) Error: 't' is of type <lent string> which cannot be captured as it would violate memory safety, declared here: /mnt/sde1/storage/nimbus-eth2/vendor/nim-libp2p/libp2p/protocols/pubsub/gossipsub.nim(290, 11); using '-d:nimWorkaround14447' helps in some cases
then, after adding '-d:nimWorkaround14447', it fails in another way:

/mnt/sde1/storage/nimbus-eth2/beacon_chain/networking/eth2_network.nim(1283, 25) template/generic instantiation from here
/mnt/sde1/storage/nimbus-eth2/beacon_chain/networking/eth2_network.nim(1362, 29) Error: implementSendProcBody sendProc can raise an unlisted exception: Exception

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

No branches or pull requests

3 participants