Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Crash : "child killed: segmentation violation."

2,190 views
Skip to first unread message

pallav singh

unread,
Jul 30, 2013, 1:22:03 PM7/30/13
to
Hi All,

i facing segmentation fault running the following script on ReDHat 5.8 and TCLSH script. before Running My product executable , script run fine , but After Running My product Code It FAILS.

Please do let me what could be Root cause Causing Script give Message
"child killed: segmentation violation."

Is it Operating System or Shell BUG, Or Some Environment Changes can cause this crash?

--------------- dbg_test----------------
#!/bin/ksh

calledAsDBG=$0
echo "${calledAsDBG}";
echo `/bin/ls -l "${calledAsDBG}"`
dbg_link=`/bin/ls -l "${calledAsDBG}"`
dbg_link=${dbg_link#* -\> }
echo "${dbg_link}";
-------------------------------------------

1.Save the above dbg_test script under debug_patch directory.

2. Create a symbolic link as follows:
%> ln -s ./debug_patch/dbg_test link_dbg_test

3. The dir should look like:
link_dbg_test -> ./debug_patch/dbg_test

%> link_dbg_test
Result:
-------------------------------
ncsim: *E,TCLERR: ./link_dbg_test
child killed: segmentation violation.
while executing
"exec ./link_dbg_test"
("uplevel" body line 1)
invoked from within
"uplevel 1 exec $redir $new [lrange $args 1 end]"
(procedure "::unknown" line 114)
invoked from within
"link_dbg_test"
-------------------------------

Thanks
Pallav Singh

Donal K. Fellows

unread,
Jul 31, 2013, 6:31:05 AM7/31/13
to
On 30/07/2013 18:22, pallav singh wrote:
> i facing segmentation fault running the following script on ReDHat 5.8
> and TCLSH script. before Running My product executable, script run fine,
> but After Running My product Code It FAILS.
>
> Please do let me what could be Root cause Causing Script give Message
> "child killed: segmentation violation."
>
> Is it Operating System or Shell BUG, Or Some Environment Changes can
> cause this crash?

I'd guess that it is probably a shell bug, rather than an environment
modification (and an outright OS bug is unlikely). However, all Tcl is
doing is faithfully reporting that the crash happened, so that's about
the extent of our formal interest. Formally speaking, of course.

What happens when you call from a normal shell without Tcl involved?
That *should* be a crash just the same. (If you're just wanting to read
a link, [file link $filename] works just fine, provided you deal with
the 'not-a-link' error.)

I suspect that the issue could be related to the real $0 actually being
a filehandle in /proc (used to avoid critical security problems with
race conditions) interacting badly with the rest of the code. Either
that or there's a problem with the shell substitution code; myself, I'd
use sed for that sort of cleanup task, as that is pretty well tested:

dbg_link=`echo $dbg_link | sed 's/.* -> //'`

That works for me when I test it in /usr/bin/bash

Donal.
--
Donal Fellows — Tcl user, Tcl maintainer, TIP editor.

pallav singh

unread,
Aug 14, 2013, 11:20:22 AM8/14/13
to
we are facing Crash in KSH shell calling simple scripts also.
Crash happen in 2nd Line of script.

/bin/ls -l newdbg_script // It Pass

test=`/bin/ls -l newdbg_script ` // It Fails

+++++++++++++++++++++++++++++++++
#!/bin/ksh

test=`/bin/ls -l newdbg_script `
echo $test
+++++++++++++++++++++++++++++++++

Thanks
Pallav Singh

pallav singh

unread,
Aug 15, 2013, 2:17:37 AM8/15/13
to
We are seeing Crash in /bin/ksh93 running KSH script.

+++++++++++++++++++++++++++++++++
#!/bin/ksh

test=`/bin/ls -l newdbg_script `
echo $test
+++++++++++++++++++++++++++++++++

[Thread debugging using libthread_db enabled]
[New Thread 0xf7de9190 (LWP 11826)]
[New process 11826]
Executing new program: /bin/ksh93
Error in re-setting breakpoint 1: Cannot access memory at address 0x77a810
Error in re-setting breakpoint 2: Function "main" not defined.
warning: Cannot initialize thread debugging library: generic error
(no debugging symbols found)
[New process 11826]
Executing new program: /bin/ksh93
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGSEGV, Segmentation fault.
[Switching to process 11826]
0x00000000004bfd17 in ?? ()
(gdb) where
#0 0x00000000004bfd17 in ?? ()
#1 0x00000000004c0972 in ?? ()
#2 0x00000000004ac5a1 in ?? ()
#3 0x00000000004ad871 in ?? ()
#4 0x00000000004ada08 in ?? ()
#5 0x0000000000486967 in ?? ()
#6 0x0000000000430fd8 in ?? ()
#7 0x000000000044c1b6 in ?? ()
#8 0x0000000000446035 in ?? ()
#9 0x000000000042a6dc in ?? ()
#10 0x000000000042c1a8 in ?? ()
#11 0x000000000042f952 in ?? ()
#12 0x0000000000466489 in ?? ()
#13 0x000000000044bd0a in ?? ()
#14 0x0000000000407c74 in ?? ()
#15 0x000000000040710a in ?? ()
#16 0x00000035fdc1d994 in __libc_start_main () from /lib64/libc.so.6
#17 0x0000000000406339 in ?? ()
#18 0x00007fff23790258 in ?? ()
#19 0x0000000000000000 in ?? ()
(gdb) detach


Thanks
Pallav Singh
0 new messages