WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: xtdesk - Segmentation Fault  (Read 6212 times)

Offline batnas

  • Full Member
  • ***
  • Posts: 122
xtdesk - Segmentation Fault
« on: June 12, 2010, 12:55:56 PM »
I have compiled xtdesk, but when i run it (./xtdesk) it gives me a segmentation fault.
I tried to copy xtdesk from DSL (it works in DSL). It said it needed 2 deps, and i installed them too.
When they were installed, it gave me a segfault AGAIN.

It seems that tinycore needs some vital files, but it does not tell me which files

//Batnas

Offline batnas

  • Full Member
  • ***
  • Posts: 122
Re: xtdesk - Segmentation Fault
« Reply #1 on: June 12, 2010, 01:35:41 PM »
Running dmesg gives me:
Code: [Select]
xtdesk[2692]: segfault at 0 ip b74f7b85 sp bfcdfc40 error 4 in libc-2.11.1.so[b749c000+13d000] ???

//Batnas

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: xtdesk - Segmentation Fault
« Reply #2 on: June 12, 2010, 07:20:03 PM »
To get an idea where the segfault happens you could attempt a "back trace" with GDB.

That means install the gdb-6.8_bin.tcz extension, and if you don't know it already have a look at for example this description of how to obtain a back trace. If you would re-compile with proper debugging settings you could do some proper debugging yourself. To enable those you might find some pointers in the respective application documentation or study the makefiles and / or the configure script.

I believe you should not expect for this forum here to provide you with dedicated "hand holding support" of how to proceed. There are many web pages describing debugging and you'll need to do your own study to develop the respective skills.

Offline batnas

  • Full Member
  • ***
  • Posts: 122
Re: xtdesk - Segmentation Fault
« Reply #3 on: June 13, 2010, 09:08:36 AM »
Thanks I will try that

Offline batnas

  • Full Member
  • ***
  • Posts: 122
Re: xtdesk - Segmentation Fault
« Reply #4 on: June 13, 2010, 09:44:28 AM »
Okay...
I found out, that the problem lies within /lib/libc.so.6 which links to /lib/libc-2.11.1.so
I do not think that there is much i can do about it.
However i found, that glibc (is TCL using glibc??) has a new version; 2.11.2
An update might be considered?

\\Batnas

P.S. FYI DSL is using libc-2.3.2.so - a big downgrade

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: xtdesk - Segmentation Fault
« Reply #5 on: June 14, 2010, 01:18:21 PM »
Your problem isn't exactly with glibc its with gcc. xtdesk is an old package and will compile and run fine with gcc-3.3.6 found in the repo (I just did it). You just need to set your CC and LIBS in the Makefile to the correct location (/opt/gcc-3.3.6).
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline batnas

  • Full Member
  • ***
  • Posts: 122
Re: xtdesk - Segmentation Fault
« Reply #6 on: June 14, 2010, 01:30:31 PM »
I still get the segfault.
I did change CC and LIBS in the makefile.
Can you post your makefile?

What version of xtdesk do you have??

\\Batnas

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: xtdesk - Segmentation Fault
« Reply #7 on: June 14, 2010, 02:04:18 PM »
I am building 0.7b found here: http://garuda.newmail.ru/xtdesk_e.dhtml
This is the Makefile I used:
Code: [Select]
CC = /opt/gcc-3.3.6/bin/g++


#add -DPRNDEBUG - for debug messages

## for Linux
CFLAGS   = -w -I/usr/X11R6/include -DLINUX
#-DPRNDEBUG
LIBS     = -L/opt/gcc-3.3.6/lib -lImlib  -lXaw  -ldl

## for FreeBSD
#CFLAGS   = -w -I/usr/X11R6/include -DFREEBSD
#LIBS     = -L/usr/X11R6/lib -lImlib  -lXaw 

.SUFFIXES: .cc .o
bin      = xtdesk

objs     = desk.o icon.o main.o menu.o Database.o props.o
headers  = desk.h icon.h menu.h Database.h

all: $(bin)

$(bin): $(objs)
$(CC) $(objs) -o $(bin) $(LIBS)

$(objs): $(headers)
.cc.o:
$(CC) $(CFLAGS) -c $<
clean:
rm -f *.o xtdesk

Here are the loaded extensions:
Code: [Select]
base-dev
binutils
bison
cloog
compiletc
diffutils
file
findutils
firmware
flex
gawk
gcc
gcc-3.3.6
gcc_libs
glib1
glib1-dev
gmp
gperf
graphics-libs-1
graphics-libs-1-dev
grep
gtk1
gtk1-dev
imlib
imlib-dev
m4
make
mpfr
patch
pkg-config
ppl
sed
squashfs-tools-4.0
Xorg-7.5-dev
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline SvOlli

  • Full Member
  • ***
  • Posts: 193
  • Linux Developer
Re: xtdesk - Segmentation Fault
« Reply #8 on: June 14, 2010, 02:09:46 PM »
If xtdesk is the one that's found here: http://garuda.newmail.ru/xtdesk_e.dhtml it segfaults, if it can't find a configuration.

Insert a
Code: [Select]
printf("F=%s,tbuf=%s\n",F.c_str(),tbuf);right before this line (#10):
Code: [Select]
while(fgets(tbuf, sizeof(tbuf), f)) {And you'll see what it tries to access and what it reads.

But you're trying to compile code that's about five years out of maintenance. Since then the C++ part of gcc has greatly evolved from 3.x to 4.x and became much more strict. You're riding a dead horse there.