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

Error when trying to build fish (void show_stackframe / backtrace_symbols_fd) #2993

Closed
sapomuyverde opened this Issue May 3, 2016 · 17 comments

Comments

Projects
None yet
4 participants
@sapomuyverde

Hi,

Trying to build fish-shell I get some errors related to void show_stackframe and backtrace_symbols_fd It was not declared in this area:

my environment:
Cygwin 2.5.1(0.297/5/3) x86_64 under Windows10 64bits

I did the following:
downloading from Git

  1. autoconf [if building from Git] -> Ok
  2. ./configure ->OK
  3. make

output:
g++ -g -O2 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fno-exceptions -Wall -Wno-sign-compare -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR="/usr/local/share/locale" -DPREFIX=L"/usr/local" -DDATADIR=L"/usr/local/share" -DSYSCONFDIR=L"/usr/local/etc" -DBINDIR=L"/usr/local/bin" -DDOCDIR=L"/usr/local/share/doc/fish" -DFISH_BUILD_VERSION="2.2.0-856-ged086fb" -c src/common.cpp -o obj/common.o
src/common.cpp: En la función ‘void show_stackframe()’:
src/common.cpp:77:37: error: ‘backtrace’ no se declaró en este ámbito
trace_size = backtrace(trace, 32);
^
src/common.cpp:79:58: error: ‘backtrace_symbols_fd’ no se declaró en este ámbito
backtrace_symbols_fd(trace, trace_size, STDERR_FILENO);
^
Makefile:765: fallo en las instrucciones para el objetivo 'obj/common.o'
make: *** [obj/common.o] Error 1

I appreciate any help.

Regards,
Javier

@krader1961 krader1961 added the bug label May 4, 2016

@krader1961 krader1961 added this to the next-2.x milestone May 4, 2016

@krader1961 krader1961 self-assigned this May 4, 2016

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 May 4, 2016

Contributor

The problem is that your C++ environment doesn't provide those functions so the ones in src/fallback.cpp are meant to be used. However, they aren't declared in src/fallback.h which is why you're getting that error. Since I've been working hard for a couple of months to fix these types of issues I'll take care of it.

Contributor

krader1961 commented May 4, 2016

The problem is that your C++ environment doesn't provide those functions so the ones in src/fallback.cpp are meant to be used. However, they aren't declared in src/fallback.h which is why you're getting that error. Since I've been working hard for a couple of months to fix these types of issues I'll take care of it.

@krader1961 krader1961 closed this in 3ad5c7c May 4, 2016

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 May 4, 2016

Contributor

@sapomuyverde: Please pull git head and see if my change fixes this for you. If not please reopen.

Contributor

krader1961 commented May 4, 2016

@sapomuyverde: Please pull git head and see if my change fixes this for you. If not please reopen.

@sapomuyverde

This comment has been minimized.

Show comment
Hide comment
@sapomuyverde

sapomuyverde May 4, 2016

Hi,
@krader1961: I appreciate your help, I tried again, but now I get this output:

g++ -g -O2 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fno-exceptions -Wall -Wno-sign-compare -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR="/usr/local/share/locale" -DPREFIX=L"/usr/local" -DDATADIR=L"/usr/local/share" -DSYSCONFDIR=L"/usr/local/etc" -DBINDIR=L"/usr/local/bin" -DDOCDIR=L"/usr/local/share/doc/fish" -DFISH_BUILD_VERSION="2.2.0-868-g527e5f5" -c src/env_universal_common.cpp -o obj/env_universal_common.o
src/env_universal_common.cpp: En la función miembro ‘bool env_universal_t::open_temporary_file(const wcstring&, wcstring_, int_)’:
src/env_universal_common.cpp:578:51: error: ‘mkostemp’ no se declaró en este ámbito
result_fd = mkostemp(narrow_str, O_CLOEXEC);
^
Makefile:765: fallo en las instrucciones para el objetivo 'obj/env_universal_common.o'
make: *** [obj/env_universal_common.o] Error 1

Regards,
Javier

sapomuyverde commented May 4, 2016

Hi,
@krader1961: I appreciate your help, I tried again, but now I get this output:

g++ -g -O2 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fno-exceptions -Wall -Wno-sign-compare -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR="/usr/local/share/locale" -DPREFIX=L"/usr/local" -DDATADIR=L"/usr/local/share" -DSYSCONFDIR=L"/usr/local/etc" -DBINDIR=L"/usr/local/bin" -DDOCDIR=L"/usr/local/share/doc/fish" -DFISH_BUILD_VERSION="2.2.0-868-g527e5f5" -c src/env_universal_common.cpp -o obj/env_universal_common.o
src/env_universal_common.cpp: En la función miembro ‘bool env_universal_t::open_temporary_file(const wcstring&, wcstring_, int_)’:
src/env_universal_common.cpp:578:51: error: ‘mkostemp’ no se declaró en este ámbito
result_fd = mkostemp(narrow_str, O_CLOEXEC);
^
Makefile:765: fallo en las instrucciones para el objetivo 'obj/env_universal_common.o'
make: *** [obj/env_universal_common.o] Error 1

Regards,
Javier

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 May 5, 2016

Contributor

@sapomuyverde: That's because the configure script decided your system has a mkostemp() function. If you look in your config.h file you should find a line like

#define HAVE_MKOSTEMP 1

Did you copy your git repo from another system and forget to run make clean then ./configure? If you did those two steps what does the config.log say regarding mkostemp? Also, are you using a particularly old or new Cygwin environment? It's probably the latter since you say you're using Cygwin on Windows 10.

Contributor

krader1961 commented May 5, 2016

@sapomuyverde: That's because the configure script decided your system has a mkostemp() function. If you look in your config.h file you should find a line like

#define HAVE_MKOSTEMP 1

Did you copy your git repo from another system and forget to run make clean then ./configure? If you did those two steps what does the config.log say regarding mkostemp? Also, are you using a particularly old or new Cygwin environment? It's probably the latter since you say you're using Cygwin on Windows 10.

@krader1961 krader1961 reopened this May 5, 2016

@sapomuyverde

This comment has been minimized.

Show comment
Hide comment
@sapomuyverde

sapomuyverde May 5, 2016

Hi @krader1961: to get/build fish-shell I did:
git clone git://github.com/fish-shell/fish-shell.git
autoconf
make clean
./configure
make

and the error continues.

config.h content:
/ * Define to 1 if you Have the ` mkostemp 'function . * /
#define HAVE_MKOSTEMP 1

and this is the config.log say regarding mkostemp
configure:5089: checking for mkostemp
| #define HAVE_MKOSTEMP 1
ac_cv_func_mkostemp=yes

my environment:
Cygwin 2.5.1(0.297/5/3) x86_64 under Windows10 64bits

what else I should consider for my work environment, any other help?.

Regards,
Javier

Hi @krader1961: to get/build fish-shell I did:
git clone git://github.com/fish-shell/fish-shell.git
autoconf
make clean
./configure
make

and the error continues.

config.h content:
/ * Define to 1 if you Have the ` mkostemp 'function . * /
#define HAVE_MKOSTEMP 1

and this is the config.log say regarding mkostemp
configure:5089: checking for mkostemp
| #define HAVE_MKOSTEMP 1
ac_cv_func_mkostemp=yes

my environment:
Cygwin 2.5.1(0.297/5/3) x86_64 under Windows10 64bits

what else I should consider for my work environment, any other help?.

Regards,
Javier

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 May 5, 2016

Contributor

So autoconf has decided your system has a working mkostemp() function but it hasn't been declared in any system header included by the fish source. It might be that your system really doesn't have that function and autoconf is doing something wrong. It's also possible fish simply needs to #include a different header.

Find the system header files. These are typically in /usr/include but may be somewhere else in a cygwin build environment. If they're not in /usr/include try find / -name stdio.h. Once you've found the right directory try grep mkostemp ***.h to see if any of them declare that function.

Contributor

krader1961 commented May 5, 2016

So autoconf has decided your system has a working mkostemp() function but it hasn't been declared in any system header included by the fish source. It might be that your system really doesn't have that function and autoconf is doing something wrong. It's also possible fish simply needs to #include a different header.

Find the system header files. These are typically in /usr/include but may be somewhere else in a cygwin build environment. If they're not in /usr/include try find / -name stdio.h. Once you've found the right directory try grep mkostemp ***.h to see if any of them declare that function.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey May 6, 2016

Member

The mkostemp issue is #2952, which I haven't merged back to master yet, but will do shortly. I'll close this for now, as the issue it has been opened for has been solved.

Member

zanchey commented May 6, 2016

The mkostemp issue is #2952, which I haven't merged back to master yet, but will do shortly. I'll close this for now, as the issue it has been opened for has been solved.

@zanchey zanchey closed this May 6, 2016

@sapomuyverde

This comment has been minimized.

Show comment
Hide comment
@sapomuyverde

sapomuyverde May 16, 2016

I still can't build fish-shell.

I did it again git pull:

$ git pull
remote: Counting objects: 52, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 52 (delta 23), reused 10 (delta 10), pack-reused 1
Unpacking objects: 100% (52/52), done.
From git://github.com/fish-shell/fish-shell
   c63c882..51468b7  master     -> origin/master
   c53951b..768277a  Integration_2.3.0 -> origin/Integration_2.3.0
Updating c63c882..51468b7

make clear
FISH_BUILD_VERSION = 2.3b2-135-g51468b7
make: *** No hay ninguna regla para construir el objetivo 'clear'.  Alto.

autoconf
./configure
make

I get:

g++ -g -O2 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fno-exceptions -Wall -Wno-sign-compare  -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR=\"/usr/local/share/locale\" -DPREFIX=L\"/usr/local\" -DDATADIR=L\"/usr/local/share\" -DSYSCONFDIR=L\"/usr/local/etc\" -DBINDIR=L\"/usr/local/bin\" -DDOCDIR=L\"/usr/local/share/doc/fish\"  -DFISH_BUILD_VERSION=\"2.3b2-135-g51468b7\" -c src/history.cpp -o obj/history.o
src/history.cpp: En la función miembro ‘bool history_t::save_internal_via_rewrite()’:
src/history.cpp:1216:52: error: ‘mkostemp’ no se declaró en este ámbito
             out_fd = mkostemp(narrow_str, O_CLOEXEC);
                                                    ^
Makefile:765: fallo en las instrucciones para el objetivo 'obj/history.o'
make: *** [obj/history.o] Error 1

I looked for mkostemp ***.h under C:\Users\gaby\cygwin\usr\include and
I found:
image

image

sapomuyverde commented May 16, 2016

I still can't build fish-shell.

I did it again git pull:

$ git pull
remote: Counting objects: 52, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 52 (delta 23), reused 10 (delta 10), pack-reused 1
Unpacking objects: 100% (52/52), done.
From git://github.com/fish-shell/fish-shell
   c63c882..51468b7  master     -> origin/master
   c53951b..768277a  Integration_2.3.0 -> origin/Integration_2.3.0
Updating c63c882..51468b7

make clear
FISH_BUILD_VERSION = 2.3b2-135-g51468b7
make: *** No hay ninguna regla para construir el objetivo 'clear'.  Alto.

autoconf
./configure
make

I get:

g++ -g -O2 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fno-exceptions -Wall -Wno-sign-compare  -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR=\"/usr/local/share/locale\" -DPREFIX=L\"/usr/local\" -DDATADIR=L\"/usr/local/share\" -DSYSCONFDIR=L\"/usr/local/etc\" -DBINDIR=L\"/usr/local/bin\" -DDOCDIR=L\"/usr/local/share/doc/fish\"  -DFISH_BUILD_VERSION=\"2.3b2-135-g51468b7\" -c src/history.cpp -o obj/history.o
src/history.cpp: En la función miembro ‘bool history_t::save_internal_via_rewrite()’:
src/history.cpp:1216:52: error: ‘mkostemp’ no se declaró en este ámbito
             out_fd = mkostemp(narrow_str, O_CLOEXEC);
                                                    ^
Makefile:765: fallo en las instrucciones para el objetivo 'obj/history.o'
make: *** [obj/history.o] Error 1

I looked for mkostemp ***.h under C:\Users\gaby\cygwin\usr\include and
I found:
image

image

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey May 16, 2016

Member

@sapomuyverde, could you please post the entire contents of the config.log file on Gist or similar?

Member

zanchey commented May 16, 2016

@sapomuyverde, could you please post the entire contents of the config.log file on Gist or similar?

@krader1961 krader1961 reopened this May 16, 2016

@sapomuyverde

This comment has been minimized.

Show comment
Hide comment

sapomuyverde commented May 17, 2016

@zanchey zanchey closed this in 9225b16 May 18, 2016

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey May 18, 2016

Member

OK, this should be fixed again now - the IWYU changes accidentally dropped the config.h include, so it's been restored. Can you let me know if it works for you?

Member

zanchey commented May 18, 2016

OK, this should be fixed again now - the IWYU changes accidentally dropped the config.h include, so it's been restored. Can you let me know if it works for you?

@sapomuyverde

This comment has been minimized.

Show comment
Hide comment
@sapomuyverde

sapomuyverde May 19, 2016

Now I get this output:

g++ -g -O2 -fno-exceptions -Wall -Wno-sign-compare -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR="/usr/local/share/locale" -DPREFIX=L"/usr/local" -DDATADIR=L"/usr/local/share" -DSYSCONFDIR=L"/usr/local/etc" -DBINDIR=L"/usr/local/bin" -DDOCDIR=L"/usr/local/share/doc/fish" -DFISH_BUILD_VERSION="2.3b2-155-g573b379" -c src/common.cpp -o obj/common.o
src/common.cpp: En la función ‘const wcstring_list_t demangled_backtrace(int, int)’:
src/common.cpp:81:59: error: ‘backtrace_symbols’ no se declaró en este ámbito
char *symbols = backtrace_symbols(callstack, n_frames);
^
src/common.cpp:88:9: error: ‘Dl_info’ no se declaró en este ámbito
Dl_info info;
^
src/common.cpp:89:35: error: ‘info’ no se declaró en este ámbito
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
src/common.cpp:89:39: error: ‘dladdr’ no se declaró en este ámbito
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
Makefile:765: fallo en las instrucciones para el objetivo 'obj/common.o'
make: *
* [obj/common.o] Error 1

Now I get this output:

g++ -g -O2 -fno-exceptions -Wall -Wno-sign-compare -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR="/usr/local/share/locale" -DPREFIX=L"/usr/local" -DDATADIR=L"/usr/local/share" -DSYSCONFDIR=L"/usr/local/etc" -DBINDIR=L"/usr/local/bin" -DDOCDIR=L"/usr/local/share/doc/fish" -DFISH_BUILD_VERSION="2.3b2-155-g573b379" -c src/common.cpp -o obj/common.o
src/common.cpp: En la función ‘const wcstring_list_t demangled_backtrace(int, int)’:
src/common.cpp:81:59: error: ‘backtrace_symbols’ no se declaró en este ámbito
char *symbols = backtrace_symbols(callstack, n_frames);
^
src/common.cpp:88:9: error: ‘Dl_info’ no se declaró en este ámbito
Dl_info info;
^
src/common.cpp:89:35: error: ‘info’ no se declaró en este ámbito
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
src/common.cpp:89:39: error: ‘dladdr’ no se declaró en este ámbito
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
Makefile:765: fallo en las instrucciones para el objetivo 'obj/common.o'
make: *
* [obj/common.o] Error 1

@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho May 19, 2016

Member

@sapomuyverde: You can run a command without localization via e.g. env LC_ALL=C make (or begin; set -lx LC_ALL C; make; end). That makes it a bit easier to follow for people who don't speak your language.

In this case I'm assuming "no se declaro en este ambito" means "is not declared in this environment" or similar?

Member

faho commented May 19, 2016

@sapomuyverde: You can run a command without localization via e.g. env LC_ALL=C make (or begin; set -lx LC_ALL C; make; end). That makes it a bit easier to follow for people who don't speak your language.

In this case I'm assuming "no se declaro en este ambito" means "is not declared in this environment" or similar?

@sapomuyverde

This comment has been minimized.

Show comment
Hide comment
@sapomuyverde

sapomuyverde May 19, 2016

This is the output:
$ env LC_ALL=C MAKE
g++ -g -O2 -fno-exceptions -Wall -Wno-sign-compare -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR="/usr/local/share/locale" -DPREFIX=L"/usr/local" -DDATADIR=L"/usr/local/share" -DSYSCONFDIR=L"/usr/local/etc" -DBINDIR=L"/usr/local/bin" -DDOCDIR=L"/usr/local/share/doc/fish" -DFISH_BUILD_VERSION="2.3b2-155-g573b379" -c src/common.cpp -o obj/common.o
src/common.cpp: In function 'const wcstring_list_t demangled_backtrace(int, int ':
src/common.cpp:81:59: error: 'backtrace_symbols' was not declared in this scope
char *symbols = backtrace_symbols(callstack, n_frames);
^
src/common.cpp:88:9: error: 'Dl_info' was not declared in this scope
Dl_info info;
^
src/common.cpp:89:35: error: 'info' was not declared in this scope
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
src/common.cpp:89:39: error: 'dladdr' was not declared in this scope
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
Makefile:765: recipe for target 'obj/common.o' failed
MAKE: *
* [obj/common.o] Error 1

This is the output:
$ env LC_ALL=C MAKE
g++ -g -O2 -fno-exceptions -Wall -Wno-sign-compare -Ipcre2-10.21/src -iquote. -iquote./src/ -DLOCALEDIR="/usr/local/share/locale" -DPREFIX=L"/usr/local" -DDATADIR=L"/usr/local/share" -DSYSCONFDIR=L"/usr/local/etc" -DBINDIR=L"/usr/local/bin" -DDOCDIR=L"/usr/local/share/doc/fish" -DFISH_BUILD_VERSION="2.3b2-155-g573b379" -c src/common.cpp -o obj/common.o
src/common.cpp: In function 'const wcstring_list_t demangled_backtrace(int, int ':
src/common.cpp:81:59: error: 'backtrace_symbols' was not declared in this scope
char *symbols = backtrace_symbols(callstack, n_frames);
^
src/common.cpp:88:9: error: 'Dl_info' was not declared in this scope
Dl_info info;
^
src/common.cpp:89:35: error: 'info' was not declared in this scope
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
src/common.cpp:89:39: error: 'dladdr' was not declared in this scope
if (dladdr(callstack[i], &info) && info.dli_sname) {
^
Makefile:765: recipe for target 'obj/common.o' failed
MAKE: *
* [obj/common.o] Error 1

@faho faho reopened this May 19, 2016

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 May 19, 2016

Contributor

That's due to the backtrace function name demangling code I added recently. I'll take a look at what's needed to make that work on Cygwin or update the autoconf stuff to determine if it's available.

Contributor

krader1961 commented May 19, 2016

That's due to the backtrace function name demangling code I added recently. I'll take a look at what's needed to make that work on Cygwin or update the autoconf stuff to determine if it's available.

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 May 20, 2016

Contributor

The current Cygwin build failure is because Cygwin doesn't have support for any of the backtrace functions. It built before my change because there are dummy stubs in fallback.cpp for the two functions the code used to use but not the backtrace_symbols() and dladdr() functions I introduced. The fix is to simply not even attempt to issue a backtrace on Cygwin. I'll update this issue when I've committed a change to remove that functionality on Cygwin.

Contributor

krader1961 commented May 20, 2016

The current Cygwin build failure is because Cygwin doesn't have support for any of the backtrace functions. It built before my change because there are dummy stubs in fallback.cpp for the two functions the code used to use but not the backtrace_symbols() and dladdr() functions I introduced. The fix is to simply not even attempt to issue a backtrace on Cygwin. I'll update this issue when I've committed a change to remove that functionality on Cygwin.

@sapomuyverde

This comment has been minimized.

Show comment
Hide comment
@sapomuyverde

sapomuyverde May 22, 2016

Finally it worked, thanks to all.

Regards,
Javier

Finally it worked, thanks to all.

Regards,
Javier

@faho faho modified the milestones: fish 2.4.0, next-2.x Sep 4, 2016

@faho faho added the windows label Sep 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment