Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 23 of 23

Thread: Using CrashReport on Mac OS

  1. #1
    Senior Member
    Join Date
    Jan 2015
    Location
    UK
    Posts
    179

    Using CrashReport on Mac OS

    I'm using Teensyduino 1.54-beta12 on Mac OS and CrashReport has reported this problem:

    CrashReport:
    A problem occurred at (system time) 0:0:13
    Code was executing from address 0x3042E
    CFSR: 82
    (DACCVIOL) Data Access Violation
    (MMARVALID) Accessed Address: 0x8 (nullptr)
    Check code at 0x3042E - very likely a bug!
    Run "addr2line -e mysketch.ino.elf 0x3042E" for filename & line number.
    Temperature inside the chip was 55.00 C
    Startup CPU clock speed is 600MHz
    Reboot was caused by auto reboot after fault or bad interrupt detected

    I tried to run addr2line -e mysketch.ino.elf but it display an error
    -bash: addr2line: command not found

    So I assume addr2line is not installed. Where can I get addr2line for Mac OS ? Tried to google but some of the answers are very old.

  2. #2
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,437
    Is it in your path?

  3. #3
    Senior Member
    Join Date
    Jan 2015
    Location
    UK
    Posts
    179
    Its not in the current path.

    Is addr2line bundled in the Teensyduino.app ? I can't find it inside the app.

  4. #4
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,437
    Quote Originally Posted by skpang View Post
    Its not in the current path.

    Is addr2line bundled in the Teensyduino.app ? I can't find it inside the app.
    It should be in the same folder as arm-none-eabi-gcc. I use windows, the folder looks like this:

    Click image for larger version. 

Name:	2021-08-18 22_10_21-bin.png 
Views:	31 
Size:	32.9 KB 
ID:	25597
    The name is arm-none-eabi-addr2line.exe here.

  5. #5
    Senior Member
    Join Date
    Jan 2015
    Location
    UK
    Posts
    179
    Found arm-none-eabi-addr2line but the instruction is to use "addr2line" and that doesn't exist.


    When I run arm-none-eabi-addr2line -e lvgl_v8_0_2_test.ino.elf 0x3042E it just print out:
    :?


    Should this give a filename and line number ? No file name or line number.

  6. #6
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,437
    Yes the instruction is wrong. Or, better, inadmissibly abbreviated.

    :? means it could not identify a line. Can't answer why.

  7. #7
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    833
    I've been using it on MacOS to diagnose my own issues lately, though I didn't know about the addr2line bundled in the Teensyduino.app, personally I installed it through Homebrew. The link to the specific brew is here, I also could not find it at first. I quickly tested the bundled one and it does work the same though.

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,276
    Quote Originally Posted by skpang View Post
    Found arm-none-eabi-addr2line but the instruction is to use "addr2line" and that doesn't exist.


    When I run arm-none-eabi-addr2line -e lvgl_v8_0_2_test.ino.elf 0x3042E it just print out:
    :?


    Should this give a filename and line number ? No file name or line number.
    On Windows in a DOS box the addr2line was on my path and just worked as indicated in the CrashReport message when I supplied the address and the ELF file.

    Presented a line number.

  9. #9
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,437
    Hm, but that's not the normal case - there shouldn't be a addr2line in the path, unless you manually added it there or you have installed other software which does that. TD does not do it.

  10. #10
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    15,276
    Quote Originally Posted by Frank B View Post
    Hm, but that's not the normal case - there shouldn't be a addr2line in the path, unless you manually added it there or you have installed other software which does that. TD does not do it.
    I was happy it worked - so didn't ask why.

    I did just find out why: not sure when this installed - probably from installing MSFT Visual Studio - but thankful for it, and that it was added to path:
    Code:
    C:\>where addr2line
    C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\addr2line.exe
    So indeed TeensyInstaller did not put that on the 'PATH' - and finding it would have taken effort, especially with the munged name of : arm-none-eabi-addr2line

  11. #11
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,437
    At least the location of the compiler executables is displayed on every compile in verbose mode.
    Code:
    Using core 'teensy4' from platform in folder: C:\Arduino\hardware\teensy\avr
    Detecting libraries used...
    "C:\\Arduino\\hardware\\teensy/../tools/arm10/bin/arm-none-eabi-g++" -E -CC -x c++ -w -Wall -ffunction-sections -fdata-sections -nostdlib -fno-common -fanalyzer -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=155 -DARDUINO=10815 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "c:\\temp\\arduino_build_42635\\sketch\\sketch_aug19a.ino.cpp" -o nul
    Generating function prototypes...

  12. #12
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    230
    Quote Originally Posted by skpang View Post
    Found arm-none-eabi-addr2line but the instruction is to use "addr2line" and that doesn't exist.


    When I run arm-none-eabi-addr2line -e lvgl_v8_0_2_test.ino.elf 0x3042E it just print out:
    :?


    Should this give a filename and line number ? No file name or line number.
    When I mess up like using the wrong file or to high a number get either ??:0 or :?
    To verify if working, put in a number like 50 or 100 (instead of the 0x3042E) you should see some library locations.

    Also note that if you quit the Arduino(Teensyduino) app the temp folder and elf file will go away.

  13. #13
    Senior Member
    Join Date
    Oct 2019
    Posts
    247
    @skpang did you ever get this to work?
    I'm in the bin folder (/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin) and I also get command not found.

  14. #14
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,767
    Quote Originally Posted by Rezo View Post
    @skpang did you ever get this to work?
    I'm in the bin folder (/Applications/Teensyduino.app/Contents/Java/hardware/tools/arm/bin) and I also get command not found.
    Sorry I don't use my mac much, but on my machine I found something at : hardware\tools\arm\bin\arm-none-eabi-addr2line

    Did not try it, Mac just rebooted, battery down to 0... now up to 1%...

  15. #15
    Senior Member
    Join Date
    Jan 2015
    Location
    UK
    Posts
    179
    You need to use the arm-none-eabi-addr2line instead of addr2line

    That should be in the latest Teensyduino but it didn't really help me much as it didn't point to .c file.

  16. #16
    Senior Member
    Join Date
    Oct 2019
    Posts
    247
    I get the same command not found with arm-none-eabi-addr2line , even though it's in the folder..

  17. #17
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,767
    Again don't use Mac much... but assuming it is like linux... when you type: arm-none-eabi-addr2line
    it looks on the path to find the executable. You need to give it a full path like: ./arm-none-eabi-addr2line

  18. #18
    Senior Member
    Join Date
    Jan 2015
    Location
    UK
    Posts
    179
    You should see these files.
    Click image for larger version. 

Name:	bin.jpg 
Views:	15 
Size:	105.0 KB 
ID:	26174

  19. #19
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    833
    Alternatively you can just drag the file from Finder into terminal rather than cding into the folder and typing it out.

  20. #20
    Senior Member
    Join Date
    Oct 2019
    Posts
    247
    Quote Originally Posted by KurtE View Post
    Again don't use Mac much... but assuming it is like linux... when you type: arm-none-eabi-addr2line
    it looks on the path to find the executable. You need to give it a full path like: ./arm-none-eabi-addr2line
    As usual - you have the right answer

    Now where do I find the elf file - im guessing its in a temp hidden folder?

  21. #21
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Posts
    833
    Either you can use verbose output and look for where the line that generates it says where it is then copy it or what I do is after compiling in the Teensy Loader you can click "Open HEX File" and the finder browser that opens up will show the last compiled sketches folder. From there you can just drag the elf to the terminal window.

  22. #22
    Senior Member
    Join Date
    Mar 2017
    Location
    Oakland, CA, USA
    Posts
    350
    I found I can’t see line numbers unless I also compile with the -g option.

  23. #23
    Senior Member
    Join Date
    Dec 2015
    Location
    LA
    Posts
    230
    Quote Originally Posted by vjmuzik View Post
    Either you can use verbose output and look for where the line that generates it says where it is then copy it or what I do is after compiling in the Teensy Loader you can click "Open HEX File" and the finder browser that opens up will show the last compiled sketches folder. From there you can just drag the elf to the terminal window.
    That idea of using Teensy Loader "Open HEX File" to find the .elf file is a good one, easiest novice way by far. Note that the window that opens will show the .elf file grayed out which normally means you can't select it. Just ignore and drag to the terminal window(then cancel the "Open HEX File" window). I like to be in the terminal directory when issuing commands so now use your method followed by selecting the next folder up and then dragging the folder to paste into the terminal window preceded with 'cd '.

    For those who like alias's, ending the path with ...../T/arduino_b*' seems to get there reliably as below.
    alias ardbuild='/var/folders/q9/pwxvzmz56xvbkcnp3q0gsjkr0000gn/T/arduino_b*'

    Quote Originally Posted by shawn View Post
    I found I can’t see line numbers unless I also compile with the -g option.
    For info the -g option is called in the standard Arduino Teensy setup.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •