Bug#124117: dbootstrap : horrible newt bug?
Here is an easy way to reproduce a crash which I think we are getting at the
end of the base system install. There is a hackish fix to the bug in the
boxes.c change. I basically just close the box between all updates, maybe that
is good enough for 3.0.18.
I think this is a newt bug, but I'm way too tired to think clearly right now.
My fix is sketchy I didn't want to commit it, if you want to comit it, feel
free. I think it gives base a chance of installing without segv.
The patch hacks around the segfault unless you set the variable CRASH=true
during the build. (make sure to install the electric-fence package for extra
fun.)
Now let us watch it crash:
$ make clean
$ make extract_base_test DEBUG=true EFENCE=true CRASH=true
. . .
$ gdb extract_base_test
ElectricFence Aborting: free(40270ff4): address not from malloc().qqqqqqqqqqqqqqqqqqqqj
Program received signal SIGILL, Illegal instruction.
0x400bd911 in kill () from /lib/libc.so.6stem Installation
(gdb) bt
#0 0x400bd911 in kill () from /lib/libc.so.6
#1 0x4008cb56 in EF_Abort () from /usr/lib/libefence.so.0
#2 0x4008c4e1 in free () from /usr/lib/libefence.so.0
#3 0x40024daa in newtTextboxSetText () from /usr/lib/libnewt.so.0.50
#4 0x0805159d in boxProgress (action=0,
arg=0x8066040 "Validating\nasfkd hasdfkhgs afdklghas dflajkshdf lkasf dlakshdf") at boxes.c:1085
#5 0x0804c22a in main () at extract_base.c:384
#6 0x400ad65f in __libc_start_main () from /lib/libc.so.6
(gdb)
Now I build with the hack in. (removed the CRASH=true)
$ make clean
$ make extract_base_test DEBUG=true EFENCE=true
. . . .
Program exited normally.
(gdb)
Additionally I notice that if I change the "Validating\n sdfklh s sdfk . . "
to something less interesting I can avoid the crash.
I wouldn't be surprised if the problem was somewhere around line 120 of
newt-0.50.17/textbox.c where we have the fun comment:
/* this one needs rewriting - Edmund */
Who knows?
-David
Index: Makefile
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/Makefile,v
retrieving revision 1.103
diff -u -r1.103 Makefile
--- Makefile 2001/12/18 08:15:38 1.103
+++ Makefile 2001/12/18 10:51:48
@@ -39,6 +39,10 @@
BUILD := build/
endif
+ifeq ($(CRASH),true)
+CFLAGS += -DCRASH
+endif
+
ifeq ($(DEBUG),true)
CFLAGS += -g -DDEBUG
LDFLAGS +=
Index: boxes.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/boxes.c,v
retrieving revision 1.60
diff -u -r1.60 boxes.c
--- boxes.c 2001/12/11 23:27:47 1.60
+++ boxes.c 2001/12/18 10:51:53
@@ -1077,6 +1077,7 @@
}
case PROGRESS_SETTEXT:
{
+#ifdef CRASH
if (arg)
snprintf (window_content, sizeof window_content, "%s", arg);
else
@@ -1084,6 +1085,24 @@
newtTextboxSetText (tx, window_content);
newtDrawForm (f);
newtRefresh ();
+#else
+ newtPopWindow ();
+ newtFormDestroy (f);
+
+ if (arg && strlen(arg))
+ snprintf (window_content, sizeof window_content, "%s", arg);
+ else
+ window_content[0] = '\0';
+ newtCenteredWindow (72, 8, window_header);
+ f = newtForm (NULL, NULL, 0);
+ tx = newtTextbox (1, 1, 71, 4, NEWT_FLAG_WRAP);
+ newtTextboxSetText (tx, window_content);
+ scale = newtScale (4, 6, 62, PROGRESS_SCALE);
+ newtFormAddComponents (f, tx, scale, NULL);
+ newtDrawForm (f);
+ newtScaleSet (scale, cur * PROGRESS_SCALE / max);
+ newtRefresh ();
+#endif
break;
}
}
Index: extract_base.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/extract_base.c,v
retrieving revision 1.69
diff -u -r1.69 extract_base.c
--- extract_base.c 2001/12/17 18:18:23 1.69
+++ extract_base.c 2001/12/18 10:51:54
@@ -380,7 +380,12 @@
InstallationRootDevice="/dev/ram";
get_kver();
boxInit();
- debootstrap_extract_base();
+ boxProgress(PROGRESS_INIT, _("Installing Base System"));
+ boxProgress(PROGRESS_SETTEXT, "Calling debootstrap");
+ boxProgress(PROGRESS_SETTEXT, "Validating\nasfkd hasdfkhgs afdklghas dflajkshdf lkasf dlakshdf");
+ boxProgress(PROGRESS_SETTEXT, "Validating\nasfkd hasdfkhgs afdklghas dflajkshdf lkasf dlakshdf");
+ /* debootstrap_extract_base(); */
+
return 0;
}
#endif
Reply to: