-
-
Notifications
You must be signed in to change notification settings - Fork 550
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
Segmentation fault: 11 #194
Comments
Thanks for the bug report. My OS X machine is completely broken at the moment, so I cannot reproduce this. Could you please provide a backtrace using gdb? (If you don't know how, just ask.) |
I'm not sure if this is correct or not:
The first one I compiled with I tried from gdb to do this:
but didn't get anything back. |
You have to do the other way around: Does Lwan crash right after starting up, or when a connection is made by a client? |
lol, oh yeah. Well, that fails too. But when I boot lwan, it actually stays running until a client tries to connect. That's when it fails. |
Are you able to get a backtrace when running it that way? |
I may not be doing this right still, but this is what I get:
|
@jwoertink You should try to run with lldb.
and complied with -DCMAKE_BUILD_TYPE=Release
How to fix it on OS X:
|
@lampmanyao Are these fixes something I need to do when I compile, or are they fixes for the project? |
Ok, I tried out lldb, and got some output here
|
Thanks, that looks promising. I need some additional information, though. Could you please post the output of the following commands inside lldb?
|
Here you go.
|
If compiled with The former's call stack just like @jwoertink posted:
and the later's call stack is a little bit different:
If we set a break point at inet_ntop4() and debug it step instruction by step instruction, we could see the assembly code is exactly the same:
It seems not a stack overflow. I can't figure it out what's the difference between |
@lampmanyao How are you compiling with When you build with that flag, does it work for you? |
That is a flag for the compiler/linker. Use -DASAN=OFF and -DUBSAN=OFF when
invoking Cmake. These are only necessary if debugging. You might want to
try a release build as well
…On Wed, May 3, 2017, 10:06 Jeremy Woertink ***@***.***> wrote:
@lampmanyao <https://github.com/LampmanYao> How are you compiling with
-fsanitize=address? If I run cmake .. -DCMAKE_BUILD_TYPE=Debug
-fsanitize=address then I get CMake Error: The source directory blah does
not exist.
When you build with that flag, does it work for you?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#194 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA6mdqJF2R-wOTTKZg17rN2vM-gsMeSks5r2LQYgaJpZM4NE5RY>
.
|
Ah, ok. So the release build still throws the segfault, but I pulled down the latest version on master and built with |
I'll really need to get a Mac to debug this. Preferably a new one, as the
one I have now is a G4 Powerbook that barely runs 10.5.
…On Wed, May 3, 2017, 10:44 Jeremy Woertink ***@***.***> wrote:
Ah, ok. So the release build still throws the segfault, but I pulled down
the latest version on master and built with cmake ..
-DCMAKE_BUILD_TYPE=Debug -DASAN=OFF -DUBSAN=OFF. When running, it doesn't
tank like before, but it never loads. It just hangs there spinning. Making
progress? 😂
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#194 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA6mfzUMzLa6HFiLEAo9ZH2Ni7BJRcfks5r2L0BgaJpZM4NE5RY>
.
|
@jwoertink try this: cmake .. -DCMAKE_BUILD_TYPE=Debug -DASAN=ON -DUBSAN=OFF, it would be ok. |
lol. nope. Tried that, and I got this
|
It seems that this issue has been fixed today. It was a stack misalignment on x86_64 that caused the code to crash on an SSE instruction (that requires 16-byte alignment). Could you please recheck, @jwoertink? |
Sweet! Yup. I got the "It works!" page 👍 I think we're ok to close this out. Thanks for the update. |
or
|
That's weird. Is this on OS X 10.12?
…On Mon, Jul 17, 2017, 05:29 lampman ***@***.***> wrote:
./lwan --help
[1] 15952 killed ./lwan --help
or
lldb ./lwan
(lldb) target create "./lwan"
Current executable set to './lwan' (x86_64).
(lldb) run
error: error: ::posix_spawnp ( pid => 16121, path = './lwan', file_actions
= 0x7fff5fbde278, attr = 0x7fff5fbde288, argv = 0x7fc380c75660, envp =
0x7fc380c71ac0 ) err = Malformed Mach-o file (0x00000058)
(lldb) bt
error: invalid process
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#194 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAA6mU4F3MGWAfX-73alzKwAWd0QlBFXks5sO1O6gaJpZM4NE5RY>
.
|
Help command works fine for me, and I'm on 10.12.5. I built with the release flag. |
Yes. I am on 10.12.5 too. Whatever Release flag or Debug flag, it was killed. @lpereira @jwoertink |
Only when using |
No. Everything got killed. And i tried to set a breakpoint on main:
|
The error says "Malformed Mach-o file". Did you try removing the binary and creating it again? Maybe "make clean all"? |
I tried. But it still crashes. |
I'm getting that with MacOS High Sierra, cmake 3.12.0 and llvm;xcode sdk: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Looks like a cmake mistake as other projects report link wreckage with it. $ otool -v -h ./src/bin/lwan/lwan |
After building from source, I got this error:
I'm running on macOS 10.12.3 built with cmake 3.7.0 and running the default LLVM 8.0.0.
The text was updated successfully, but these errors were encountered: