Opened 7 years ago

Closed 7 years ago

#854 closed defect (invalid)

drivedb.h parser ignores lines with // comments

Reported by: Ivan Owned by:
Priority: major Milestone:
Component: drivedb Version: 6.5
Keywords: Cc:

Description

Subj, even those where the comment is after non-commented-out data.

See attached e-mail for an example (I'll send it to smartmontools-database shortly after I get this ticket's number to reference).

Attachments (1)

SAMSUNG MZ7LN512HCHP-000L1 & incorrect DB parsing.eml (16.9 KB ) - added by Ivan 7 years ago.
e-mail with example in attachment

Download all attachments as: .zip

Change History (5)

by Ivan, 7 years ago

e-mail with example in attachment

comment:1 by Christian Franke, 7 years ago

Milestone: undecided

e-mail with example in attachment

PLEASE don't attach base64 encoded .eml files. Use plain comments or attach plain files instead.

249 is the number of gigabytes written to NAND.

OK (but unrelated).

Last but not the least, drivedb.h parser in Smartctl 6.5 turns out to ignore the lines that have the comment, even if it's not the first token in the line.
That's why there are so many unknown attributes in the output.

Could not reproduce this. The command smartctl -P showall produces same output with or without drivedb.diff from your email applied, except for attribute 249.

More than 800 lines of drivedb.h use trailing // comments. If all these lines would be fully ignored, the file would fail to parse.

Please provide a simple testcase which demonstrates your bug report.

comment:2 by Ivan, 7 years ago

Confirmed it to work after deleting drivedb.h and re-downloading it with `update-smart-drivedb' .

I must've tried without drivedb.h .
The parameters 170-174 are indeed not present internally in smartctl rev. 4318 that I have.

(Have two machines here standing side by side, must've downloaded & edited the file on one and expected the changes to magically propagate to the other).

in reply to:  2 comment:3 by Christian Franke, 7 years ago

The parameters 170-174 are indeed not present internally in smartctl rev. 4318 that I have.

This is as expected because these were added in r4376 and merged in r4377.

comment:4 by Christian Franke, 7 years ago

Milestone: undecided
Resolution: invalid
Status: newclosed

The parser handles // comments as expected.

Note: See TracTickets for help on using tickets.