Sponsored Content
Top Forums Programming Odd behavior from GDB while trying to cross-debug an embedded Linux application. Post 303031458 by Corona688 on Thursday 28th of February 2019 02:02:01 PM
Old 02-28-2019
I really doubt the crash is erroneous.

Quote:
So why do I think the gdbserver error is erroneous? Well because both applications are using the same exact version of glibc.
Crashes inside libc are almost always programmer-caused. This one is easy to cause:

Code:
#include <stdlib.h>

int main(void) {
        void *p=malloc(1000);
        free(p);
        free(p); // crash
}

Quote:
In fact, the only differences between the two applications is the changes I made to the code and that code works, I know because I tested it.
Never call code good because it "just works", especially when it crashes. What exact changes did you make to what exact code?

It could be the debugger that's crashing, I suppose. Unlikely but plausible.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Odd .sh behavior in script

Hello, I have been working on a what I thought was a fairly simple script for installing a software kit on Linux and Unix I am not new to scripting but am far from being fluent in sh scripting. any assistance would be appreciated. I have an odd bug occuring when executing the script. When... (2 Replies)
Discussion started by: robertmcol
2 Replies

2. HP-UX

Odd storage behavior

Hi, We have some troubles with our HP server (rx4640) running HP-UX 11.31. The server is attached to a JBod cabinet. If the JBod cabinet is powered on and we power on the server after then HP-UX can't find the devices (disks) at the cabinet. Does not help to run an ioscan -fnC disk. But if I power... (3 Replies)
Discussion started by: hoff
3 Replies

3. Programming

gdb: how to debug an executable file with a few command line papameters

If an executalbe file has several parameters, gdb can not pass parameters correctly. Let us see: run: ./executablefile1 agr1 arg2 arg3 debug: gdb executablefile1 run executalbefile1 arg1 arg2 arg3 then argv : executablefile1 argv : executablefile argv : arg1 ... (3 Replies)
Discussion started by: cdbug
3 Replies

4. Programming

gdb: problem while debug an executable file

I created one file (test.cpp)and complied it and get the executable file(test) and run it.It is giving the out put but when I am trying to debug that executable.I am getting the error -- please tell me the solutions?? Thanks in advance ..... (2 Replies)
Discussion started by: smartgupta
2 Replies

5. UNIX for Advanced & Expert Users

a question about debug using gdb(/lib32/libc.so.6: No such file or directory)

Hi all, (gdb) target remote 192.168.185.196:1389 Remote debugging using 192.168.185.196:1389 warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. 0x2fbd0800 in ?? () (gdb) l 1 ... (0 Replies)
Discussion started by: yanglei_fage
0 Replies

6. Programming

Debug two process Using GDB

Hi All I know How to attach a process to beubg it .But for my application I am using client as well server.Both are two separate process .Suppose I need to debug both .How to attach both of them together .Or I have to attach them separetly . Suppose client process id is 1325 and server is... (2 Replies)
Discussion started by: mr_deb
2 Replies

7. Programming

Can't debug: assert error with gdb (no problem without)

I'm sorry if the title is really criptic, but I don't know how to phrase my problem. I know I can't really ask for a solution, and I normally wouldn't but this is really escaping my abilities. Antefacts. I developed a program using the zeromq messaging library. I got to a point where the... (11 Replies)
Discussion started by: erupter
11 Replies

8. Cybersecurity

Odd behavior from passwd.

Hi Folks, Before I go off and start checking I'm just wondering if anyone has seen this behaviour before. # passwd e825390 Changing password for user e825390. New password: Retype new password: Retype new password: passwd: all authentication tokens updated successfully. As you can... (2 Replies)
Discussion started by: gull04
2 Replies
SHELL-QUOTE(1)						User Contributed Perl Documentation					    SHELL-QUOTE(1)

NAME
shell-quote - quote arguments for safe use, unmodified in a shell command SYNOPSIS
shell-quote [switch]... arg... DESCRIPTION
shell-quote lets you pass arbitrary strings through the shell so that they won't be changed by the shell. This lets you process commands or files with embedded white space or shell globbing characters safely. Here are a few examples. EXAMPLES
ssh preserving args When running a remote command with ssh, ssh doesn't preserve the separate arguments it receives. It just joins them with spaces and passes them to "$SHELL -c". This doesn't work as intended: ssh host touch 'hi there' # fails It creates 2 files, hi and there. Instead, do this: cmd=`shell-quote touch 'hi there'` ssh host "$cmd" This gives you just 1 file, hi there. process find output It's not ordinarily possible to process an arbitrary list of files output by find with a shell script. Anything you put in $IFS to split up the output could legitimately be in a file's name. Here's how you can do it using shell-quote: eval set -- `find -type f -print0 | xargs -0 shell-quote --` debug shell scripts shell-quote is better than echo for debugging shell scripts. debug() { [ -z "$debug" ] || shell-quote "debug:" "$@" } With echo you can't tell the difference between "debug 'foo bar'" and "debug foo bar", but with shell-quote you can. save a command for later shell-quote can be used to build up a shell command to run later. Say you want the user to be able to give you switches for a command you're going to run. If you don't want the switches to be re-evaluated by the shell (which is usually a good idea, else there are things the user can't pass through), you can do something like this: user_switches= while [ $# != 0 ] do case x$1 in x--pass-through) [ $# -gt 1 ] || die "need an argument for $1" user_switches="$user_switches "`shell-quote -- "$2"` shift;; # process other switches esac shift done # later eval "shell-quote some-command $user_switches my args" OPTIONS
--debug Turn debugging on. --help Show the usage message and die. --version Show the version number and exit. AVAILABILITY
The code is licensed under the GNU GPL. Check http://www.argon.org/~roderick/ or CPAN for updated versions. AUTHOR
Roderick Schertler <roderick@argon.org> perl v5.16.3 2010-06-11 SHELL-QUOTE(1)
All times are GMT -4. The time now is 02:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy