Orc/levee

core dumped

nkakouros opened this issue · 9 comments

I compiled levee on Arch linux. It can open some files. But a specific one causes it to dump core.

This it the output I get when opening that file:

Requirements:
===
- Unix environment, preferably (and assuming) a GNU/Linux one.

The project dependencies are checked during build and you are notified if sth is
missing. In this case, you need to use your package manager to install them.

If you find that there is sth missing from the checks, open a bug report.

Installation Instructions
===

New Project
---

When you want to setup a new project from scratch, simply:
0. make sure you have [setup gcloud](...)
1. set your preferred value for any variable you want to change in the `vars/` folder
2. run `make build-devel`

Existing Project
---

If a project already exists and you want to sync with it without messing with any Work-In-Progress of other members, follow the steps below:

0. Make sure you have [setup gcloud](...)
1. Install dependencies: `make install`
2. Sync your local installation with the existing project: `make sync target=all`
3. Upload new ssh-keys to google cloud: `make ssh-keys`.
4. If you need to work with windows machines, set their password for your user, eg `make set-win-pass target=metasploitable user=qq`
5. Open the firewall for your machine: `make open`
6. You are ready to connect.
    - Linux instances:`vagrant ssh cuiteur` (*use tab completion to get suggestions for instance names*)
    - Windows instances: Use an RDP client locally to connect.
      - To get the instance's public ip, use `make get-ip target=metasploitable`
      - Use the user and password from step #4. If you lost the password, use `make get-win-pass target=meta*** stack smashing detected ***: <unknown> terminated
                                                                                                                                                                 Aborted (core dumped)
[nikos@nikos-laptop EN2720]$ 



"README.md" 6503 bytes

If you need the README.md file, I can email it to you.

Orc commented

I'd love a copy of the readme.md; also, you're using top of stack, yes? And what compiler and flags are you using? Are you just running configure.sh w/o arguments and letting the system take what it can take? (Also, which version of arch?)

I use the testing repositories of Arch (amd64) and I had just updated before compiling and running Levee. I just used ./configure; make; sudo make install.

Orc commented

I can't reproduce locally? So

  1. can I see your config.log
  2. and the output from cc --version

cc --version:

cc (GCC) 8.2.1 20180831
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

config.log

[echo -n] works
Configuring for [levee]
checking out the C compiler
-rwxr-xr-x 1 nikos nikos 18920 Sep 30 01:19 ngc25124
-rw-r--r-- 1 nikos nikos    61 Sep 30 01:19 ngc25124.c
Looking for cpp
CPP=[cc], CPP_PIPE=[-E -g]
target=CPP, rest=cc
generating config.sed
rm: cannot remove 'ngc25124.c': No such file or directory
looking for install
 (/usr/bin/install)
ngc25124.c:1:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 main() { puts("hello, sailor!"); }
 ^~~~
ngc25124.c: In function ‘main’:
ngc25124.c:1:10: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration]
 main() { puts("hello, sailor!"); }
          ^~~~
target=INSTALL, rest=/usr/bin/install
target=INSTALL_PROGRAM, rest=/usr/bin/install -s -m 755
target=INSTALL_DATA, rest=/usr/bin/install -m 444
target=INSTALL_DIR, rest=/home/nikos/Projects/levee/config.md
looking for header string.h
 (found)
looking for the basename function
looking for header libgen.h
 (found)
looking for header signal.h
 (found)
Looking for the tgetent function
looking for the tgetent function
/usr/bin/ld: /tmp/ccJaEsWj.o: in function `main':
/home/nikos/Projects/levee/ngc25124.c:5: undefined reference to `tgetent'
collect2: error: ld returned 1 exit status
offending command was:
void tgetent();
int main()
{

    tgetent();
}
cc -g -g -o ngc25124 ngc25124.c 
looking for the tgetent function
 (in -lcurses)
looking for header termcap.h
 (found)
looking for the mvcur function
looking for header termios.h
 (found)
looking for the tcgetattr function
find is /usr/bin/find
target=FIND, rest=/usr/bin/find
/usr/bin/ln exists, and ln -s works
target=LN_S, rest=/usr/bin/ln -s
target=NOMK, rest=
target=LIBS, rest= -lcurses
target=DISTCLEAN, rest=rm -f
target=GENERATED_FILES, rest=Makefile
target=CC, rest=cc
target=CFLAGS, rest=-g
target=LDFLAGS, rest=-g
target=CPPFLAGS, rest=
target=srcdir, rest=/home/nikos/Projects/levee
target=prefix, rest=/usr/local
target=exedir, rest=/usr/local/bin
target=bindir, rest=/usr/local/bin
target=sbindir, rest=/usr/local/sbin
target=libdir, rest=/usr/local/lib
target=libexec, rest=/usr/local/lib
target=confdir, rest=/etc
target=mandir, rest=/usr/local/man
target=CONFIGURE_FILES, rest=config.cmd config.sub config.h config.mak config.sed config.md config.log
sed is /usr/bin/sed
target=SED, rest=/usr/bin/sed
generating Makefile
Orc commented

Hmm. It sounds like it's an interaction with gcc 8. Sadly, Arch looks like it's a "if you have to ask, you can't use it" distribution -- my attempts at installing it this afternoon all failed -- so I'm going to have to find a different distribution that's got gcc 8 in it before I can track this defect down.

Orc commented

Intel's Linux distribution uses gcc 8, so I built levee there and tried it on your offending README.md file and was unable to duplicate the core dump, even after applying various sanitizing compile flags.

Could you try building it with debugging turned on, then attach gdb to the process before :e'ing README.md? That should give a stack trace that I can use to zero in on the overflow problem.

Orc commented

Still not working for you, or should I close this?

I didn't have time to revisit this. Let's close it and if it reappears I will reopen it.

Orc commented

Okay, will do!