Bug 148201 - sysinstall(8): core dump (Error 10) while trying to install packages via sysinstall
Summary: sysinstall(8): core dump (Error 10) while trying to install packages via sysi...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-sysinstall (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 04:40 UTC by Leon Gehling
Modified: 2015-11-10 09:07 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 Leon Gehling 2010-06-28 04:40:01 UTC
When i try to install a package from a ftp or http via the sysinstall, sysinstall crashes with the error: Error 10 core dump.


Hardware:

Mainboard: Gigabyte EP35-DS4
CPU:   Intel C2D E6850
RAM : 6 GB DDR2-800
HD: SATA-HD



PS: Sry for my broken english!
Comment 1 Gavin Atkinson freebsd_committer freebsd_triage 2010-07-13 14:41:27 UTC
Responsible Changed
From-To: freebsd-standards->freebsd-sysinstall

Over to maintainer(s). 

To submitter: We will need more information from you before we can start to 
diagnose this. 

Firstly, could you please show the exact error message? 

If the error includes "(core dumped)", is there any chance you would be 
willing to do some further debugging?  You should find a file called 
"sysinstall.core" somewhere - can you run 
"gdb /usr/sbin/sysinstall sysinstall.core" 
and once inside gdb, give the "trace" command and show us the results?
Comment 2 Garrett Cooper 2010-07-13 15:35:34 UTC
Some other details, like install media settings and the package
installed would be helpful.

As far as the technical issues are concerned, it might be because fp
isn't initialized to NULL in package_extract:

int
package_extract(Device *dev, char *name, Boolean depended)
{
    char path[MAXPATHLEN];
    const char *PkgExts[] = { "", ".tbz", ".tbz2", ".tgz" };
    int last_msg, pathend, ret;
    size_t ext;
    FILE *fp;

There's a codepath where if it fails to setup the `device' via
DEVICE_GET, it'll be uninitialized with a bogus value:

    /* We have a path, call the device strategy routine to get the file */
    for (ext = 0 ; ext < sizeof PkgExts / sizeof PkgExts[0]; ++ext) {
        strlcpy(path + pathend, PkgExts[ext], sizeof path - pathend);
        if ((fp = DEVICE_GET(dev, path, TRUE)))
            break;
    }

    if (fp) {

There are some other QA issues in this function as well...

- fork can fail:

        pid = fork();

- dup2 can fail:

            dup2(pfd[0], 0); close(pfd[0]);
            dup2(DebugFD, 1); dup2(1, 2);
            close(pfd[1]);

- pipe can fail:

        pipe(pfd);

- WEXITSTATUS is only valid if WIFEXITED is true:

            if (sigpipe_caught || i < 0 || WEXITSTATUS(tot)) {

- signal can fail:

        signal(SIGPIPE, catch_pipe);

- This can spin the CPU (doesn't matter so much on install media, but
it does matter for multiuser):

            /* Now catch any stragglers */
            while (wait3(&tot, WNOHANG, NULL) > 0);

Thanks,
-Garrett
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 09:07:40 UTC
sysinstall has been replaced by bsdinstall in FreeBSD 9.x. Closing.