cloudy-astrophysics / bug-tracker-migration-test

Trial run for importing the nublado.org Trac tickets as GitHub issues
0 stars 0 forks source link

poorly formated line list causes segfault (trac #335) #337

Closed cloudy-bot closed 5 years ago

cloudy-bot commented 9 years ago

reported by: @CloudyLex

The following causes a segfault:

test.in:

test
save line list "test.lin" "linelist_h.old"

lineslist_h.old:
 # new linefile
 H  1 6562.85A
 Ca B 6562.85A

The linelist file has a leading space, a common error when lines are copy/pated from the output.

The segfault:


Program received signal SIGSEGV, Segmentation fault.
0x000000000040ec28 in t_LineSave::wavelength (this=0x128cc60 <LineSave>,
    index=4575657221408423936) at ../lines.h:146
146         return m_wavelength[index];
Missing separate debuginfos, use: debuginfo-install glibc-2.17-78.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libstdc++-4.8.3-9.el7.x86_64

(gdb) print index
$1 = 4575657221408423936

The array index is way too large. We need to detect and exit gracefully from this user input format error.

Migrated from https://www.nublado.org/ticket/335

{
    "status": "closed",
    "changetime": "2019-02-04T12:08:14Z",
    "_ts": "1549282094687722",
    "description": "The following causes a segfault:\n\n{{{\ntest.in:\n\ntest\nsave line list \"test.lin\" \"linelist_h.old\"\n\nlineslist_h.old:\n # new linefile\n H  1 6562.85A\n Ca B 6562.85A\n}}}\n\nThe linelist file has a leading space, a common error when lines are copy/pated from the output.\n\nThe segfault:\n{{{\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x000000000040ec28 in t_LineSave::wavelength (this=0x128cc60 <LineSave>,\n    index=4575657221408423936) at ../lines.h:146\n146\t\t\treturn m_wavelength[index];\nMissing separate debuginfos, use: debuginfo-install glibc-2.17-78.el7.x86_64 libgcc-4.8.3-9.el7.x86_64 libstdc++-4.8.3-9.el7.x86_64\n\n\n(gdb) print index\n$1 = 4575657221408423936\n}}}\n\nThe array index is way too large.  We need to detect and exit gracefully from this user input format error.",
    "reporter": "gary",
    "cc": "",
    "resolution": "fixed",
    "time": "2015-07-08T19:24:54Z",
    "component": "input parser",
    "summary": "poorly formated line list causes segfault",
    "priority": "blocker",
    "keywords": "",
    "version": "trunk",
    "milestone": "c17 branch",
    "owner": "nobody",
    "type": "defect - FPE"
}
cloudy-bot commented 9 years ago

input Attachment: test.in

cloudy-bot commented 9 years ago

line list file with formatting problem Attachment: linelist_h.old

cloudy-bot commented 9 years ago

r10493 avoids the SEGV, and prints as helpful an error message as is possible given the input to findline()

cloudy-bot commented 9 years ago

Milestone renamed