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

segmentation fault in augmatch with no input file #556

Closed
MatthewHannigan opened this issue Apr 13, 2018 · 5 comments
Closed

segmentation fault in augmatch with no input file #556

MatthewHannigan opened this issue Apr 13, 2018 · 5 comments

Comments

@MatthewHannigan
Copy link

MatthewHannigan commented Apr 13, 2018

This is on MacOS with Augeas 1.10.1 installed with Homebrew.

$ augmatch
Expected an input file
Segmentation fault: 11
@lutter
Copy link
Member

lutter commented Apr 17, 2018

That's very strange - that doesn't happen on Linux:

>augmatch 
Expected an input file
Try 'augmatch --help' for more information.

Looking at the source, the only thing that happens after printing Expected an input file is that it prints the Try ... line and then calls exit. Could progname be NULL ?

I don't have an OSX machine where I could try this out around - any chance you could try this under a debugger and see if progname is indeed NULL ?

@MatthewHannigan
Copy link
Author

MatthewHannigan commented Apr 20, 2018

This is what I got. I can get the source and compile it myself if this isn't enough.

(lldb) r
Process 50878 launched: '/usr/local/bin/augmatch' (x86_64)
Expected an input file
Process 50878 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1000000)
    frame #0: 0x00007fff5958c232 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
->  0x7fff5958c232 <+18>: pcmpeqb (%rdi), %xmm0
    0x7fff5958c236 <+22>: pmovmskb %xmm0, %esi
    0x7fff5958c23a <+26>: andq   $0xf, %rcx
    0x7fff5958c23e <+30>: orq    $-0x1, %rax
Target 0: (augmatch) stopped.

@MatthewHannigan
Copy link
Author

stacktrace:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1000000)
  * frame #0: 0x00007fff5958c232 libsystem_c.dylib`strlen + 18
    frame #1: 0x00007fff595d0a86 libsystem_c.dylib`__vfprintf + 4716
    frame #2: 0x00007fff595f8059 libsystem_c.dylib`__v2printf + 473
    frame #3: 0x00007fff595f82e9 libsystem_c.dylib`__xvprintf + 310
    frame #4: 0x00007fff595cf742 libsystem_c.dylib`vfprintf_l + 54
    frame #5: 0x00007fff595c83c9 libsystem_c.dylib`fprintf + 176
    frame #6: 0x0000000100001d18 augmatch`main + 1572
    frame #7: 0x00007fff5953c015 libdyld.dylib`start + 1

@MatthewHannigan
Copy link
Author

Closed by mistake.

@lutter lutter closed this as completed in a5e9d2e Apr 23, 2018
@lutter
Copy link
Member

lutter commented Apr 23, 2018

I found the problem: a missing include of libgen.h. Commit a5e9d2e addresses that. Let me know if that doesn't fix it for you.

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

2 participants