genuinetools/weather

Get segmentation fault on WSL

sdaaish opened this issue · 10 comments

On WSL I get "Segmentation fault" if I don't run it with "sudo" the first time. After one run with sudo it works as a normal user.

My WSL version= Description: Ubuntu 14.04.5 LTS

how did you download it the binaries or via go get? thats super odd

what are the permissions on the binary itself, the binary doesnt need any perms, it only hits network endpoints, it never even writes to a file

I did as the manual said (top of the readme), ie with go get. The binary gets the right permissions, executable. I tried run it as ~/golang/bin/weather and it gets the segmantation fault.

I tried to build it in src, and ran that binary to, with same message. One run with sudo make it work, and after that I don't need sudo. My guess there is some file that needs a touch as root.

Note: I run W10 1703, Enterprise edition.

And as I tested at home, doing the same on W10 Home Edition, Build 17025 with Ubuntu 1604 WSL, no problem. Works as expected. Maybe that can narrow it down. Should probably test some other go-program to see if I get the same problem on the work-box.

I did a strace, don't know if there are other stuff I can try for debug, or if this even help.

gettimeofday({1513067992, 727720}, NULL) = 0
gettimeofday({1513067992, 727876}, NULL) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
gettimeofday({1513067992, 728747}, NULL) = 0
epoll_wait(4, {}, 128, 0)               = 0
futex(0x7f47361ee4f8, FUTEX_WAKE, 1)    = 1
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7f473622fff0} ---
+++ killed by SIGSEGV (core dumped) +++
Segmenteringsfel (minnesutskrift skapad)

Last line is Segmentfault, running with local env.
I can reproduce it fairly often, usually the first time I run this in WSL. After the first fail it runs OK 1-3 times and then fails again a couple of times.

Not even sudo helps, I get coredumps even with that.

This could just be my environment that is strange since it works in later versions of WSL. Or maybe something else in windows that interferes with the process.

I think I just upgrade/reinstall my installation av WSL to see if it goes away. My initial thought was that it had something to to with permissions since it worked that time. But now it's more likely a local problem.

Adds an example to show what it's like.

sdaa@VBYSDAA1:~
$ weather
Segmenteringsfel (minnesutskrift skapad)
sdaa@VBYSDAA1:~
$ weather
Segmenteringsfel (minnesutskrift skapad)
sdaa@VBYSDAA1:~
$ weather
Segmenteringsfel (minnesutskrift skapad)
sdaa@VBYSDAA1:~
$ weather
Segmenteringsfel (minnesutskrift skapad)
sdaa@VBYSDAA1:~
$ weather
                          .':loolc;.
                       .o0NNNXKKKXNNXk:
                  .,::kXNKo,.     .:kXNXo:;,.
               ;kXNNNNNXc            .xNNNNNNKd.
             .0NNk:',:odccc:,.         ....,lKNXd
            .KNXdlOXNNNNNNNNNNXOo,            dNNd
            cXNNNNKd:'.    .';o0NNKl.         .NNX
      .';cccxNNXd'              .oXNXoccc;'.  ,NNK
   .cOXNNNNNNNO.                  .kNNNNNNNXOoXNX'
  oXNXx;..  ..                      ..   .;dXNNX.
.ONNd.                                      .oXNO.
xNNo                                          lNNk
XNN.                                          .NNX
0NN,                                          .NNK
;XN0.                                        .ONNc
 ;XNXo.        .                           .lXNX:
  .dXNX0dlcclx0Xo.              .oXKxoccldOXNXx.
     ,ok0XXXX0kKNN0o;'.    ..;o0NNKk0KXXX0ko,
                'lOXNNNNNNNNNNXOo,
                    :x0XNNX0x:.

Current weather is Overcast in Lidingö in Stockholms Lan for December 12 at 10:15am STD
The temperature is 0.9°C, but it feels like -0.86°C

  Ick! The humidity is 97%
  The wind speed is 1.58 m/s N
  The cloud coverage is 100%
  The visibility is 5.2 kilometers
  The pressure is 985.92 mbar

sdaa@VBYSDAA1:~

I haven't noticed anything on my WSL instance. I did use one of Jessie's scripts to set it up though

I cant repo but let me know if you still can

After I crashed my WSL-instance I reinstalled it with 16.04, and have not seen that error again. So it was probably some local stuff going on.