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

Program freezes when debugging #2864

Open
kindlychung opened this issue Jan 29, 2017 · 5 comments
Open

Program freezes when debugging #2864

kindlychung opened this issue Jan 29, 2017 · 5 comments

Comments

@kindlychung
Copy link

  • Plugin version : 0.13.1924

  • IDE name and version: IntelliJ IDEA 2016.3.3

  • Build #IC-163.11103.6, built on January 16, 2017

  • JRE: 1.8.0_112-release-408-b6 x86_64

  • JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

  • OS name and version: MacOS Sierra

  • What are you trying to do?

I was justing trying to step over some functions.

  • What would you expect to happen?

The program should run until the next breakpoint.

  • What happens?

Program freezes.

The entire project can be found here: https://github.com/kindlychung/code/blob/master/chapter2/sample/main.go (Code samples from the book Go in Action)

Video demo: https://www.youtube.com/watch?v=JtZb0J28NUI&feature=youtu.be

@justinclift
Copy link

justinclift commented Feb 17, 2017

This looks like the same problem I'm having when attempting to step through a program.

I've reduced it to a trivial example, 100% reproducible:

package main

import (
	"log"

	"github.com/gwenn/gosqlite"
)

func main() {
	log.Print("First")
	log.Print("Second")
	log.Print("Third")
}

func GetSQLiteRowCount() int {
	sqlite.Open("foo.db", sqlite.OpenReadOnly)
	return 0
}

(no need to create foo.db first)

This example runs fine. However, if you put a breakpoint on any of the log.Print() lines (eg "Second"), you can't proceed beyond it in Debug mode once it's hit. eg "Step Over" → program hang

First
Second
[hung program]
  • WebStorm 2016.3.3
  • Build # WS-163.12024.17
  • Plugin version: 0.13.1914 & 0.13.1924 (hang occurs on both)
  • OS name: OSX 10.11.6
  • Go version: 1.7.4 (installed using OSX Homebrew)

For me, this is pretty much a complete blocker. I have a server application I'm attempting to debug, and the hanging can't be worked around (I've tried various things over the last few hours).

So now I'm using Println statements, and need to find something practical that works.

UPDATE - This also happens in Gogland on OSX. It doesn't happen with WebStorm 2016.3.3 on Fedora Linux. Trying various other things now.

UPDATE 2 - Also reported against Gogland, which has a workaround: https://youtrack.jetbrains.com/issue/GO-3511

@whilei
Copy link

whilei commented May 9, 2017

plus one

@justinclift
Copy link

@whilei If you're up for using Gogland, many of the debugging issues with this plugin are fixed there:

    https://www.jetbrains.com/go

😄

@whilei
Copy link

whilei commented May 9, 2017

@justinclift aha! woops, hold on a second... I am using Gogland.

UPDATE 2 - Also reported against Gogland, which has a workaround: https://youtrack.jetbrains.com/issue/GO-3511

misread that too fast. thanks for sending me in the right direction

@justinclift
Copy link

No worries. 😄

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