Jump to content
Sign in to follow this  

Get crash log with clang in Ubuntu 18.04

Recommended Posts

Hi, i just tried to replace GCC with Clang. Normally before i switch i use this script to get the crash log



#! /bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

echo $DIR
cd $DIR

echo "run\n" > gdbcommands
echo "shell echo -e \"SERVERCRASHEVENT\"        " >> gdbcommands
echo "shell echo -e \"\nCRASH ON\" `date`       " >> gdbcommands
echo "info program                              " >> gdbcommands
echo "shell echo -e \"\nBACKTRACE\n\"           " >> gdbcommands
echo "bt                                        " >> gdbcommands
echo "shell echo -e \"\nBACKTRACE FULL\n\"      " >> gdbcommands
echo "bt full                                   " >> gdbcommands
echo "shell echo -e \"\nTHREADS\n\"             " >> gdbcommands
echo "info threads                              " >> gdbcommands
echo "shell echo -e \"\nTHREADS BACKTRACE\n\"   " >> gdbcommands
echo "thread apply all bt full                  " >> gdbcommands

chmod +x gdbcommands

while :
    echo "starting worldserver";
    sleep 5
    mkdir -p crashes
    gdb worldserver --batch -x gdbcommands | tee crashes/current
    FILE=$(date +%s)
    sed -i '1,/SERVERCRASHEVENT/d' crashes/current
    mv crashes/current crashes/$FILE".crash"
    find crashes/ -name '*.crash' -and -size -10k -delete # Remove small files (not crashes)

    echo "worldserver stopped";
        sleep 1


After replacing with Clang compiler, seem like it doesn't generate crash log in to crash folder anymore. I'm not sure what I'm missing, i have tried to search some before i create a new topic but i haven't found any answer then i decided to create this topic to ask for help

Thanks for reading :D

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By cloudfox
      hi there
      i've met a strange problem on linux running TC worldserver.
      everything is ok when i direct type ./worldserver and don't close ssh window. the worldserver session only take 1% less cpu use.
      but when i try to use nohup or setsid to put worldserver backgroud.
      this world server instantly taking 100% cpu percent .no matter how long i wait,%cpu will not come down.
      i even try to use systemctl's service to made server run background,and i found server and systemctl still got 100% cpu use.
      i'm asking for help about how to run server background on ubuntu16.04,and not with 100%cpu use.
  • Create New...