Coder Social home page Coder Social logo

Will not run on Ubuntu 14.04 about comp-cpp HOT 23 CLOSED

gto76 avatar gto76 commented on September 28, 2024
Will not run on Ubuntu 14.04

from comp-cpp.

Comments (23)

gto76 avatar gto76 commented on September 28, 2024

Does anybody else get this error and does anybody have any ideas what is the problem?

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

Just executed in a clean docker instance of ubuntu 14.04 and I get the exact same issue. This proves it is nothing to do with what I have installed.

run: line 13:  3430 Aborted                 (core dumped) ./comp
root@446c27b4c950:/comp-cpp-master# 

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

What compiler etc are you using?

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

I'm using gcc and g++ version 4:4.9.2-2 on Debian testing

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

I don't know if this is the issue but Do you have ncurses-bin installed?
Program is using:

system("reset");
system("clear");

to clean the screen

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

I think I found one problem:
the echo command in makefile (line 48) prints -e option instead of accepting it as option.
Should have used printf instead of echo

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

Will check that out in a sec. (BTW, same issue in centos)

from comp-cpp.

jgowans avatar jgowans commented on September 28, 2024

Same issue.
GDB backtrace is as follows:

Program received signal SIGABRT, Aborted.
0x00007ffff722bcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0 0x00007ffff722bcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff722f0d8 in __GI_abort () at abort.c:89
#2 0x00007ffff7b366b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff7b34836 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff7b34863 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff7b34aa2 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff7b86ae5 in std::__throw_regex_error(std::regex_constants::error_type) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x000000000041637d in std::__detail::_Compiler<char const*, std::regex_traits >::_M_bracket_expression() ()
#8 0x0000000000415119 in std::__detail::_Compiler<char const*, std::regex_traits >::_M_atom() ()
#9 0x000000000041390b in std::__detail::_Compiler<char const*, std::regex_traits >::_M_term() ()
#10 0x0000000000412052 in std::__detail::_Compiler<char const*, std::regex_traits >::_M_alternative() ()
#11 0x0000000000410b7c in std::__detail::_Compiler<char const*, std::regex_traits >::_M_disjunction() ()
#12 0x000000000040f2a8 in std::__detail::_Compiler<char const*, std::regex_traits >::_Compiler(char const* const&, char const* const&, std::regex_traits&, unsigned int) ()
#13 0x000000000040d845 in std::shared_ptrstd::__detail::_Automaton std::__detail::__compile<char const*, std::regex_traits >(char const* const&, char const* const&, std::regex_traits&, unsigned int) ()
#14 0x000000000040c823 in std::basic_regex<char, std::regex_traits >::basic_regex(char const*, unsigned int) ()
#15 0x000000000040a0d9 in Renderer::insertActualValues(std::string) ()
#16 0x0000000000409d8f in Renderer::renderState(Printer, Ram, Cpu) ()
#17 0x0000000000402d52 in drawScreen() ()
#18 0x000000000041a851 in redrawScreen () at src/output.c:103
#19 0x0000000000404b9e in main ()
(gdb)

Also, just before the core dump, the program prints the following:
"
terminate called after throwing an instance of 'std::regex_error'
what(): regex_erro
"

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

I do have ncurses-bin installed

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

when I run the command in the terminal, it works fine. where are you seeing the -e printed out?

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

Output from make command:

mkdir -p obj
g++ -c -std=c++11 -Wall -o obj/comp.o src/comp.cpp 
g++ -MM -std=c++11 -Wall -MT 'obj/comp.o' src/comp.cpp > obj/comp.d
g++ -c -std=c++11 -Wall -o obj/renderer.o src/renderer.cpp 
g++ -MM -std=c++11 -Wall -MT 'obj/renderer.o' src/renderer.cpp > obj/renderer.d
g++ -c -std=c++11 -Wall -o obj/util.o src/util.cpp 
g++ -MM -std=c++11 -Wall -MT 'obj/util.o' src/util.cpp > obj/util.d
gcc -c -std=gnu11 -g -Wall -O3 -o obj/environment.o src/environment.c
src/environment.c: In function ‘disableRepeatAndCursor’:
src/environment.c:86:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
   system("xset -r"); 
         ^
src/environment.c:88:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
   system("setterm --repeat off");
         ^
src/environment.c: In function ‘resetConsole’:
src/environment.c:104:8: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
  system("reset");
        ^
src/environment.c: In function ‘enableRepeatAndCursor’:
src/environment.c:115:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
   system("xset r");
         ^
src/environment.c:117:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
   system("setterm --repeat on");
         ^
src/environment.c:119:8: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
  system("clear");
        ^
gcc -MM -std=gnu11 -g -Wall -O3 -MT 'obj/environment.o' src/environment.c > obj/environment.d
gcc -c -std=gnu11 -g -Wall -O3 -o obj/output.o src/output.c
gcc -MM -std=gnu11 -g -Wall -O3 -MT 'obj/output.o' src/output.c > obj/output.d
g++ -o comp obj/comp.o obj/renderer.o obj/util.o obj/environment.o obj/output.o

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

I fixed the -e problem. It got printed to the drawing.hpp file (this file gets generated by makefile and contains a /src/resources/drawing textfile inside a variable)

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

Thanks, will test it out now and report back

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

I'm afraid it still isn't working. Could there be a similar issue elsewhere?

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

Could it be an issue with line endings?
This is what the file looks like in vim

#ifndef DRAWING_H^M
#define DRAWING_H^M
^M
#include <string>^M
^M
using namespace std;^M
^M
// Automaticaly generated file from resources/drawing textfile.^M
// Do not edit this line.^M

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

src/drawing.hpp that is

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

Maybe, the backtrace from jgowans shows that there is some regex problem here:
https://github.com/gto76/comp-cpp/blob/master/src/renderer.cpp#L39-52

from comp-cpp.

gjhenrique avatar gjhenrique commented on September 28, 2024

It seems that std::regex is broken for g++-4.8.
http://stackoverflow.com/questions/12530406/is-gcc-4-7-and-gcc-4-8-buggy-about-regular-expressions

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

Will remove the regex part, just a sec...

from comp-cpp.

jgowans avatar jgowans commented on September 28, 2024

Alternatively, if you can't get rid of the regex, you could use the boost regex lib which worked for me when I linked against it. Very sub-ideal to introduce a boost dependency just for regex. I hope you manage to remove it!

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

I removed the regex parts

from comp-cpp.

gto76 avatar gto76 commented on September 28, 2024

Works for me now on Ubuntu 14.04,
Thanks everyone!

from comp-cpp.

woverton avatar woverton commented on September 28, 2024

Works for me!!! :D

Feel free to close the issue :)

from comp-cpp.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.