Bug 8867 - sysinstall(8): [patch] /stand/sysinstall core dumps (signal 11) if you try to allocate 25 partitions at once.
Summary: sysinstall(8): [patch] /stand/sysinstall core dumps (signal 11) if you try to...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 3.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-sysinstall (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1998-11-27 22:40 UTC by fehr
Modified: 2015-11-10 09:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fehr 1998-11-27 22:40:00 UTC
When allocating partitions via sysinstall, upon creating the 25th entry, a Signal 11 is generated.

How-To-Repeat: Create 25 partitions in sysinstall.
Comment 1 nbm freebsd_committer freebsd_triage 2000-08-05 21:52:46 UTC
Responsible Changed
From-To: freebsd-bugs->murray

sysinstall problems seem to go to murray
Comment 2 Murray Stokely freebsd_committer freebsd_triage 2001-08-30 23:45:56 UTC
Responsible Changed
From-To: murray->eric

Eric is working on our installer tools now.
Comment 3 Eric Melville freebsd_committer freebsd_triage 2001-10-01 19:57:15 UTC
Responsible Changed
From-To: eric->freebsd-qa

assign idle sysinstall bugs to freebsd-qa, as suggested by murray
Comment 4 Seth Kingsley 2002-04-09 06:04:38 UTC
The following patch does two things, in addition to solving the problem
above:

1. Do not allow the creation of more slices than allowed by the target
   architecture (4 on i386, 16 on PC98).
2. Advise the user, upon creation of the last slice, that they will
   waste space unless they use the maximum available size.

Index: disks.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/sysinstall/disks.c,v
retrieving revision 1.130
diff -u -p -r1.130 disks.c
--- disks.c	2002/03/28 08:23:33	1.130
+++ disks.c	2002/04/09 04:45:34
@@ -54,8 +54,8 @@ enum size_units_t { UNIT_BLOCKS, UNIT_KI
 #define CHUNK_START_ROW		5
 
 /* Where we keep track of MBR chunks */
-static struct chunk *chunk_info[16];
-static int current_chunk;
+static struct chunk *chunk_info[NDOSPART + 1];
+static int current_chunk, num_chunks;
 
 static void	diskPartitionNonInteractive(Device *dev);
 static u_char *	bootalloc(char *name, size_t *size);
@@ -64,22 +64,21 @@ static void
 record_chunks(Disk *d)
 {
     struct chunk *c1 = NULL;
-    int i = 0;
     int last_free = 0;
 
     if (!d->chunks)
 	msgFatal("No chunk list found for %s!", d->name);
 
-    for (c1 = d->chunks->part; c1; c1 = c1->next) {
+    for (num_chunks = 0, c1 = d->chunks->part; c1 && num_chunks < NDOSPART; c1 = c1->next) {
 	if (c1->type == unused && c1->size > last_free) {
 	    last_free = c1->size;
-	    current_chunk = i;
+	    current_chunk = num_chunks;
 	}
-	chunk_info[i++] = c1;
+	chunk_info[num_chunks++] = c1;
     }
-    chunk_info[i] = NULL;
-    if (current_chunk >= i)
-	current_chunk = i - 1;
+    chunk_info[num_chunks] = NULL;
+    if (current_chunk >= num_chunks)
+	current_chunk = num_chunks - 1;
 }
 
 static int Total;
@@ -410,14 +409,24 @@ diskPartition(Device *dev)
 		int subtype;
 		chunk_e partitiontype;
 #endif
-		snprintf(tmp, 20, "%lu", chunk_info[current_chunk]->size);
-		val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n"
-				  "or append a trailing `M' for megabytes (e.g. 20M).");
-		if (val && (size = strtol(val, &cp, 0)) > 0) {
-		    if (*cp && toupper(*cp) == 'M')
-			size *= ONE_MEG;
-		    else if (*cp && toupper(*cp) == 'G')
-			size *= ONE_GIG;
+		size = -1;
+		if (current_chunk == (NDOSPART - 1) &&
+			!msgYesNo("This is the last slice available. Would you like to\n"
+			    "create it using the maximum available size, to avoid wasting\n"
+			    "space?"))
+		    size = chunk_info[current_chunk]->size;
+		else {
+		    snprintf(tmp, 20, "%lu", chunk_info[current_chunk]->size);
+		    val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n"
+				      "or append a trailing `M' for megabytes (e.g. 20M).");
+		    if (val && (size = strtol(val, &cp, 0)) > 0) {
+			if (*cp && toupper(*cp) == 'M')
+			    size *= ONE_MEG;
+			else if (*cp && toupper(*cp) == 'G')
+			    size *= ONE_GIG;
+		    }
+		}
+		if (size > 0) {
 #ifdef PC98
 		    Create_Chunk(d, chunk_info[current_chunk]->offset, size,
 			freebsd, 3,

-- 
|| Seth Kingsley || sethk@meowfishies.com ||
|| http://www.meowfishies.com/ | Meow ^_^ ||
Comment 5 Johan Karlsson freebsd_committer freebsd_triage 2002-08-25 03:38:06 UTC
Responsible Changed
From-To: freebsd-qa->qa

Use short names for mailing list to make searches    
using the web query form work with the shown responsible. 

This also makes open PRs show up in the summery mail.
Comment 6 Rebecca Cran freebsd_committer freebsd_triage 2008-02-29 12:22:22 UTC
This is still an issue on 7.0: sysinstall doesn't limit the number of
partitions you can create but segfaults soon after too many have been
created.

--
Bruce
Comment 7 randi freebsd_committer freebsd_triage 2009-06-06 20:48:34 UTC
Responsible Changed
From-To: freebsd-bugs->randi

11 years later, the bug still exists. Taking this. :)
Comment 8 Mark Linimon freebsd_committer freebsd_triage 2013-06-29 06:52:04 UTC
Responsible Changed
From-To: randi->freebsd-sysinstall

back to mailing list.
Comment 9 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 09:07:43 UTC
sysinstall has been replaced by bsdinstall in FreeBSD 9.x. Closing.
Comment 10 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 09:12:15 UTC
sysinstall has been replaced by bsdinstall in FreeBSD 9.x. Closing.