Project

General

Profile

Bug #9287

dladm Segmentation Fault (core dumped) on unknown field

Added by Till Wegmüller over 1 year ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2018-03-15
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

If you enter an Unknown Fieldsname on -o dladm dumps core

For example:
dladm show-link -s -p -o ipkts e1000g0

Or:
dladm show-link -s -p -o gugus e1000g0

Result:
Segmentation Fault (core dumped)

Expected Result:
Error Field not known.

History

#1

Updated by Till Wegmüller over 1 year ago

$ pstack core
core 'core' of 1485: dladm show-link -s -p -o gugus e1000g0
feeffde0 strcasecmp_l (80c2e30, 5f800000, fee01a00, fecd3000, 8044ac5) + 60
feeffe2d strcasecmp (80c2e30, 5f800000, 80447e8, fecc1c43) + 34
fecc1dd0 ofmt_open (8044ac5, 8067c40, 1, 0, 804481c) + 19b
0805d971 link_stats (1, 0, 8044ac5, 8044880) + 30
08063ef9 do_show_link (6) + 386
08058c28 main (804495c, fefcf2c8, 8044998, 8056378, 7, 80449c4) + ac
08056378 _start_crt (7, 80449c4, fdc4dc00, 0, 0, 0) + 97
0805624a _start (7, 8044aac, 8044ab2, 8044abc, 8044abf, 8044ac2) + 1a

#2

Updated by Gergő Mihály Doma over 1 year ago

The issue caused by the missing termination of link_s_fields[] .
Need to be terminated in the same way like link_fields[] .

#3

Updated by Carlos Neira 9 months ago

Gergő Mihály Doma wrote:

The issue caused by the missing termination of link_s_fields[] .
Need to be terminated in the same way like link_fields[] .

You are correct, I just tested your change and works perfectly.

cneira@Trixie:...lumos-omnios/usr/src/cmd/dladm$ /build/illumos-omnios/proto/root_i386-nd/usr/sbin/dladm show-link -s -p -o gugus e1000g0
/build/illumos-omnios/proto/root_i386-nd/usr/sbin/dladm: no valid output fields

cneira@Trixie:...lumos-omnios/usr/src/cmd/dladm$ dladm show-link -s -p -o gugus e1000g0
Memory fault(coredump)
cneira@Trixie:...lumos-omnios/usr/src/cmd/dladm$ pstack core
core 'core' of 21811: dladm show-link -s -p -o gugus e1000g0
fedb2325 ascii_strcasecmp () + 42

https://github.com/cneira/illumos-omnios/commit/ee417de61ebb81d3866984a8d8c1c6f907e64e19

#4

Updated by Electric Monk 8 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit a6422048521434dc250a1832c980645e5de26b4e

commit  a6422048521434dc250a1832c980645e5de26b4e
Author: cneira <cneirabustos@gmail.com>
Date:   2019-02-13T21:59:05.000Z

    9287 dladm Segmentation Fault (core dumped) on unknown field
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>

Also available in: Atom PDF