[Bug 1058509] New: grub segfault in ncurses
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509 Bug ID: 1058509 Summary: grub segfault in ncurses Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: All OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Bootloader Assignee: jsrain@suse.com Reporter: Ralf.Friedl@online.de QA Contact: jsrain@suse.com Found By: --- Blocker: --- The current grub-0.97-204.3.x86_64 has a segfault upon invocation. # gdb grub ... (gdb) run Starting program: /usr/sbin/grub Program received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? () (gdb) where #0 0x00000000 in ?? () #1 0x08084076 in new_prescr () at ../ncurses/tinfo/lib_setup.c:890 #2 0x080722ad in newterm (name=0xffffdde8 "screen", ofp=0x81693e0 <_IO_2_1_stdout_>, ifp=0x8169540 <_IO_2_1_stdin_>) at ../ncurses/base/lib_newterm.c:355 #3 0x0806e25b in initscr () at ../ncurses/base/lib_initscr.c:89 #4 0x08048fb0 in grub_stage2 () at asmstub.c:190 #5 0x08048e8e in main (argc=1, argv=0xffffd444) at main.c:264 "grub --batch" works, but without command completion. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
Jiri Srain
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c6
Torsten Duwe
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c9
--- Comment #9 from Torsten Duwe
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c10
--- Comment #10 from Torsten Duwe
(In reply to Torsten Duwe from comment #6)
Werner, this is obviously caused by your hack in revision 60.
Note that GRUB_LIBS is detected by autoconf; do not override it after detection. grub-configure-check-libncurses was added to get it right,
This patch ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and you hard-coded it afterwards.
Please fix this properly.
About which hack you are talking about?
Adds an autoconf snipped to properly autodetect GRUB_LIBS. And you override the result with a hard coded value. I call that a hack. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c16
Torsten Duwe
Therefor I really appreciated the change to a statically linked grub that no longer needs the 32-Bit libraries. Given the choice I would use grub in batch mode, which still works, and not install the 32-bit libraries.
Thanks for the feedback! A new version is there, linked statically again, but without the configure patch and the result override. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
Torsten Duwe
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c19
--- Comment #19 from Michael Chang
(In reply to Torsten Duwe from comment #10)
(In reply to Dr. Werner Fink from comment #7)
(In reply to Torsten Duwe from comment #6)
and as the linkter script /usr/lib64/libncurses.so and /usr/lib64/libncursese.so to only link libtinfo or lintinfow as needed I do not see for what this patch should resolve
It resolves the error in configure for detecting the availability of ncurses library. configure:6159: result: no configure:6177: checking for wgetch in -lncurses configure:6202: gcc -o conftest -m32 -m32 -O0 -g -DNDEBUG -W -Wall -Wpointer-arith -fno-reorder-functions -fno-stack-protector -fno-strict-aliasing -minline-all-stringops -fno-asynchronous-unwind-tables -fno-unwind-tables -static -Wall -Wmissing-prototypes -Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1 -falign-functions=1 -Wundef conftest.c -lncurses >&5 /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `recur_wgetnstr': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:368: undefined reference to `_nc_screen_of' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:373: undefined reference to `_nc_globals' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:373: undefined reference to `SP' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:377: undefined reference to `_nc_mutex_lock' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:382: undefined reference to `_nc_mutex_unlock' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `recur_wrefresh': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:346: undefined reference to `_nc_screen_of' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:347: undefined reference to `_nc_globals' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:347: undefined reference to `SP' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:351: undefined reference to `_nc_mutex_lock' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:356: undefined reference to `_nc_mutex_unlock' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `_nc_ptr_Escdelay': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:60: undefined reference to `_nc_prescreen' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `set_escdelay': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch.c:91: undefined reference to `SP' -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
Michael Chang
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c22
--- Comment #22 from Dr. Werner Fink
(In reply to Dr. Werner Fink from comment #11)
(In reply to Torsten Duwe from comment #10)
(In reply to Dr. Werner Fink from comment #7)
(In reply to Torsten Duwe from comment #6)
and as the linkter script /usr/lib64/libncurses.so and /usr/lib64/libncursese.so to only link libtinfo or lintinfow as needed I do not see for what this patch should resolve
It resolves the error in configure for detecting the availability of ncurses library.
configure:6159: result: no configure:6177: checking for wgetch in -lncurses configure:6202: gcc -o conftest -m32 -m32 -O0 -g -DNDEBUG -W -Wall -Wpointer-arith -fno-reorder-functions -fno-stack-protector -fno-strict-aliasing -minline-all-stringops -fno-asynchronous-unwind-tables -fno-unwind-tables -static -Wall -Wmissing-prototypes -Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1 -falign-functions=1 -Wundef conftest.c -lncurses >&5 /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `recur_wgetnstr': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:368: undefined reference to `_nc_screen_of' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:373: undefined reference to `_nc_globals' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:373: undefined reference to `SP' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:377: undefined reference to `_nc_mutex_lock' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:382: undefined reference to `_nc_mutex_unlock' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `recur_wrefresh': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:346: undefined reference to `_nc_screen_of' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:347: undefined reference to `_nc_globals' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:347: undefined reference to `SP' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:351: undefined reference to `_nc_mutex_lock' /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:356: undefined reference to `_nc_mutex_unlock' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `_nc_ptr_Escdelay': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:60: undefined reference to `_nc_prescreen' /usr/lib64/gcc/x86_64-suse-linux/7/../../../../lib/libncurses.a(lib_getch.o): In function `set_escdelay': /home/abuild/rpmbuild/BUILD/ncurses-6.1/ncurses/../ncurses/./base/lib_getch. c:91: undefined reference to `SP'
Read /usr/lib64/libncurses.so /* GNU ld script */ INPUT(/lib64/libncurses.so.6 AS_NEEDED(-ltinfo -ldl)) ... and note that with static linking the library libtinfo.a is missed also the command pkg-config ncurses --libs shows -lncurses -ltinfo ... -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
Dr. Werner Fink
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c25
Michael Chang
(In reply to Michael Chang from comment #19)
Read /usr/lib64/libncurses.so
/* GNU ld script */ INPUT(/lib64/libncurses.so.6 AS_NEEDED(-ltinfo -ldl))
... and note that with static linking the library libtinfo.a is missed
I know, that's what the grub-configure-check-libncurses solved. I was giving out the initial error to provide more clues as you've stated that "I do not see for what this patch should resolve". Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c26
Michael Chang
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c28
--- Comment #28 from Swamp Workflow Management
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c29
--- Comment #29 from Swamp Workflow Management
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c32
Michael Chang
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
Jiri Srain
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
Dr. Werner Fink
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
http://bugzilla.suse.com/show_bug.cgi?id=1058509#c35
Michael Chang
Segfaulting continues in 15.0's 0.97-lp150.1.8
You have to update grub, the latest one in update channel should have fixed the problem. https://download.opensuse.org/distribution/leap/15.0/repo/oss/x86_64/grub-0.... -- You are receiving this mail because: You are on the CC list for the bug.
![](https://seccdn.libravatar.org/avatar/3035b38ff33cf86f480bb169b8500b80.jpg?s=120&d=mm&r=g)
http://bugzilla.suse.com/show_bug.cgi?id=1058509
Jiri Srain
participants (1)
-
bugzilla_noreply@novell.com