This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

a simple cygwin snapshot regression finding script i wrote in bash


I wrote this script to help people streamline testing snapshot issues
when they identify an issue in a snapshot but do not necessarily know
where the issue might have occured (for instance they do not iteratively
keep up on snapshot releases). Based on the snapshots available at
"http://www.cygwin.com/snapshots/"; the script performs a binary deduction
(simple divide/conquer) to provide quick automation of switching snapshot
dlls to narrow down a regression or new bug so that it is trivialized into
cut/paste -> test -> next.

This is mainly useful to people who *have an alternate unix shell* which
they typically connect to through putty, nx, etc., i.e. any system out of
band from cygwin. For instance, through my own dedicated host, I run the
script and it provides me with the proper order of snapshots to test to
narrow down between what two snapshot releases a difference in behavior has
been seen. It requires you to simple input "a" for "absent, doesn't exist,"
or "s" for "seen" as in you're still seeing the issue. You can also add an
explicit first argument to specify the snapshot you're currently using -
which will split the tree differently. In addition you can also use a
template file which will be sourced after each iteration which is where
the cut/paste action will come in.

Apologies to everyone in advance for the long text after this, I'm just
trying to show an example so it makes sense what I'm talking about.


Example:
Let's say I'm troubleshooting a new bug, such as rsync randomly crashing,
for instance, in the latest snapshot I've switched to. Now you could
go through each snapshot in a linear fashion, but that's pointless when
there are better ways.

[clayne@ns1 ~]$ bash /tmp/csnap.sh

-------------------------
::       date: 20060223
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060223.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060223.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060223.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060223.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060223.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060222-20060223
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060222-20060223
::
:: [(l)og,(d)iff,(a)bsent,(s)een] --> a

I specify that the behavior is absent, after testing this snapshot with a
test case which can duplicate the behavior.

-------------------------
::       date: 20060321
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060321.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060321.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060321.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060321.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060321.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060320-20060321
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060320-20060321
::
:: [(l)og,(d)iff,(a)bsent,(s)een] --> a

Same.

-------------------------
::       date: 20060413
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060413.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060413.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060413.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060413.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060413.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060412-20060413
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060412-20060413
::
:: [(l)og,(d)iff,(a)bsent,(s)een] --> a

Same.

-------------------------
::       date: 20060424
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060424.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060424.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060424.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060424.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060424.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060421-20060424
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060421-20060424
::
:: [(l)og,(d)iff,(a)bsent,(s)een] --> s

At this point I see the observed behavior so I specify "seen."

-------------------------
::       date: 20060418
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060418.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060418.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060418.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060418.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060418.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060417-20060418
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060417-20060418
::
:: [(l)og,(d)iff,(a)bsent,(s)een] --> a

Once again, don't see it.

-------------------------
::       date: 20060421
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060421.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060421.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060421.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060421.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060421.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060418-20060421
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060418-20060421
::
:: [(l)og,(d)iff,(a)bsent,(s)een] --> a

Once again, don't see it - so it could only be between 0421 and 0424:

-------------------------
::    SUSPECT: Suggest examination of changelog and/or diff
::
::       date: 20060424
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060424.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060424.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060424.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060424.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060424.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060421-20060424
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060421-20060424
::
:: [(l)og,(d)iff] --> l
ChangeLog for 20060421 to 20060424



---------- winsup/cygwin/ChangeLog ----------

2006-04-24  Christopher Faylor  <cgf@timesys.com>

[ rest of changelog here ]





You can also use a template like so:

[clayne@ns1 ~]$ bash /tmp/csnap.sh -f /tmp/csnap.f

-------------------------
::       date: 20060223
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060223.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060223.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060223.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060223.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060223.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060222-20060223
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060222-20060223
::
-------------------------
mkdir -p /var/tmp/snap/20060223
/usr/bin/curl http://www.cygwin.com/snapshots/cygwin1-20060223.dll.bz2 | bzip2 -cd > /var/tmp/snap/20060223/cygwin1.dll
( handle cygwin | egrep pid | awk '{print $3}' | sort -u | xargs /bin/kill -f ) &
#
# cmd.exe specific:
#
copy c:\cygwin\var\tmp\snap\20060223\cygwin1.dll c:\cygwin\bin
net start sshd
-------------------------
:: [(l)og,(d)iff,(a)bsent,(s)een] --> a

-------------------------
::       date: 20060321
::        dll: http://www.cygwin.com/snapshots/cygwin1-20060321.dll.bz2
::      debug: http://www.cygwin.com/snapshots/cygwin1-20060321.dbg.bz2
::     source: http://www.cygwin.com/snapshots/cygwin-src-20060321.tar.bz2
::     winsup: http://www.cygwin.com/snapshots/winsup-src-20060321.tar.bz2
::    install: http://www.cygwin.com/snapshots/cygwin-inst-20060321.tar.bz2
::      diffs: http://www.cygwin.com/snapshots/winsup-changelog-20060320-20060321
::  changelog: http://www.cygwin.com/snapshots/winsup-diffs-20060320-20060321
::
-------------------------
mkdir -p /var/tmp/snap/20060321
/usr/bin/curl http://www.cygwin.com/snapshots/cygwin1-20060321.dll.bz2 | bzip2 -cd > /var/tmp/snap/20060321/cygwin1.dll
( handle cygwin | egrep pid | awk '{print $3}' | sort -u | xargs /bin/kill -f ) &
#
# cmd.exe specific:
#
copy c:\cygwin\var\tmp\snap\20060321\cygwin1.dll c:\cygwin\bin
net start sshd
-------------------------
:: [(l)og,(d)iff,(a)bsent,(s)een] -->


Which is where I think the real speed will come in in going through snapshots,
because it's just a cut and paste deal which is what we're really looking for.
I paste the top 3 commands into a cygwin shell or putty->localhost session.
I then paste the remaining 2 lines that are cmd.exe specific into a cmd window.
Rinse repeat until one narrows it down.

Let me know of any issues. If someone wants to make it into a CGI somehow, have
at it - but I'm fine with the bash script. Script and template file are attached
to the email. Yes, there are fragilities and assumptions, but it's really a
get-it-done script. Specific variables are at the top.

-cl

Attachment: csnap.sh
Description: Bourne shell script

Attachment: csnap.f
Description: Text document

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]