Skip to content
A bug finding tool that hammers a GUI with random keypresses until it crashes (then generates and refines a crash report)
Shell Python Other
Latest commit b1e9bad Aug 28, 2013 @gmatht clean up LyX variables
Failed to load latest commit information.
Benchmarks Change what we are benchmarking. Jul 30, 2011
examples Fix bugs: Remove emergency file, timeout waiting for LyX to load. Jul 14, 2011
lyx.patches Compile fix for versions 37853--37858 of LyX. Apr 3, 2011
path Merge branch 'master' of Mar 23, 2011
KNOWN_BUGS Add a file detailing known bugs. Jul 14, 2011
README Added instructions to install from git Dec 13, 2011
S99keytest Remove making tmpfs/CRITICAL' look like an Error. Jul 26, 2012
TODO After eliminating keycodes, remove restriction that backtrace has to … Apr 3, 2011 Added more missing files Sep 16, 2010 Various bug fixes and improvements Sep 8, 2010 Add more kill lines. Dec 13, 2011
autolyx Add more logging Jan 8, 2011 Now use $SRC_ROOT instead of hardcoding Jan 8, 2011 Add some logging Jul 26, 2012 Add more code to deal with soft-links Dec 13, 2011 Treat all SIGXCPU bugs as the same bug type Dec 13, 2011 Fix bug where used $PID instead of $_PID Jan 8, 2011 Adds a utility to clean up the Bisect cache dir Jan 22, 2011 Now add an autokill script to kill lyx if is old. Aug 21, 2011 Backup log file before truncating. Apr 8, 2011 Various bug fixes and improvements Sep 7, 2010
find_in_finals Flags Jul 10, 2009
focus Fix bug where attempts to raise window named "-R", when -R is actuall… Jan 8, 2011 Make more general etc. Mar 29, 2011
initXvfb Add DISPLAY variable to command prompt, and slighty buggy overloaded … Aug 1, 2012 Now only try to remove ALT keys from a KEYCODEpure file if it is suff… Jul 2, 2011 Stop spewing "if [ ... ]" to stdout. Mar 30, 2011
killall_p new utility to remove runaway processes Jan 8, 2011 Make less LyX specific Jan 8, 2011 Next patch for keystest from John McCabe-Dansted. Oct 3, 2009 Various bug fixes and improvements Sep 7, 2010
local_keytest.rc.example Use OUT_COUNT Apr 3, 2011 Various bug fixes and improvements Sep 7, 2010 Make less LyX specific Jan 7, 2011 More debug output: every command executed Dec 13, 2011 Don't store results of bisect if not actually doing bisect. Apr 3, 2011 Prevent crash if KEYCODEpure+ does not exist Apr 3, 2011 Move to the correct directory structure. Jun 15, 2009 Add new file Jul 14, 2011 Fix bisect bugs and ease debugging by generating complete shell scripts. Aug 28, 2013 Added experimental files for using git bisect. Aug 24, 2013 Next patch from John McCabe-Dansted. Jun 17, 2009 Ignore KEYCODEpure files without corresponding GDB files. Hack to sto… Apr 6, 2011 Remove "KO: " from keycodes summary. Jul 30, 2011 Make more general etc. Mar 29, 2011 Add missing files. Sep 16, 2010
set_LYX_DIR_16x Merge Jan 22, 2011 Add crontab entry to kill keytest when it gets stuck (this should not… Dec 13, 2011 Do not return error if OUT dir already exists. Apr 4, 2011 Use --errors-only instead of -e or -E in pylint Jul 30, 2011 Work around some bugs relating to testing abiword. Mar 12, 2011 Fix a bug triggered when pwd != keytest Apr 3, 2011 clean up LyX variables Aug 28, 2013 Split Atp in Jul 30, 2011 Next patch from John McCabe-Dansted. Jun 17, 2009
stock_text Test of brute-force key typing to test lyx for crashes. Jun 15, 2009 Add " Jan 8, 2011 Added a command Dec 13, 2011
view1 Fix svn for windows devs Jan 2, 2010 Make output more concise Dec 13, 2011


--- LyXtest ---

This is a program to spam LyX with millions of randomly generated key
presses, and collect the crash results.

Since the code involves spamming random keypresses, I run it under a special
user "keytest", well away from my main X windows session.

To use this software, you will want to run the following commands:

git clone
cd Jankey 
cp local_keytest.rc.example local_keytest.rc
gedit local_keytest.rc
#Edit the configuration files and save
sudo ./   # add keytest user and apt-get required files
sudo ./S99keytest start  # This should start keytest running
watch ./ # This command shows you what is going on
                         # Age should hover below several seconds
./  # Generate an HTML list of the bugs found.

Note that this bug finding software is itself quite buggy.


README: this readme file A quick way of generating bug reports and an overview from the logs. a script for making screenshots, if they are missing from output of above.
autolyx: A script to continually restart lyx and collect the bug reports Makes this tar file :) Sends randomly generated keypresses to the LyX window.
killtest: stop the testing
stock_text: The stock test to add to each bug report. Dumps various info on what keytest is doing, often run as "watch"
	Watching the output of this is almost as much fun as playing "ProgressQuest" A script for determining when a regression occurs. 
        It uses large amount of disk space to cache previously compiled versions of LyX to speed up the bisect.


autolyx: Outputs out/*.GDB, a log of all output, including backtraces. Outputs out/*.KEYCODES, a list of all keycodes sent to LyX

You may find the following commands useful:

./ 8
	Watch the Virtual Screen keytest is writing to in a webbrowser

watch ./
	Watch the progress keytest is making and various relevant files
	This is the most useful if keytest is up and runnign

tail -f tmpfs/nohup.log
	watch the output log keytest is generating.

BISECTING: is roughly equivalent to "git bisect run" but takes care of
building LyX and of keeping cached pre-compiled versions of LyX around. can take as input a .sh file or a .KEYCODEpure file.
It can convert file URIs into filenames, so you can paste the "pure" link
generated from ./ into a terminal. This means the standard way
to run is something like: file:///mnt/big/keytest/html_out/out/t6/html/1275784335.html

The .sh file is similar to a script used by git bisect, but it can assume that
there is a precompiled LyX binary at 

When is running you can see how much progress it has made by
  tail -f /tmp/cache-bisect.*.log

For example, if you run 
  ./ examples/CopyColumn.KEYCODEpure
then after a few hours the line:
  Relevant Versions ['33494', '33495']
should appear in a file 
The first "Relevant Version" is the one we know is good and the last is the
one we know is bad, so here the regression is in r33495. If there are 
more than two Relevant Versions then the ones in the middle are ones that
could have introduced the regression, but we don't know (usually because
we could not build the Versions in question).

If you want to test the ability to use a script in place of a KEYCODEpure
file, try running
  ./ examples/
In this case it should report r32772 as the regression

Sometimes a problem doesn't occur 100% of the
time, perhaps just because LyX loses some keypresses and the script isn't
clever enought to send them again. In any case we may want to reproduce the
problem a number of times before we mark a particular version as being "Good".
To do this, replace the 0001 in with the desired number of times.

If a bisect is interrupted, you may want to manually set the GOOD/BAD versions.

You can do this with something like:
   (VERS="32548 32538" ./ file:///mnt/big/keytest/html_out/out/t6/html/1276005507.KEYCODEpure)
Note that the higher version comes first.


keytest can generate a lot of IO, that can make the forground task slow, even though keytest is running at nice level 19. Using noatime, ext4 instead of ext3, compcache/ramzswap and rebooting regularly may (or may not) help. can be useful to find which exact regression caused a bug. However it can be quite difficult to compile old LyX svn trunk versions.

E.g to compile r27418 on ubuntu 9.10, I needed to do the following
 ln /usr/lib/libboost_filesystem{-mt,}.so
 ln /usr/lib/libboost_regex{-mt,}.so
 ln /usr/lib/libboost_signals{-mt,}.so
 ln /usr/lib/libboost_iostreams{-mt,}.so

nd needed to apply the patch r27418.patch, to compile with gcc-4.4 but it is probably better to just compile the old versions with gcc-4.2

You are likely to have to install automake1.10. Also you will have to install the old autoconf 2.63. I found installing the autoconf2.63 from Jaunty onto Karmic helped. I then added the following three lines to /etc/apt/preferences so ti wouldn't keep trying to upgrade autoconf to 2.64:

Package: autoconf
Pin: version 2.63*
Pin-Priority:  1001

I have set cache-bisect to use gcc 4.2 as older versions of boost have trouble with gcc 4.4

To complile versions earlier than about r27000, you will need even older versions. I installed autoconf 2.60 in /usr/local/bin and added the following symlinks to my path.
aclocal -> /usr/bin/aclocal-1.9
autoconf -> /usr/local/bin/autoconf
autoheader -> /usr/local/bin/autoheader
autom4te -> /usr/local/bin/autom4te
automake -> /usr/bin/automake-1.9
autoreconf -> /usr/local/bin/autoreconf
autoscan -> /usr/local/bin/autoscan
autoupdate -> /usr/local/bin/autoupdate
cc1obj -> /usr/lib/gcc/x86_64-linux-gnu/4.4/cc1obj
ifnames -> /home/xp/src/autoconf-2.60/bin/ifnames
Makefile -> /home/xp/src/autoconf-2.60/bin/Makefile

I use a command like:
nice -18 ./ /mnt/big/xp/images/share/Ubuntu904/keytest/ 9 sudo -H -u keytest2 nice -18 /mnt/big/xp/images/share/Ubuntu904/keytest/set_LYX_DIR_16x /mnt/big/xp/images/share/Ubuntu904/keytest/ `pwd`/tmpfs/0000002.KEYCODEpure
(DISPLAY=:3 nice -18 ./ /mnt/big/xp/images/share/Ubuntu904/keytest/ 9 sudo -H -u keytest2 nice -18 /mnt/big/xp/images/share/Ubuntu904/keytest/set_LYX_DIR_16x /mnt/big/xp/images/share/Ubuntu904/keytest/ `pwd`/tmpfs/0000002.KEYCODEpure) 2>&1 | tee tmpfs/bisect2.log
(sudo -H -u keytest2 ./kt ; MUST_MATCH="::Graph::" DISPLAY=:3 nice -18 ./ sudo -H -u keytest2 /mnt/big/xp/images/share/Ubuntu904/keytest/ 19 /mnt/big/xp/images/share/Ubuntu904/keytest/set_LYX_DIR_16x /mnt/big/xp/images/share/Ubuntu904/keytest/ `pwd`/out/PreviewPS.KEYCODEpure) 2>&1 | tee tmpfs/bisect2.log
(sudo -H -u keytest2 ./kt ; DISPLAY=:3 xwininfo -root || ./initXvfb 3 ; DISPLAY=:3 nice -18 ./ sudo -H -u keytest2 /mnt/big/xp/images/share/Ubuntu904/keytest/ 19 /mnt/big/xp/images/share/Ubuntu904/keytest/set_LYX_DIR_16x /mnt/big/xp/images/share/Ubuntu904/keytest/ `pwd`/out/PreviewPS.KEYCODEpure "::Graph::") 2>&1 | tee tmpfs/bisect2.log

( sudo -H -u keytest2 ./kt; DISPLAY=:3 xwininfo -root || ./initXvfb 3; DISPLAY=:3 nice -19 ./ sudo -H -u keytest2 /mnt/big/xp/images/share/Ubuntu904/keytest/ 19 /mnt/big/xp/images/share/Ubuntu904/keytest/set_LYX_DIR_16x /mnt/big/xp/images/share/Ubuntu904/keytest/ `pwd`/out/PreviewPS.KEYCODEpure "::Graph::" ) 2>&1 | tee tmpfs/bisect2.log
( sudo -H -u keytest2 ./kt; DISPLAY=:3 xwininfo -root || ./initXvfb 3; DISPLAY=:3 nice -19 ./ sudo -H -u keytest2 /mnt/big/xp/images/share/Ubuntu904/keytest/ 19 /mnt/big/xp/images/share/Ubuntu904/keytest/set_LYX_DIR_16x /mnt/big/xp/images/share/Ubuntu904/keytest/ `pwd`/out/CtrlW.KEYCODEpure "ASSERTION bv VIOLATED IN LyXFunc.cpp" ) 2>&1 | tee tmpfs/bisect3.log

Q: Why do I get errors like the following?
config/dbus] couldn't take over org.x.config: org.freedesktop.DBus.Error.AccessDenied (Connection ":1.153" is not allowed to own the service "org.x.config.display5" due to security policies in the configuration file)
(EE) config/hal: NewInputDeviceRequest failed (2)
(EE) config/hal: NewInputDeviceRequest failed (2)
(EE) config/hal: NewInputDeviceRequest failed (2)
(EE) config/hal: NewInputDeviceRequest failed (2)
(EE) config/hal: NewInputDeviceRequest failed (2)

A: because you haven't listed the X-server in /etc/dbus-1/system.d/xorg-server.conf

If we have [6,7,8] as possible bisect versions, and [6] is ugly we get [7,8] as sole remaining versions. This is wrong.

Copyright (C) 2009 John McCabe-Dansted, gmatht at gmail dot com.
Published under the Gnu General Public Licence, version 2 or later.

LyX should work with the following versions of autoconf and automake:

Something went wrong with that request. Please try again.