Analyze performance – Debugging Failed – gdbserver exited with code 1

Sysprogs forums Forums VisualGDB Analyze performance – Debugging Failed – gdbserver exited with code 1

This topic contains 18 replies, has 3 voices, and was last updated by  tomas.khandl 1 month, 3 weeks ago.

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #21520

    tomas.khandl
    Participant

    Hi,

    I want analyze performance on my raspberryPi c++ project but I’m still getting some errors.

    Building and running Release/Debug works fine.

    I’m using VS2017 15.5.2, visual GDB 5.3.

    valgrind-3.7.0 on my raspberry PI 3b+

     

    When I ran “Profile with debugging”, then I’ll get “gdbserver exited with code 1”

    Gdb session:

    blank

     

    Exception details:

    ig: gdbserver exited with code 1
    at v4.f2()
    at v4.k_2(DebugCustomizationSettings a)
    at uu.w1()
    at VisualGDB.GDBDebugEngine.x(tw1 a, i2 b)

     

    Valgrind diagnostics:


    ==819== For interactive control, run ‘callgrind_control -h’.
    –819– WARNING: Serious error when reading debug info
    –819– When reading debug info from /lib/arm-linux-gnueabihf/ld-2.24.so:
    –819– Ignoring non-Dwarf2/3/4 block in .debug_info
    –819– WARNING: Serious error when reading debug info
    –819– When reading debug info from /lib/arm-linux-gnueabihf/ld-2.24.so:
    –819– Last block truncated in .debug_info; ignoring
    ==819== (action at startup) vgdb me …
    ==819==
    ==819== TO DEBUG THIS PROCESS USING GDB: start GDB like this
    ==819==   /path/to/gdb /home/pi/Projects/{projectName}/../../VisualGDB/Release/{projectName}
    ==819== and then give GDB the following command
    ==819==   target remote | /usr/lib/valgrind/../../bin/vgdb –pid=819 –vgdb-prefix=/tmp/296519e9-fcb7-4b2c-a44f-0f59509bce73
    ==819== –pid is optional if only one valgrind process is running
    ==819==

     

    vgdb:

    vgdb error: no FIFO found and no pid given

     

    Same result with “Debug and get ready to profile”. “Profile without debugging” just open some console but nothing happen. (maybe it is running in “loop” in my menu?)

    It looks like issue with valgrind. Have you some list of compatible versions?

    There is posibility to set requested args to valgrind? Do you need some more info like logs or files?

     

    Thanks

     

    #21523

    support
    Keymaster

    Hi,

    It looks like an incompatibility between the debug information format stored in the object files and valgrind. You might be able to resolve it by explicitly forcing the debug format to an older version of DWARF by adding “-gdwarf-2/3/4” to the CFLAGS/CXXFLAGS.

    You can access advanced VisualGDB logs (that include all command lines launched via SSH) via View->Other Windows->VisualGDB Diagnostics Console.

    You can add extra arguments to Valgrind via the “Additional Valgrind flags” field in the New Profiling Session window.

    If you need any further help, do not hesitate to get back to us.

    #21539

    tomas.khandl
    Participant

    Thanks for fast response.

    When I’m using MSBUILD for that project, will it be sufficient to add that flag “-gdwarf-2/3/4” to project Properties-> configuration properties -> c/c++ -> command line -> additional options?

    Correct me if I’m wrong.

     

    Anyway after some searching I found, that it’s probably Valgrind bug:

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=810295

     

    I’ll try your suggestion this evening and also upgrade Valgrind and write here results.

     

    #21553

    support
    Keymaster

    Hi,

    The MSBuild projects define a GUI option for the debug information format (C/C++ -> General -> Debug Information Format), so specifying it via command line would result in 2 different settings passed via the command line. Please instead change the corresponding GUI setting. If the value you are trying to add is not shown in the dropdown list, simply enter the corresponding flag (e.g. -gdwarf-5) in the field directly.

    #21556

    tomas.khandl
    Participant

    Hi,

    thanks for info. Mentioned libraries wasn’t built by my project and thus I decided to upgrade Valgrind to to lastest version – valgrind-3.14.0.GIT (Changing flags didn’t help, as I expected).

    The issue with warnings regarding reading of debug info is solved. It looks the valgrind didn’t support compressed symbols till version 3.11 (probably you could verify that finding and handle it).

    But I’m still unable to profile my application because I’m getting all other errors. Do you have an idea what could be wrong?

    Thanks

    #21557

    support
    Keymaster

    Hi,

    We would advise running a few quick experiments to understand what components could be causing this:

    • Try profiling a “hello, world” program with VisualGDB.
    • If it doesn’t work, try running valgrind manually (let us know if you need help with command lines).
    • It the “hello, world” works, try running valgrind manually with your program.

    If it looks like the problem is between valgrind and your specific project, please try simplifying it (e.g. removing some sources/libraries/optimization settings). If the problem occurs with VisualGDB, but doesn’t occur otherwise, it’s likely caused by some arguments VisualGDB is using. In this case please try comparing the command lines that work and the command lines used by VisualGDB (from View->Other->VisualGDB Diagnostics Console).

    If you need further help at any step, don’t hesitate to get back to us.

    #21573

    tomas.khandl
    Participant

    Hi,

    Yeah, hello world have same issues like my project.

    I think Valgrind is OK, because profiling without debug is working since I’ve updated it.

    It looks like the GDB is launching with wrong params like Valgrind output says.

     

    gdb version:

    GNU gdbserver (Raspbian 7.12-6) 7.12.0.20161007-git

    #21575

    support
    Keymaster

    Hi,

    Thanks for checking this. We should be able to help you resolve this if you could attach the output from the VisualGDB Diagnostics Console showing all command lines it launches and the corresponding output from valgrind.

    #21612

    tomas.khandl
    Participant

    Hi,

    Here is diagnostic output

    And Vallgrind output:

    Thanks

    • This reply was modified 3 months, 1 week ago by  tomas.khandl.
    #21614

    tomas.khandl
    Participant

    It looks like inconsistency with temporary folders.

    #21622

    support
    Keymaster

    Hi,

    Thanks for sharing the output. It looks like VisualGDB doesn’t launch valgrind at all (or you did not attach the relevant part of the log).

    Either way, please try this build, it will log more details about valgrind-related tools in the diagnostics console: http://sysprogs.com/files/tmp/VisualGDB-5.4.4.2395.msi

    Please try reproducing the problem again and attach the entire contents of the VisualGDB Diagnostics Console so we could see what exactly is going on.

    #21626

    tomas.khandl
    Participant

    I’ve attached log except initialization of console.
    Here is whole log from new version.

    Vallgrind output is simmilar as before and vgdb output is same.

    ==4768== Callgrind, a call-graph generating cache profiler
    ==4768== Copyright (C) 2002-2017, and GNU GPL'd, by Josef Weidendorfer et al.
    ==4768== Using Valgrind-3.14.0.GIT and LibVEX; rerun with -h for copyright info
    ==4768== Command: /tmp/raspTest2
    ==4768== Parent PID: 4701
    ==4768==
    ==4768== For interactive control, run 'callgrind_control --vgdb-prefix=/tmp/5a1490b2-2216-465a-a123-1534b7645f35 -h'.
    ==4768== (action at startup) vgdb me ...
    ==4768==
    ==4768== TO DEBUG THIS PROCESS USING GDB: start GDB like this
    ==4768== /path/to/gdb /tmp/raspTest2
    ==4768== and then give GDB the following command
    ==4768== target remote | /usr/local/lib/valgrind/../../bin/vgdb --vgdb-prefix=/tmp/5a1490b2-2216-465a-a123-1534b7645f35 --pid=4768
    ==4768== --pid is optional if only one valgrind process is running
    ==4768==

    • This reply was modified 3 months, 1 week ago by  tomas.khandl.
    #21639

    support
    Keymaster

    Hi,

    Thanks for the detailed log. It looks like both valgrind components involved in debugging are started with matching settings, so the problem is likely caused by some settings on your Raspberry Pi interfering with valgrind. One quick way to fix this would be to reset the SD card image (we have just rechecked valgrind with the latest SD card image).

    Another way would be to narrow this down by running the commands manually. I.e. restart Raspberry Pi to clean the /tmp folder and run the following commands manually:

    If the problem can be reproduced, please try experimenting with the prefix (e.g. locating it in a different directory or removing it completely).

    If the problem does not reproduce, please try using the full command lines from the log (with the environment). If this causes the issue, try experimenting with the environment part to pinpoint a specific environment variable that breaks valgrind and remove it via Tools->VisualGDB->Manage SSH connections->Per-host settings.

    #21883

    peteras17
    Participant

    Hello,

    I’m having exactly the same problem on my side, and resetting the SD card did not solve the problem!

    Is there any known functionnal solution yet?

     

    Attachments:
    You must be logged in to view attached files.
    #21894

    support
    Keymaster

    Hi,

    Unfortunately we were never able to reproduce this on our side, or hear any more details about this, so it’s hard to suggest anything beyond the existing advice.

    We might be able to see what is going on and suggest a fix if you could try extracting the valgrind command lines from the diagnostics console, running them manually on Raspberry Pi and sharing the results.

    Let us know if you need more details.

Viewing 15 posts - 1 through 15 (of 19 total)

The topic ‘Analyze performance – Debugging Failed – gdbserver exited with code 1’ is closed to new replies.