disklayout (crash) / diskinfo (segfault) #183

Closed
jmealo opened this Issue Mar 14, 2013 · 2 comments

Comments

Projects
None yet
3 participants

jmealo commented Mar 14, 2013

Steps to reproduce [disklayout]:
(using -h doesn't crash; but specifying a type of layout results in the error shown below)

# disklayout

/usr/bin/disklayout:34
        disks = disks.filter(function (disk) {
                      ^
TypeError: Cannot call method 'filter' of undefined
    at dolayout (/usr/bin/disklayout:34:16)
    at /usr/bin/disklayout:95:3
    at zpool.listDisks (/usr/node/0.8/node_modules/zfs.js:49:12)
    at ChildProcess.exithandler (child_process.js:544:7)
    at ChildProcess.EventEmitter.emit (events.js:99:17)
    at maybeClose (child_process.js:638:16)
    at Process._handle.onexit (child_process.js:680:5)

Steps to reproduce [diskinfo]:

 #diskinfo

Core dump: https://jumpshare.com/b/UBU40D4JgSpUSqzJSuBF

Contributor

richlowe commented Mar 14, 2013

Looks like stomping a constant string, ultimately from diskinfo.c:37, presumably with the toupper at line 84.
if I remember this correctly, you may also be able to stomp a constant from libdiskinfo that way, but I'm less certain of that.

@ghost ghost assigned wesolows Mar 15, 2013

Contributor

wesolows commented Mar 15, 2013

There's also some freeing of stack garbage in some failure cases, but it appears that richlowe's diagnosis covers the case in the core. Fixed.

@wesolows wesolows closed this Mar 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment