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

Segfault on openSUSE 13.1 #106

Closed
sudden6 opened this issue Mar 20, 2014 · 19 comments
Closed

Segfault on openSUSE 13.1 #106

sudden6 opened this issue Mar 20, 2014 · 19 comments
Labels

Comments

@sudden6
Copy link

sudden6 commented Mar 20, 2014

Due to some problem with ncurses toxic doesn't run on openSUSE

backtrace: https://gist.github.com/sudden6/9652660

First problem I see is ncurses not being found: https://gist.github.com/sudden6/9674035
it is definitly installed on my system, including the devel packages.

The second problem is the segfault, which I have no idea how this is happening.

@jin-eld
Copy link
Contributor

jin-eld commented Mar 20, 2014

On Thu, Mar 20, 2014 at 02:20:02PM -0700, sudden6 wrote:

Due to some problem with ncurses toxic doesn't run on openSUSE

backtrace: https://gist.github.com/sudden6/9652660

First problem I see is ncurses not being found: https://gist.github.com/sudden6
/9674035
it is definitly installed on my system, including the devel packages.

Regarding the build: you should probably try the master branch with the
autotools build system, it is known to work. If there is a build problem on master, please let me know, so I can fix it.

@stqism stqism added the bug label Mar 20, 2014
@netbsduser
Copy link
Contributor

The segmentation fault occurs in an ncurses-internal subroutine.

Could the OP please post the checksums of /lib64/libncurses.so and /usr/lib64/libncurses.so, from which we can find out if the two libncurses.so are the same or different?

@stqism
Copy link
Contributor

stqism commented Mar 20, 2014

@jin-eld @irixuser is 100% right, this is an issue about curses functions being missing in the Toxic code, pleas stop making it about build systems.

@stqism
Copy link
Contributor

stqism commented Mar 20, 2014

@sudden6 I have a theory that your -lncurses is defaulting to some odd curses installed, we might want to try from a clean slate.

@sudden6
Copy link
Author

sudden6 commented Mar 20, 2014

@jin-eld I tried it with autotools first, also no luck same error
@irixuser this was a good idea i found out /usr/lib64/libncurses.so is just linking to /lib64/libncurses.so with this ld script:
cat /usr/lib64/libncurses.so
/* GNU ld script */
INPUT(/lib64/libncurses.so.5 AS_NEEDED(-ltinfo))
@stqism I tried it with a fresh install in a virtual maschine same issue, same backtrace

@jin-eld
Copy link
Contributor

jin-eld commented Mar 20, 2014

@sudden6: please clarify, I understand you have the segfault no matter what you use to build, but do you also have the problem of ncurses not being found? If configure did not detect ncurses, please post me your config.log from the autotools configure run so I can see why it could not detect the ncurses library, thanks.

@sudden6
Copy link
Author

sudden6 commented Mar 20, 2014

here the conf.log with autotools: https://gist.github.com/sudden6/9675944
With some help from @irixuser and @stqism I managed to manually add the build flags ncurses5-config outputs to the makefile

@jin-eld
Copy link
Contributor

jin-eld commented Mar 20, 2014

Well, wait, that log shows me that ncurses was actually found:
configure:5662: checking for ncursesw5-config
configure:5680: found /usr/bin/ncursesw5-config
configure:5693: result: /usr/bin/ncursesw5-config
configure:5702: checking ncurses cflags
configure:5705: result: -I/usr/include/ncursesw
configure:5708: checking ncurses libraries
configure:5711: result: -lncursesw -ltinfo

Configure does not abort but run through... so, do you get an error when you run "make"?

@sudden6
Copy link
Author

sudden6 commented Mar 21, 2014

@jin-eld ok, then it only isn't found with the bsdmake branch
No make doesn't show any errors.
The built executable still segfaults with the same error as with the bsdmake branch

@sudden6
Copy link
Author

sudden6 commented Mar 23, 2014

Maybe the sources of libncurses used in opensuse can help?
http://download.opensuse.org/source/distribution/13.1/repo/oss/suse/src/ncurses-5.9-33.1.2.src.rpm
In ncurses.spec there is some sort of configure script which generates different configs. Maybe the buid script just has to link to a different library on openSUSE?

@jin-eld
Copy link
Contributor

jin-eld commented Mar 23, 2014

From what I can see it compiles ncurses5 and ncurses6, at the same time a pkg-config configuration file is not provided. In this scenario we try to use ncurses5.

You could try to override the default behavior and try to link vs. ncurses6 and see what happens.
To do this run the configure script and add the following parameters:
./configure NCURSES_CFLAGS="-I/usr/include/ncurses6/ncurses -I/usr/include/ncurses6" NCURSES_LIBS="-L/usr/lib64/ncurses6 -lncurses -ltinfo"

If I got it right, then it should attempt to link vs. ncurses6... of course we don't know if it will help with the segfault, but it's worth a try.

@towlie
Copy link

towlie commented Mar 25, 2014

@sudden6 Does this happen too? (second comment)
#108

@towlie
Copy link

towlie commented Mar 26, 2014

@sudden6
I was able to solve this issue by uninstall ncurses and use a selfcompiled ncurses-5.9 instead.

@sudden6
Copy link
Author

sudden6 commented Mar 28, 2014

Sorry for the late reply.
First of all the issue isn't solved :(
I tried to compile it with the following:
./configure NCURSES_CFLAGS="-I/usr/include/ncurses6/ncursesw -I/usr/include/ncurses6" NCURSES_LIBS="-L/usr/lib64/ncurses6 -lncursesw -ltinfo"
But this didn't help. I used ncursesw instead of ncurses because else I would get an error of a function not being found. But this just produced the same errors as usual and I could not get it to link against libncurses.so.6.

Then I tried the bsdbuild branch, because I could easily modify the makefile directly and got the following errors:
libncursesw6: https://gist.github.com/sudden6/84d602aee61c07ad2afa
libncursesw5: https://gist.github.com/sudden6/b6a5effc9f8c173e5d93

personally I think it might be a threading problem as someone mentioned, because of the calls to libpthread on the end of the stacktrace.

@JFreegman
Copy link
Owner

@sudden6 there's an easy way to see if it's a threading issue. git checkout one commit before it was added (27c5013) and see if it segfaults. If it doesn't, try the commit after it was added (ac82961).

@sudden6
Copy link
Author

sudden6 commented Mar 28, 2014

@JFreegman It worked!
In 27c5013 toxic worked without problems :) The next commit I was able to build was 7f70345 and there it segfaulted...

@sudden6
Copy link
Author

sudden6 commented Apr 14, 2014

This is fixed now. I don't know why but maybe it was my fault, because on my laptop it doesn't work but on a vm on my pc and on the pc it does...

@sudden6 sudden6 closed this as completed Apr 14, 2014
@aliencq
Copy link

aliencq commented Jul 25, 2014

The problem is not solved. I have same issue with my opensuse 13.1 and recent toxic.

@JFreegman JFreegman reopened this Jul 25, 2014
@JFreegman
Copy link
Owner

Problem seems fixed now (02b192d). It was a rare race condition where the windows thread was trying to print to the prompt window before it was initialized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants