180 echo "is_tiered=$is_tiered" |
180 echo "is_tiered=$is_tiered" |
181 |
181 |
182 # crash vm in compiler thread with generation replay data and 'small' dump-file |
182 # crash vm in compiler thread with generation replay data and 'small' dump-file |
183 # $@ - additional vm opts |
183 # $@ - additional vm opts |
184 generate_replay() { |
184 generate_replay() { |
185 # enable core dump |
185 if [ $VM_OS != "windows" ] |
186 ulimit -c unlimited |
186 then |
|
187 # enable core dump |
|
188 ulimit -c unlimited |
|
189 fi |
187 |
190 |
188 cmd="${JAVA} ${TESTVMOPTS} $@ \ |
191 cmd="${JAVA} ${TESTVMOPTS} $@ \ |
189 -Xms8m \ |
192 -Xms8m \ |
190 -Xmx32m \ |
193 -Xmx32m \ |
191 -XX:MetaspaceSize=4m \ |
194 -XX:MetaspaceSize=4m \ |
204 -XX:ReplayDataFile=${replay_data} \ |
207 -XX:ReplayDataFile=${replay_data} \ |
205 -version" |
208 -version" |
206 echo GENERATION OF REPLAY.TXT: |
209 echo GENERATION OF REPLAY.TXT: |
207 echo $cmd |
210 echo $cmd |
208 |
211 |
209 ${cmd} 2>&1 > crash.out |
212 ${cmd} > crash.out 2>&1 |
210 |
213 |
211 core_locations=`grep -i core crash.out | grep "location:" | \ |
214 core_locations=`grep -i core crash.out | grep "location:" | \ |
212 sed -e 's/.*location: //'` |
215 sed -e 's/.*location: //'` |
213 rm crash.out |
216 rm crash.out |
214 # processing core locations for *nix |
217 # processing core locations for *nix |
215 if [ $OS != "windows" ] |
218 if [ $VM_OS != "windows" ] |
216 then |
219 then |
217 # remove 'or' between '/core.<pid>' and 'core' |
220 # remove 'or' between '/core.<pid>' and 'core' |
218 core_locations=`echo $core_locations | \ |
221 core_locations=`echo $core_locations | \ |
219 sed -e 's/\([^ ]*\) or \([^ ]*\)/\1 \2/'` |
222 sed -e 's/\([^ ]*\) or \([^ ]*\)/\1 \2/'` |
220 # add <core_path>/core.<pid> core.<pid> |
223 # add <core_path>/core.<pid> core.<pid> |
221 core=`echo $core_locations | awk '{print $1}'` |
224 core_with_dir=`echo $core_locations | awk '{print $1}'` |
222 dir=`dirname $core` |
225 dir=`dirname $core_with_dir` |
223 core=`basename $core` |
226 core_with_pid=`echo $core_locations | awk '{print $2}'` |
224 if [ -n ${core} ] |
227 if [ -n ${core_with_pid} ] |
225 then |
228 then |
226 core_locations="$core_locations $dir${FS}$core" |
229 core_locations="$core_locations $dir${FS}$core_with_pid $core_with_pid" |
227 fi |
|
228 core=`echo $core_locations | awk '{print $2}'` |
|
229 if [ -n ${core} ] |
|
230 then |
|
231 core_locations="$core_locations $dir${FS}$core" |
|
232 fi |
230 fi |
233 fi |
231 fi |
234 |
232 |
235 echo "LOOKING FOR CORE IN ${core_locations}" |
233 echo "LOOKING FOR CORE IN ${core_locations}" |
236 for core in $core_locations |
234 for core in $core_locations |