This is the mail archive of the cygwin-apps 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]

setup.exe dies in dumpAndList()


I ran into a problem when I was attempting to test the postinstall/preremove behavior of my new inetutils port. In order to duplicate the end-user experience, I created a local site with a setup.ini file:

=============================================================
./:
do_genini*  genini*  release/  setup.ini

./release:
inetutils/

./release/inetutils:
inetutils-1.3.2-37-src.tar.bz2  inetutils-1.5-1-src.tar.bz2  setup.hint
inetutils-1.3.2-37.tar.bz2      inetutils-1.5-1.tar.bz2
=============================================================


Where I used genini to create the setup.ini. What happened was that when I ran setup.exe, I got to the chooser and my package wasn't there! On a whim, I figured maybe I needed more "stuff", so I pulled in my recent tcp_wrappers, AND built a debug version of setup.exe, with -DDEBUG turned on.



============================================================= ./: do_genini* genini* release/ setup.ini

./release:
inetutils/  tcp_wrappers/

./release/inetutils:
inetutils-1.3.2-37-src.tar.bz2  inetutils-1.5-1-src.tar.bz2  setup.hint
inetutils-1.3.2-37.tar.bz2      inetutils-1.5-1.tar.bz2

./release/tcp_wrappers:
libwrap-devel/  tcp_wrappers-7.6-2-src.tar.bz2  tcp_wrappers-7.6-4.tar.bz2
libwrap0/       tcp_wrappers-7.6-2.tar.bz2
setup.hint      tcp_wrappers-7.6-4-src.tar.bz2

./release/tcp_wrappers/libwrap-devel:
libwrap-devel-7.6-4.tar.bz2  setup.hint

./release/tcp_wrappers/libwrap0:
libwrap0-7.6-4.tar.bz2  setup.hint
=============================================================


And that's when things got really interesting. It seems that the inetutils fragment of setup.ini IS getting parsed, but when you hit the next fragment, the constructor for the new IniDBBuilderPackage calls dumpAndList on the OLD entry (but only if -DDEBUG).


Ordinarily, this is nice: it prints a lot of information about how the ini file was parsed to the setup.log.full file. In this case, however, it exposes in a much more dramatic way what was causing my earier problems with this setup.ini: in *this* case, I get what is, I think, a NULL pointer access in dumpAndList -- which means that the structure created to describe the inetutils package is improperly constructed -- and THAT is why inetutils didn't show up in the chooser; I surmise that the chooser is smart enough to skip over entries that have null values...but dumpAndList is not:

void
dumpAndList (vector<vector <PackageSpecification *> *> const *currentAndList,
std::ostream &logger)
{
<<<<< A >>>>>>>
if (currentAndList)
{
vector<vector <PackageSpecification *> *>::const_iterator iAnd =
currentAndList->begin();
while (true)
{
if ((*iAnd)->size() > 1) log (LOG_BABBLE) << "( ";
vector<PackageSpecification *>::const_iterator i= (*iAnd)->begin();
while (true)
{
log(LOG_BABBLE) << **i;
if (++i == (*iAnd)->end()) break;
log(LOG_BABBLE) << " | ";
}
if ((*iAnd)->size() > 1) log (LOG_BABBLE) << " )";
if (++iAnd == currentAndList->end()) break;
log (LOG_BABBLE) << " & ";
}
}
<<<<< B >>>>>>>
}


Somewhere between A and B, I get a "Do you want to report to Microsoft"/"terminated in an unusual way" popup.

And that's far as I got. I have attached the offending setup.ini and setup.hint -- but to recreate this error, you'd also need my actual local directory tree. If someone is really interested in tracking this down, I can send that via private email or a website.

=============================================================
Now begins the rant:

What in the name of all that is holy possessed the person that designed the logging behavior of setup.exe? What kind of sense does it make to store the ENTIRE CONTENTS of the log in MEMORY, and only dump it to the actual file at the very END of the application, just before exit(0) is called?

When exit is NOT called -- say, if there is an unhandled exception -- then you have NOTHING. No information AT ALL. I don't have the WORDS to describe how...er, shortsighted...that is.

And never mind the fact that even after building my own debug version of setup.exe, I still couldn't get gdb to cooperate: it seemed unable to ineteract at all with the inferior. How do you guys debug this thing? Is there some weird incantation necessary to enable gdb to debug a GUI app?

I was reduced to using printf -- actually, even worse: in gui mode there is no printf, and I don't know how to intercept OutputDebugString without using Visual Studio...so I was ACTUALLY stuck using MessageBox() as my only debug tool. But even THAT would have been OK, if I only had useful log files...

</end rant>

--
Chuck


sdesc: "Common networking clients and servers"
ldesc: "inetutils provides common networking clients and
servers, including the inetd super-server, telnetd and
telnet, ftpd and ftp, rshd and rsh, rlogind and rlogin,
talkd and talk, tftpd and tftp, rexecd (but no rexec),
uucpd (but no uucp client), rcp, and syslogd.

Most of these utilities are security nightmares, dating
from a time when the internet was a more innocent place.
It is NOT recommended that you enable or use ANY of these
utilities -- except inetd and syslogd -- unless you have
a VERY good reason.  Please consider using ssh and sshd
from the 'openssh' package instead of telnet and the r*
tools"
category: Net
requires: cygwin terminfo
curr: 1.3.2-37
test: 1.5-1

# This file is automatically generated.  If you edit it, your
# edits will be discarded next time the file is generated.
# See http://cygwin.com/setup.html for details.
#

@ inetutils
sdesc: "Common networking clients and servers"
ldesc: "inetutils provides common networking clients and
servers, including the inetd super-server, telnetd and
telnet, ftpd and ftp, rshd and rsh, rlogind and rlogin,
talkd and talk, tftpd and tftp, rexecd (but no rexec),
uucpd (but no uucp client), rcp, and syslogd.

Most of these utilities are security nightmares, dating
from a time when the internet was a more innocent place.
It is NOT recommended that you enable or use ANY of these
utilities -- except inetd and syslogd -- unless you have
a VERY good reason.  Please consider using ssh and sshd
from the 'openssh' package instead of telnet and the r*
tools"
category: Net
requires: cygwin terminfo
version: 1.3.2-37
install: /desktop/cygwin-dist-check/release/inetutils/inetutils-1.3.2-37.tar.bz2 330850 4f2ecafe0db2c772713ed9f5f8277fb3
source: /desktop/cygwin-dist-check/release/inetutils/inetutils-1.3.2-37-src.tar.bz2 381813 2c6171233d87036938bf7be13e732a4c
[test]
version: 1.5-1
install: /desktop/cygwin-dist-check/release/inetutils/inetutils-1.5-1.tar.bz2 674792 71077997c9b4c2c2053c2ed18f1c5e77
source: /desktop/cygwin-dist-check/release/inetutils/inetutils-1.5-1-src.tar.bz2 1451945 436007b90f2b88195032959e76321e33

@ libwrap-devel
sdesc: "(devel) provides host-based access restrictions on tcp services"
ldesc: "This package provides development support (header
files, an import library, a static library, and documentation)
for compiling internet applications with built-in support for
monitoring and filtering incoming requests."
category: Net Libs Devel
requires: cygwin libwrap0
version: 7.6-4
install: /desktop/cygwin-dist-check/release/tcp_wrappers/libwrap-devel/libwrap-devel-7.6-4.tar.bz2 58078 b07ef1b2a1ed0e9054961945194af613
source: /desktop/cygwin-dist-check/release/tcp_wrappers/tcp_wrappers-7.6-4-src.tar.bz2 135992 5c1e8ba696652afe2cd3f3064627f1e6

@ libwrap0
sdesc: "(runtime) provides host-based access restrictions on tcp services"
ldesc: "This package provides runtime support for internet
applications that have built-in facilities for monitoring and
filtering incoming requests."
category: Net
requires: cygwin
version: 7.6-4
install: /desktop/cygwin-dist-check/release/tcp_wrappers/libwrap0/libwrap0-7.6-4.tar.bz2 11340 75d7129369df0fe817e0a5ed135a3110
source: /desktop/cygwin-dist-check/release/tcp_wrappers/tcp_wrappers-7.6-4-src.tar.bz2 135992 5c1e8ba696652afe2cd3f3064627f1e6

@ tcp_wrappers
sdesc: "Tools providing host-based access restrictions on tcp services"
ldesc: "This package provides facilities for monitoring and
filtering incoming requests for the SSHD, SYSTAT, FINGER, FTP,
TELNET, RLOGIN, RSH, EXEC, TFTP, TALK, and other network services.

The package provides a tiny daemon wrapper program that can be installed
without any changes to existing software or to existing configuration
files.  The wrappers report the name of the client host and of the
requested service; the wrappers do not exchange information with the
client or server applications, and impose no overhead on the actual
conversation between the client and server applications."
category: Net
requires: cygwin libwrap0
version: 7.6-4
install: /desktop/cygwin-dist-check/release/tcp_wrappers/tcp_wrappers-7.6-4.tar.bz2 60807 77f280a8e76a3b7db0ba84b07240f4dc
source: /desktop/cygwin-dist-check/release/tcp_wrappers/tcp_wrappers-7.6-4-src.tar.bz2 135992 5c1e8ba696652afe2cd3f3064627f1e6
[prev]
version: 7.6-2
install: /desktop/cygwin-dist-check/release/tcp_wrappers/tcp_wrappers-7.6-2.tar.bz2 66045 dc2ca00dc1f2cae530f3e6f368de0273
source: /desktop/cygwin-dist-check/release/tcp_wrappers/tcp_wrappers-7.6-2-src.tar.bz2 112136 8bc80b0d85857dc705897e8267298787

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