Open slackhead opened 4 years ago
If I get it, you want to search once and see search results on every page. I added boolean option "document.browse.search.reset", default 1. If you set it to 0, you'll get "search once".
I can see the search terms highlighted, but pressing 'n' doesn't seem to work.
After a quick test with this commit.
What works: Navigating back and forward, or using history, and using search next/previous keys.
What doesnt work yet: Search next in new tab or new window causes a segfault.
Apart from segfault, this is how the original elinks worked.
@slackhead, could you describe step by step how to reproduce segfaults, because it is not obvious for me. Do you have js compiled-in or not?
I don't have js compiled in at the moment because my js package is the wrong version. Also the old js185 that elinks used kept seqfaulting and made elinks crash a lot, so I got used to not using it.
This is how I made it segfault:
1 Do a search in a page. 2 Open a link from that page in a new window or tab 3 Press 'n'
It crashes after a second or 2.
elinks(dump_backtrace+0x25)[0x483865] elinks[0x46176e] elinks[0x461c53] /lib64/libpthread.so.0(+0x113b0)[0x7f20850e73b0] elinks[0x491f10] elinks(do_action+0x62e)[0x487e2e] elinks(send_event+0x7b)[0x4973ab] elinks(in_term+0x669)[0x47bd59] elinks(select_loop+0x48f)[0x4590df] elinks(main+0x38)[0x415f88] /lib64/libc.so.6(__libc_start_main+0xf0)[0x7f20841cb7d0] elinks(_start+0x29)[0x416089]
A specific example that I can repeat:
1 Search duckduckgo for 'linux "reset" framebuffer' 2 Open search box and search for 'reset' 3 Open the first link in the results in a new window 4 Press 'n'
The same happens if opening in a new (only test foreground) tab. This is what I build felinks with (my build script converts to configure options):
FASTMEM=yes HTMLHL=no LZMA=yes TRE=yes BROTLI=yes LIBDOM=no DEBUG=no
MOUSE=no GPM=no EXMODE=no
GUILE=no PERL=yes PYTHON=no LUA=no ECMA=no
FSP=no FTP=yes FINGER=no GOPHER=yes
Looking at that I wonder if fastmem is a problem
*edit: still crashes without fastmem
I cannot reproduce it. If this latest commit did not help, could you compile without backtrace, "catch" coredump, and show: gdb ./elinks core.*
bt
Sorry for the delay. This is after doing the search as above, opening a new tab on first link and pressing ' n'.
Edit* try again
Core was generated by
elinks'.
Program terminated with signal SIGABRT, Aborted.
(gdb) bt full
No symbol table info available.
No symbol table info available.
No locals.
s = <optimized out>
saved_errno = 0
No symbol table info available.
pt = 0x0
y = <optimized out>
step = <optimized out>
ret = FIND_ERROR_HIT_BOTTOM
x = <optimized out>
at search.c:1335
number = <optimized out>
at search.c:1343
No locals.
verbose=verbose@entry=0) at action.c:191
status = FRAME_EVENT_OK
term = 0x1771d30
doc_view = 0x17719c0
link = <optimized out>
---Type
event = 369504800
action_id = ACT_MAIN_FIND_NEXT
doc_view = 0x17719c0
utf8_io = <optimized out>
key = 110
modifier = KBD_MOD_NONE
info = 0x0
interlink = 0x1771ee0
tev = {ev = EVENT_KBD, info = {mouse = {x = 110, y = 0, button = 0}, keyboard = {key = 110,
modifier = KBD_MOD_NONE}, size = {width = 110, height = 0}}}
ev = 0x1771ef8
interlink = 0x1771ee0
r = <optimized out>
iq = 0x1771ef8 "\001"
k = 0
timeout = <optimized out>
i = 3
n = 1
has_timer = <optimized out>
t = {sec = 0, usec = 391614}
last_time = {sec = 1604493414, usec = 878123}
select_errors = 0
No locals. `
I've just spotted a bug in my build script that is the cause of --enable-debug not building :-)
CFLAGS=-m64 -O2 -fPIC -L/usr/lib64 -ggdb CXXFLAGS=-m64 -O2 -fPIC -L/usr/lib64 -ggdb
./configure --prefix=/usr --libdir=/usr/lib64 --sysconfdir=/etc --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --docdir=/usr/doc/felinks-git20201104 --with-bzlib --with-zlib --disable-nls --build=x86_64-slackware-linux
Hmm, as root echo core > /proc/sys/kernel/core_pattern Then as plain user, ./configure \ ... \ --disable-backtrace
Run elinks, and in case of segfault core will be generated. Here is sample a bit artificilal:
gdb src/elinks core.17006
Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `src/elinks'. Program terminated with signal SIGSEGV, Segmentation fault.
at search.c:1316
1316 if (!doc_view->document->number_of_search_points) { (gdb) bt
at search.c:1316
at action.c:191
Such backtrace with line numbers and parameters, would help a little.
Program terminated with signal SIGSEGV, Segmentation fault.
at search.c:1374
1374 x = pt[number].x; [Current thread is 1 (Thread 0x7fc9b77dd700 (LWP 29134))] (gdb) bt
at search.c:1374
direction=direction@entry=1) at search.c:1335
doc_view=doc_view@entry=0x26e41f0) at search.c:1343
action_id=action_id@entry=ACT_MAIN_FIND_NEXT, verbose=verbose@entry=0) at action.c:191
ses=0x26e4040) at view.c:1685
at event.c:395
@slackhead try now.
It's good. Thanks.
Felinks git pull 2020-10-28
It would be nice if felinks would keep the current search term indefinitely, until you type a different term or clear it.
After doing a search on a page, and then following a link elsewhere and clicking 'n' for next, the search term seems to have been lost. The behaviour after navigating and clicking 'n'ext seems to be a bit random at the moment, and hard to say exactly what's happening.