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

fatal panic during exection due to import cycle #354

Open
jaxxstorm opened this issue May 21, 2020 · 1 comment
Open

fatal panic during exection due to import cycle #354

jaxxstorm opened this issue May 21, 2020 · 1 comment
Labels
kind/bug Something isn't working

Comments

@jaxxstorm
Copy link

jaxxstorm commented May 21, 2020

This might be hard to track down, but here goes.

I have a crappy library:
https://github.com/jaxxstorm/pulumi-action-config

And a crappy js workflow file:

import * as g from '@jaxxstorm/pulumi-action-config/workflow';
import * as param from '@jkcfg/std/param';

const provider = param.String('provider')
const prWorkflow = name => new g.GithubWorkflow(`pull-request`,
  { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}", GO111MODULE: "on", PROVIDER: provider })

const releaseWorkflow = name => new g.GithubReleaseWorkFlow(`release`,
  { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}", GO111MODULE: "on", PROVIDER: provider })

export default [
  { value: prWorkflow('pull-request'), file: 'pull-request.yml' },
  { value: releaseWorkflow('release'), file: 'release.yml' },

];

you can see this here: https://github.com/jaxxstorm/pulumi-action-config/blob/master/workflow.js

I'm running jk generate workflow.js and getting a nasty panic:

fatal: morestack on g0
SIGTRAP: trace trap
PC=0x405b1c2 m=0 sigcode=1
signal arrived during cgo execution

goroutine 1 [running, locked to thread]:
runtime.abort()
	/Users/travis/go-1.13.8/src/runtime/asm_amd64.s:859 +0x2 fp=0x7ffeefb807d0 sp=0x7ffeefb807c8 pc=0x405b1c2
runtime.morestack()
	/Users/travis/go-1.13.8/src/runtime/asm_amd64.s:416 +0x25 fp=0x7ffeefb807d8 sp=0x7ffeefb807d0 pc=0x4059885

rax    0x17
rbx    0x7ffeefb807a0
rcx    0x5327a40
rdx    0x0
rdi    0x2
rsi    0x7ffeefb80740
rbp    0x7ffeefb80850
rsp    0x7ffeefb807c8
r8     0x5327a40
r9     0x1
r10    0x7ffeefb807a0
r11    0x206
r12    0x40
r13    0x40
r14    0x3f
r15    0x40
rip    0x405b1c2
rflags 0x202
cs     0x2b
fs     0x0
gs     0x0

This only happens when I'm including my library, which is a reference to a git URL in my package.json:

{
  "name": "ci",
  "version": "1.0.0",
  "description": "",
  "main": "workflow.js",
  "dependencies": {
    "@jaxxstorm/pulumi-action-config": "git+https://git@github.com/jaxxstorm/pulumi-action-config.git"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "license": "Apache-2.0"
}

I'm sure there's something wrong with my crappy library, but jk shouldn't panic :)

@squaremo squaremo added the kind/bug Something isn't working label May 25, 2020
@squaremo
Copy link
Member

The script @jaxxstorm/pulumi-action-config/workflow imports itself. I absolutely agree it shouldn't segfault though! I can reproduce this with:

// foo.js
import * as f from 'foo';

I thought we guarded against cycles in imports; apparently not, or at least it has broken.

@squaremo squaremo changed the title fatal panic during exection fatal panic during exection due to import cycle May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants