Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
1f42ff13
Commit
1f42ff13
authored
9 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
Get core files from crash_dir
Former-commit-id: 9e7f759370cc5c3057bf22d698d0e0c6cc2ddcf1
parent
bff8ae40
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/cgc_protect/pov_to_cso.sh
+33
-4
33 additions, 4 deletions
tools/cgc_protect/pov_to_cso.sh
with
33 additions
and
4 deletions
tools/cgc_protect/pov_to_cso.sh
+
33
−
4
View file @
1f42ff13
...
...
@@ -11,7 +11,9 @@ CGC_CSID=$2 # cgc name
POV_DIR
=
$3
# directory containing POVs
CSO_FILE
=
$4
# output: CSO warning file suitable for sandboxing step
POV_CRASH_SUMMARY_FILE
=
$5
# input/output: POV-->crash summary file
CRASH_DIR
=
$6
# optional
timeout
=
20
local_crash_summary
=
tmp.crash.summary.
$$
log
=
tmp.log.
$$
...
...
@@ -21,10 +23,14 @@ delimiter="###"
CRASH_SITES
=
tmp.crashes.
$$
ulimit
-c
unlimited
# copy the crash summary file locally
cp
$POV_CRASH_SUMMARY_FILE
$local_crash_summary
# run cb-test on each POV invidually
if
[
-d
${
POV_DIR
}
]
;
then
for
i
in
`
ls
${
POV_DIR
}
/
*
.xml
`
do
echo
""
...
...
@@ -56,13 +62,13 @@ do
sudo rm
$core
2>/dev/null
fi
echo
"sudo
$cbtest
--debug --xml
${
one_pov
}
--timeout
20
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
"
sudo
$cbtest
--debug
--xml
${
one_pov
}
--timeout
20
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
echo
"sudo
$cbtest
--debug --xml
${
one_pov
}
--timeout
$timeout
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
"
sudo
$cbtest
--debug
--xml
${
one_pov
}
--timeout
$timeout
--directory
${
binary_dir
}
--cb
${
binary
}
--log
$log
grep
"core identified"
$log
if
[
$?
-eq
0
]
;
then
if
[
-f
$core
]
;
then
sudo chown
`
whoami
`
$core
eip
=
`
timeout
20
$PEASOUP_HOME
/tools/extract_eip_from_core.sh
${
CGC_BIN
}
$core
`
eip
=
`
timeout
$timeout
$PEASOUP_HOME
/tools/extract_eip_from_core.sh
${
CGC_BIN
}
$core
`
if
[
$?
-eq
0
]
;
then
echo
"
$eip
"
>>
$CRASH_SITES
echo
"
${
pov_base
}${
delimiter
}${
eip
}
"
>>
$local_crash_summary
...
...
@@ -77,9 +83,32 @@ do
else
echo
"
${
pov_base
}${
delimiter
}
0x0"
>>
$local_crash_summary
fi
done
fi
done
#
# Extract crash sites from crashing input dir (if any)
#
if
[
-d
$CRASH_DIR
]
;
then
echo
"crash directory was specified:
$CRASH_DIR
"
for
i
in
`
ls
${
CRASH_DIR
}
/
*
`
do
rm
core &> /dev/null
echo
"cmd: timeout
$timeout
${
CGC_BIN
}
<
$i
&>/dev/null"
# timeout $timeout ${CGC_BIN} < "${i}" &>/dev/null
${
CGC_BIN
}
<
"
${
i
}
"
&>/dev/null
if
[
-f
core
]
;
then
echo
"core detected for:
$i
"
eip
=
`
${
PEASOUP_HOME
}
/tools/extract_eip_from_core.sh
${
CGC_BIN
}
core
`
if
[
$?
-eq
0
]
;
then
echo
$eip
>>
$CRASH_SITES
fi
else
echo
"no core detected for:
$i
"
fi
done
fi
#
# generate policy file for input to sandboxing step
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment