Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

strace
An application I've got locks up linux when execute, it appears to be a
the same point in the application every time. I did a strace of the
application but having some problems understanding all the info.

It appears to be the application locks up during or just after setuping
up all the applications threads but it doesnt give any indication of
what the problem is. No segment fault or anything. Appreciate any
input.

Another thing I've notices in the log file is these two lines (located
just above clone section);
ioctl(11, FIBMAP, 0)                    = -1 EBADF (Bad file
descriptor)
ioctl(12, FIBMAP, 0)                    = -1 EBADF (Bad file
descriptor)

Dont understand what file the method is try to refer to. How can I
debug this problem any further?

Here is strace log:

execve("./software", ["./software"], [/* 35 vars */]) = 0
brk(0)                                  = 0x838b000
uname({sys="Linux", node="pi", ...})    = 0
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=57861, ...}) = 0
old_mmap(NULL, 57861, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7ff1000
close(3)                                = 0
open("/lib/libpthread.so.0", O_RDONLY)  = 3
read(3, " \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\
1\0\0\0\264f\272"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=97220, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7ff0000
old_mmap(0xba2000, 65988, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xba2000
old_mmap(0xbaf000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0xbaf000
old_mmap(0xbb1000, 4548, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xbb1000
close(3)                                = 0
open("/lib/libtermcap.so.2", O_RDONLY)  = 3
read(3, " \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\
1\0\0\0\340\273"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=12924, ...}) = 0
old_mmap(0xa0b000, 14632, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa0b000
old_mmap(0xa0e000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0xa0e000
close(3)                                = 0
open("/usr/local/lib/libstdc++.so.5", O_RDONLY) = 3
read(3, " \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\
1\0\0\0\200\277"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=4272728, ...}) = 0
old_mmap(NULL, 761440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0xb7f36000
old_mmap(0xb7fe6000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xaf000) = 0xb7fe6000
old_mmap(0xb7feb000, 20064, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7feb000
close(3)                                = 0
open("/lib/libm.so.6", O_RDONLY)        = 3
read(3, " \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\
1\0\0\0\20c\217"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=200708, ...}) = 0
old_mmap(0x8f3000, 147616, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x8f3000
old_mmap(0x916000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x916000
close(3)                                = 0
open("/usr/local/lib/libgcc_s.so.1", O_RDONLY) = 3
read(3, " \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\
1\0\0\0\0\23\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=839338, ...}) = 0
old_mmap(NULL, 29140, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0xb7f2e000
old_mmap(0xb7f35000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7000) = 0xb7f35000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, " \177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\
1\0\0\0,\217~\000"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1436472, ...}) = 0
old_mmap(0x7d4000, 1166300, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7d4000
old_mmap(0x8eb000, 16384, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x117000) = 0x8eb000
old_mmap(0x8ef000, 7132, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x8ef000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7f2d000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7f2c000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7f2c6c0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x8eb000, 8192, PROT_READ)     = 0
mprotect(0x916000, 4096, PROT_READ)     = 0
mprotect(0xbaf000, 4096, PROT_READ)     = 0
mprotect(0x7d0000, 4096, PROT_READ)     = 0
munmap(0xb7ff1000, 57861)               = 0
set_tid_address(0xb7f2c708)             = 7011
rt_sigaction(SIGRTMIN, {0xba62d4, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0xba6340, [], SA_RESTART|SA_SIGINFO}, NULL, 8) =
0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) =
0
_sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbffff560, 31, (nil), 0}) = 0
brk(0)                                  = 0x838b000
brk(0x83ac000)                          = 0x83ac000
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7fff000
write(1, "Start Application.\n", 19)    = 19
rt_sigaction(SIGINT, {0x805332a, [INT], SA_RESTART}, {SIG_DFL}, 8) = 0
write(1, "Set scheduling type to Auto.\n", 29) = 29
mlockall(MCL_CURRENT)                   = 0
sched_get_priority_max(SCHED_FIFO)      = 99
sched_setscheduler(0, SCHED_FIFO, { 99 }) = 0
iopl(0x3)                               = 0
open("/dev/rtai_shm", O_RDWR)           = 3
ioctl(3, 0xbb, 0xbffff520)              = 4096
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, 3, 0) =
0xb7ffe000
close(3)                                = 0
ioctl(11, FIBMAP, 0)                    = -1 EBADF (Bad file
descriptor)
ioctl(12, FIBMAP, 0)                    = -1 EBADF (Bad file
descriptor)
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb772c000
mprotect(0xb772c000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb7f2b4c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb7f2bbf8, {entry_number:6, base_addr:0xb7f2bbb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb7f2bbf8) = 7013
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb6f2c000
mprotect(0xb6f2c000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb772b4c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb772bbf8, {entry_number:6, base_addr:0xb772bbb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb772bbf8) = 7014
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb63f4000
mprotect(0xb63f4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb6bf34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb6bf3bf8, {entry_number:6, base_addr:0xb6bf3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb6bf3bf8) = 7015
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb5bf4000
mprotect(0xb5bf4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb63f34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb63f3bf8, {entry_number:6, base_addr:0xb63f3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb63f3bf8) = 7016
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb53f4000
mprotect(0xb53f4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb5bf34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb5bf3bf8, {entry_number:6, base_addr:0xb5bf3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb5bf3bf8) = 7017
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb4bf4000
mprotect(0xb4bf4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb53f34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb53f3bf8, {entry_number:6, base_addr:0xb53f3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb53f3bf8) = 7018
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb43f4000
mprotect(0xb43f4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb4bf34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb4bf3bf8, {entry_number:6, base_addr:0xb4bf3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb4bf3bf8) = 7019
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb3bf4000
mprotect(0xb3bf4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb43f34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb43f3bf8, {entry_number:6, base_addr:0xb43f3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb43f3bf8) = 7020
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb33f4000
mprotect(0xb33f4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb3bf34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb3bf3bf8, {entry_number:6, base_addr:0xb3bf3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb3bf3bf8) = 7021
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb2bf4000
mprotect(0xb2bf4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb33f34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb33f3bf8, {entry_number:6, base_addr:0xb33f3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb33f3bf8) = 7022
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb23f4000
mprotect(0xb23f4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb2bf34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb2bf3bf8, {entry_number:6, base_addr:0xb2bf3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb2bf3bf8) = 7023
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb1bf4000
mprotect(0xb1bf4000, 4096, PROT_NONE)   = 0
clone(child_stack=0xb23f34c4,
 flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLON
E_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM
 |CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_
CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb23f3bf8, {entry_number:6, base_addr:0xb23f3bb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb23f3bf8) = 7024


Report this thread to moderator Post Follow-up to this message
Old Post
RedLars
05-15-06 01:06 PM


Re: strace
"RedLars" <Liverpool1892@gmail.com> writes:

> An application I've got locks up linux when execute, it appears to be a
> the same point in the application every time. I did a strace of the
> application but having some problems understanding all the info.

"strace" is the wrong tool for this problem.
Learn/use gdb instead.

> Another thing I've notices in the log file is these two lines (located
> just above clone section);
> ioctl(11, FIBMAP, 0)                    = -1 EBADF (Bad file
> descriptor)

Get a decent news reader -- reading wrapped lines from strace is
no fun, and you'll likely be ignored if you continue posting them.

> Dont understand what file the method is try to refer to.

Try "man ioctl" and look for FIBMAP in /usr/include/linux/fs.h

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

Report this thread to moderator Post Follow-up to this message
Old Post
Paul Pluzhnikov
05-15-06 01:06 PM


Re: strace
Thanks for your reply.

Tried to use gdb but encountered a small problem and was hoping someone
here could answer it for me.

My application consists of several threads that all run in loops and I
use ctrl-c and signal() to make the threads exit the loops and
terminate the application. However, when running my app in gdb and
pressing ctrl-c I quit the debuging but my app never seems to receive
the ctrl-c message and is not properly terminated (resources are not
released). Is there a way around this problem without having to make
changes to my source code? Cheers


Report this thread to moderator Post Follow-up to this message
Old Post
RedLars
05-16-06 12:08 AM


Re: strace
"RedLars" <Liverpool1892@gmail.com> writes:

> Thanks for your reply.
>
> Tried to use gdb but encountered a small problem and was hoping someone
> here could answer it for me.
>
> My application consists of several threads that all run in loops and I
> use ctrl-c and signal() to make the threads exit the loops and
> terminate the application. However, when running my app in gdb and
> pressing ctrl-c I quit the debuging but my app never seems to receive
> the ctrl-c message and is not properly terminated (resources are not
> released). Is there a way around this problem without having to make
> changes to my source code? Cheers

In gdb, there is a handle command to tell it what to do with
signals. You can forward them to the application.


(gdb) help handle
Specify how to handle a signal.
Args are signals and actions to apply to those signals.
Symbolic signals (e.g. SIGSEGV) are recommended but numeric signals
from 1-15 are allowed for compatibility with old versions of GDB.
Numeric ranges may be specified with the form LOW-HIGH (e.g. 1-5).
The special arg "all" is recognized to mean all signals except those
used by the debugger, typically SIGTRAP and SIGINT.
Recognized actions include "stop", "nostop", "print", "noprint",
"pass", "nopass", "ignore", or "noignore".
Stop means reenter debugger if this signal happens (implies print).
Print means print a message if this signal happens.
Pass means let program see this signal; otherwise program doesn't know.
Ignore is a synonym for nopass and noignore is a synonym for pass.
Pass and Stop may be combined.

--
__Pascal Bourguignon__                     http://www.informatimago.com/

THIS IS A 100% MATTER PRODUCT: In the unlikely event that this
merchandise should contact antimatter in any form, a catastrophic
explosion will result.

Report this thread to moderator Post Follow-up to this message
Old Post
Pascal Bourguignon
05-16-06 12:08 AM


Re: strace
Pascal Bourguignon <pjb@informatimago.com> writes:

> In gdb, there is a handle command to tell it what to do with
> signals. You can forward them to the application.

In addition, you can send any signal to the app from the (gdb) prompt
(regardless of pass/nopass "handle" setting):

(gdb) signal SIGINT     # continues the app, delivering it SIGINT.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.

Report this thread to moderator Post Follow-up to this message
Old Post
Paul Pluzhnikov
05-16-06 03:01 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:10 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.