decoding dwarf section info at offset 0x0: too short - go

I am using JetBrains GoLand and I am trying to debug my go file and I am getting the following error:
decoding dwarf section info at offset 0x0: too short
I tried to find an answer here at StackOverflow but unfortunately, I didn't get any solution.

GoLand ships with a bundled version of Delve. Update to 2018.2.2 and it should work. If you need to do remote debugging, then you need to update your Delve installation on/for the target machine as well (make sure you compile it with Go 1.11).
Edit:
There are two more possible cases where this issue can appear:
the application was compiled with all the debugging flags turned off and the additional debugging information stripped
the application uses the standard library "plugin" package, which is known to cause an issue in the Go compiler. This will be fixed in Go 1.12.

I would like to share my experience here too as it may be helpful for community, I made it works by doing the following:
Update Goland to 18.3
Also, in case if you have Mac, you should run xcode-select --install
In case if you had delv already installed inside GOPATH/bin, remove it and re-install it again by following instructions here

For my Mac the problem is related to the dlv package as installed by Golang plugin.
Install delv and,
check the path of dlv as executed by IntelliJ (in the console).
Go to this directory
($HOME//Library/Application Support/IntelliJIdea2017.3/intellij-go/lib/dlv/mac)
and rename dlv to any other name. Get the right dlv executable by using
which dlv (/usr/local/Cellar/go/1.11.1/libexec/bin/dlv for my computer)
and add a symbolic link
(ln -s /usr/local/Cellar/go/1.11.1/libexec/bin/dlv dlv).

After hours of effort, I was able to find the issue. It was due to Golang Plugin which is deprecated and was not compatible with IntelliJ IDEA 2018.2.2 (Ultimate Edition).
I uninstalled the plugin and reinstall the IntelliJ.
Hope this also helps to above solutions.

Related

gorename failing in VS Code without explicit error

In VSCode, I am trying to rename a variable using F2. This seems to run the gorename tool, but fails every time without explicit error. It simply displays:
/home/oops/dev/mtg-tracker/mtg-tracker-server/handlers>Finished running tool: /home/oops/dev/go/bin/golint
/home/oops/dev/mtg-tracker/mtg-tracker-server/handlers>Finished running tool: /usr/local/go/bin/go build -i -o /tmp/vscode-goVw9yJs/go-code-check .
/home/oops/dev/mtg-tracker/mtg-tracker-server/handlers>Finished running tool: /usr/local/go/bin/go vet ./...
Rename failed
I've looked into similar issues and it seems to normally come with an error such as an invalid GOROOT or incorrect package naming, but I see no such error here and I haven't been able to find any further info.
I also saw that someone fixed this by updating gorename, which I tried looking into but have not been able to figure out how to do.
Expected result: VSCode actually renames my variable.
Actual result: The rename fails and it stays the same.
Note there is an issue 24661 dedicated to follow the tools and their updates, for command-line or VSCode usage.
That issue just included:
gorename will no longer be supported as gopls already implemented renaming functionality.
See issue 27571, which refers to issue 32875.
In the meantime, pending full support of gorename, I am using saibing/tools which does produced an "extended" version of gopls, with rename support.
And which is working just fine in VSCode.
Update Q4 2019 (Nov.): issue 32875 is now closed, gopls has released a 0.2.0 and those errors should be fixed.
A full rename support is still there: CL 194878
Remains CL 207579: This change adds command line support for prepare_rename.
Update Sept. 2020:
As commented and in CL 255053 (for go bundle), a lot of the tools in this list have been replaced by gopls as well.

Error: "Could not find build tools necessary to build stringi" when trying devtools::install_github()

Trying
devtools::install_github("Rexamine/stringi")
and getting error:
Could not find build tools necessary to build stringi
I see several people have had this error but the solutions haven't worked for me. I reinstalled xcode because the command line tools seemed to be the problem for other people. Checked the paths for R and RStudio, I can open both fine (from the terminal as well). Don't think this is an Rtools issue but I can't figure out where the problem is. Has anyone had any luck with this particular devtools error?
Running OSX 10.11.6, RStudio Version 0.99.896, R 3.2.1 GUI 1.66 Mavericks build (6956), XCode Version 7.3.1 (7D1014).
You can try running
/usr/bin/clang --version
If command line tools are installed, this should just report the version of clang installed; otherwise, you'll be prompted to install Xcode + Command Line Tools. (This is just a simple way of ensuring command line tools indeed are installed)
If you run
devtools::install_github("Rexamine/stringi")
in a plain R console, outside of RStudio, what do you see? Can you update your post with the errors (if any) printed to the console?
You might also try updating RStudio to the preview release (https://www.rstudio.com/products/rstudio/download/preview/) to see if that helps.
It seems like this is likely a bug in RStudio's build tools detection; you might try explicitly disabling it with:
options(buildtools.check = function(action) TRUE)
This should ensure that devtools doesn't try to call RStudio's build tools detection code and just assume that everything is available.

Running qtcreator 4.0.1 on a lxc-container

Using this link I created a container and after getting some packages, I want to start a qtcreator 4.0.1 on it. I use a ssh connection to connect to the container. After launching qtcreator I get an error such as this:
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
Reinstalling the application may fix this problem.
I installed all prerequisites packages as listed here but still the problem is remained.
I must mention that I am using a privileged container in opposite of the link.
xcb listed as available plug-ins but it does not run. Is there any suggestion to get around this bug?
This answer has the main solution. In my case I find the libqxcb.so in path /path_to_qt/plugins/platforms/ and after running ldd command on it I found that it has not one of its dependency libEGL.so after install this package using sudo apt install libegl-mesa0-dev I could run qtcreator.

Profiling an application on Windows with cabal/ghc

I’ve been experiencing a nasty issue with profiling on Windows. But first, the context of setup:
I created a shared sandbox in ~/dev/foo_shared: cabal sandbox init --sandbox=.
I created a sandbox in ~/dev/foo using the shared sandbox above: cabal sandbox init --sandbox=~/dev/foo_shared
I installed all the dependencies with profiling enabled: cabal install --only-dependencies --enable-library-profiling --enable-executable-profiling
I configured the foo package so that it includes profiling RTS: cabal configure --enable-profiling --enable-executable-profiling
I tried to build with cabal build
Everything builds up correctly, but doesn’t link. I then rebuilt with cabal build -v3, and this is the linker part (the most interesting part):
c:/program files/haskell platform/2014.2.0.0/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lHSrts_debug_p
I googled that, and IIRC, it’s because I lack the profiling library for the GHC’s RTS. I never found it for Windows :( Last information, I’m on Windows 10, not sure it helps though.
Problem solved. The issue is due to the fact I’m using -debug on the command line interface to GHC. I’ve been told -debug and -p are not compatible, hence the error.

How to install OpenCV 2.0 on win32

I need to install OpenCV on Win32. I do not have it installed currently. I downloaded OpenCV-2.0.0a-win32.exe and ran it. What the heck do I do now? There are no .lib's and whatnot.
I found some instructions for building the release using cmake at http://opencv.willowgarage.com/wiki/InstallGuide . I downloaded the latest and greatest cmake, and tried to follow the instructions, but I was guessing. No joy.
I specified VC++9 when I did the "configure," but cmake built a VC++ 6 dsw file. No vcproj. I converted the dsw into a vc++9 vcproj anyway, just to see if it would work. Nope. It compiled lots of files, but many failed because it could not find omp.h. Sure enough, it's not there, anywhere. The build log said, 'A tool returned an error code from "Performing Custom Build Step".'
I am lost.
Ideally, I would like to find a full installation with all the files pre-built for Win32 vc++ 2008. Failing that, I need instructions that even I can follow. Short sentences and small words, but lots of them.
Please help!
UPDATE: I tried to build just CXCORE. It complained, "cannot open file 'VCOMPD.lib'" There's that OMP again.
For version 2.0, you must build the project from source.
Here's what you will need:
The OpenCV installer.
CMake. Here's the CMake installer.
Instructions for using CMake to install OpenCV-2.0.01-win32. Those instructions need an extra step if you are using a vc++ Express edition. In that case you must un-check ENABLE_OPENMP when running the CMake GUI.
Instructions for setting up an application project. (Thanks to mloskot for this find.)
If you've installed OpenCV-2.0.0a-win32.exe then it will install pre-built DLLs and libs. Then you just have to follow the instructions in this tutorial.
I recommend that you wipe the folder you previously installed OpenCV2.0 in and reinstall it.
Update:
Well sorry it didn't work out. I suggest the following then: check out the latest version from the SVN repository, https://code.ros.org/svn/opencv/trunk/opencv with any SVN client - I use TortoiseSVN.
Then run CMake (I see you've already installed it) on the source folder and then compile the Solution file. This should work - it does for me.
I apologize for my old answer - I had started off with OpenCV a few months ago in the same way and assumed that downloading the Gold version would still work - apparently not.
OMP
The OMP issue may arise from the checked Enable OpenMP in the CMake config. Try unchecking that .. might solve your initial problem.
I followed Jive Dadson's procedure to get OpenCV2.0 to work on Visual Studio 2010 Express (disabled OMP).
All went good until compilation of the generated stuff in Debug and Release. In both cases got this error: "LINK : fatal error LNK1181: cannot open input file '../../lib/Release/cv200.lib'"
in debug the only difference is that the library is cv200d.lib.
EDIT: I solved by downloading the latest svn snapshot for OpenCV2.0. One additional thing on Vista/7: it may be good to execute CMake as administrator.
Download OpenCV installer for Windows
Read OpenCV-2.0.0a-win32.Readme.Please.txt
Follow OpenCV with Visual C++ 6.0, 2005 Express, and 2008 Express in order to create project using OpenCV

Resources