douzhang7603 2019-01-23 18:45
浏览 294

无法调试Go代码:无法启动进程:在偏移量0x0处解码矮节信息:太短

we are trying to debug Go code and getting this error:

could not launch process: decoding dwarf section info at offset 0x0: too short

our settings:

WITSC02X6385JGH:orderer sjain68$ uname -a
Darwin WITSC02X6385JGH 17.7.0 Darwin Kernel Version 17.7.0: Fri Jul  6 19:54:51 PDT 2018; root:xnu-4570.71.3~2/RELEASE_X86_64 x86_64
WITSC02X6385JGH:orderer sjain68$ go version
go version go1.11 darwin/amd64
WITSC02X6385JGH:orderer sjain68$ dlv version
Delve Debugger
Version: 1.1.0
Build: $Id: 1990ba12450cab9425a2ae62e6ab988725023d5c

Things we have tried:

  • Update dlv using VS Code -> Go: Install/Update Tools

Try running from command line:

WITSC02X6385JGH:orderer sjain68$ /Users/sjain68/go/bin/dlv debug github.com/hyperledger/fabric/orderer --headless=true --listen=127.0.0.1:41305 --api-version=2 --log=true --
API server listening at: 127.0.0.1:41305
INFO[0002] launching process with args: [/Users/sjain68/go/src/github.com/hyperledger/fabric/orderer/debug]  layer=debugger
debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-902.0.79.7
 for x86_64.
Got a connection, launched process /Users/sjain68/go/src/github.com/hyperledger/fabric/orderer/debug (pid = 9278).
Exiting.
could not launch process: decoding dwarf section info at offset 0x0: too short

Note that the binary that we are trying to debug does gets executed. Its just that the debugger does not launch.

Another thing we tried from this link:

WITSC02X6385JGH:orderer sjain68$ export GOFLAGS="-ldflags=-compressdwarf=false"; dlv debug
could not launch process: decoding dwarf section info at offset 0x0: too short

Someone said to run GOCACHE=off go build ... and output of that is pasted here.

How can we fix this?

  • 写回答

1条回答 默认 最新

  • duanlie7962 2019-03-18 08:39
    关注

    I had the same issue after updateing Go. Updating Delve package from console helped:

    go get -u github.com/go-delve/delve/cmd/dlv
    
    评论

报告相同问题?

悬赏问题

  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?