-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve simpleParser error detection #27
Conversation
exit -1 if the symtab object failed to be constructed such as when the path is a non-elf or unreadable file
@hainest do you know if there any reason that -1 is used for the error exit status; the exit status is an unsigned 8-bit value so it turns into 255. 1 would be a better choice as shells return 128+n if signal number n causes the exit, so number below 128 are better choices. |
Hmmm. I thought that we had cleaned up all those cases.
--bart
On 4/10/2024 8:57 AM, kupsch wrote:
@hainest
<https://urldefense.com/v3/__https://github.com/hainest__;!!Mak6IKo!LQ-04rTf9AdL7ZtBcmIWIKBxvEeA9eyHy28H3ZNUY_poqKuvCLwHF235H3D1A4drcVMwI5CelH3ugTSOt2KDnV7j$>
do you know if there any reason that -1 is used for the error exit
status; the exit status is an unsigned 8-bit value so it turns into
255. 1 would be a better choice as shells return 128+n if signal
number n causes the exit, so number below 128 are better choices.
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/dyninst/external-tests/pull/27*issuecomment-2047624655__;Iw!!Mak6IKo!LQ-04rTf9AdL7ZtBcmIWIKBxvEeA9eyHy28H3ZNUY_poqKuvCLwHF235H3D1A4drcVMwI5CelH3ugTSOt-O88Bb3$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AESJYW3UGUJS46YFBEBN7HLY4VAONAVCNFSM6AAAAABF7YNGHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGYZDINRVGU__;!!Mak6IKo!LQ-04rTf9AdL7ZtBcmIWIKBxvEeA9eyHy28H3ZNUY_poqKuvCLwHF235H3D1A4drcVMwI5CelH3ugTSOtxsJ8yDD$>.
You are receiving this because you are subscribed to this
thread.Message ID: ***@***.***>
--------------SPptH03EMlF6vjwaNl3LIU0n
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hmmm. I thought that we had cleaned up all those cases.</p>
<p>--bart<br>
</p>
<div class="moz-cite-prefix">On 4/10/2024 8:57 AM, kupsch wrote:<br>
</div>
<blockquote type="cite" ***@***.***">
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hainest/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://urldefense.com/v3/__https://github.com/hainest__;!!Mak6IKo!LQ-04rTf9AdL7ZtBcmIWIKBxvEeA9eyHy28H3ZNUY_poqKuvCLwHF235H3D1A4drcVMwI5CelH3ugTSOt2KDnV7j$" ***@***.***</a> do you know if there any
reason that -1 is used for the error exit status; the exit
status is an unsigned 8-bit value so it turns into 255. 1 would
be a better choice as shells return 128+n if signal number n
causes the exit, so number below 128 are better choices.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>
Reply to this email directly, <a href="https://urldefense.com/v3/__https://github.com/dyninst/external-tests/pull/27*issuecomment-2047624655__;Iw!!Mak6IKo!LQ-04rTf9AdL7ZtBcmIWIKBxvEeA9eyHy28H3ZNUY_poqKuvCLwHF235H3D1A4drcVMwI5CelH3ugTSOt-O88Bb3$" moz-do-not-send="true">view it on GitHub</a>, or <a href="https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AESJYW3UGUJS46YFBEBN7HLY4VAONAVCNFSM6AAAAABF7YNGHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGYZDINRVGU__;!!Mak6IKo!LQ-04rTf9AdL7ZtBcmIWIKBxvEeA9eyHy28H3ZNUY_poqKuvCLwHF235H3D1A4drcVMwI5CelH3ugTSOtxsJ8yDD$" moz-do-not-send="true">unsubscribe</a>.<br>
You are receiving this because you are subscribed to this
thread.<img src="https://github.com/notifications/beacon/AESJYW7HK2EAZGIEWAXQ4J3Y4VAONA5CNFSM6AAAAABF7YNGHSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT2BRC46.gif" alt="" moz-do-not-send="true" width="1" height="1"><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message
ID: <span><dyninst/external-tests/pull/27/c2047624655</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
***@***.***": "http://schema.org",
***@***.***": "EmailMessage",
"potentialAction": {
***@***.***": "ViewAction",
"target": "#27 (comment)",
"url": "#27 (comment)",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
***@***.***": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>
</blockquote>
</body>
</html>
…--------------SPptH03EMlF6vjwaNl3LIU0n--
|
I like to use -1 because it sticks out in the code better than any other non-zero number and doesn't require using stdlib.h for EXIT_FAILURE. I know that it doesn't follow the convention of indicating termination via a signal, but vanishingly few people are ever going to care. You can change it, if it's bothersome. |
Leaving a note for posterity. This also fails for archive files because Symtab::openFile doesn't check for them correctly. |
exit -1 if the symtab object failed to be constructed such as when the path is a non-elf or unreadable file