# KTorrent crashes whole machine

## charlesnadeau

I am using KTorrent 2.0.2 and since a couple of weeks or so, it randomly crashes, bringing down the whole machine. I looked into /var/log/messages and was able to get the last messages written before the machine went down:

```

Dec 12 00:11:06 Fukuoka <1>Unable to handle kernel paging request at virtual address 8c000085

Dec 12 00:11:06 Fukuoka printing eip:

Dec 12 00:11:06 Fukuoka c047d136

Dec 12 00:11:06 Fukuoka *pde = 2511ada0

Dec 12 00:11:06 Fukuoka Oops: 0002 [#2]

Dec 12 00:11:06 Fukuoka PREEMPT SMP 

Dec 12 00:11:06 Fukuoka Modules linked in: nvidia snd_seq_midi snd_emu10k1_synth snd_emux_synth snd_seq_virmidi snd_seq_midi_emul snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq snd_emu10k1 snd_rawmidi snd_seq_device snd_ac97_codec snd_pcm snd_timer snd_ac97_bus snd_page_alloc snd_util_mem snd_hwdep snd soundcore

Dec 12 00:11:06 Fukuoka CPU:    1

Dec 12 00:11:06 Fukuoka EIP:    0060:[<c047d136>]    Tainted: P      VLI

Dec 12 00:11:06 Fukuoka EFLAGS: 00010282   (2.6.15-gentoo-r1) 

Dec 12 00:11:06 Fukuoka EIP is at tcp_sendmsg+0xa36/0xb90

Dec 12 00:11:06 Fukuoka eax: c15610e0   ebx: f4771e80   ecx: 0000002c   edx: 00000000

Dec 12 00:11:06 Fukuoka esi: 0000008c   edi: f501f240   ebp: f5795f44   esp: f5795d34

Dec 12 00:11:06 Fukuoka ds: 007b   es: 007b   ss: 0068

Dec 12 00:11:06 Fukuoka Process ktorrent (pid: 15194, threadinfo=f5794000 task=f56225d0)

Dec 12 00:11:06 Fukuoka Stack: c1565b40 af443a73 00000034 00000000 c046b57b 00000001 f502172c 00000000 

Dec 12 00:11:06 Fukuoka 000000c0 00000000 00000001 00000000 00004040 00000578 00007dc8 0000008c 

Dec 12 00:11:06 Fukuoka af443aa7 00000000 00000001 c15610e0 00000000 f50216c0 f5795f28 00000000 

Dec 12 00:11:06 Fukuoka Call Trace:

Dec 12 00:11:06 Fukuoka [<c046b57b>] nf_iterate+0x6b/0x90

Dec 12 00:11:06 Fukuoka [<c044e946>] sock_sendmsg+0xe6/0x120

Dec 12 00:11:06 Fukuoka [<c0135640>] autoremove_wake_function+0x0/0x60

Dec 12 00:11:06 Fukuoka [<c0135640>] autoremove_wake_function+0x0/0x60

Dec 12 00:11:06 Fukuoka [<c0148f60>] get_page_from_freelist+0xc0/0xd0

Dec 12 00:11:06 Fukuoka [<c0148fd9>] __alloc_pages+0x69/0x310

Dec 12 00:11:06 Fukuoka [<c044e668>] sockfd_lookup+0x18/0x90

Dec 12 00:11:06 Fukuoka [<c0450048>] sys_sendto+0x128/0x170

Dec 12 00:11:06 Fukuoka [<c01492b4>] __get_free_pages+0x34/0x60

Dec 12 00:11:06 Fukuoka [<c017b22a>] poll_freewait+0x3a/0x50

Dec 12 00:11:06 Fukuoka [<c017b70e>] do_select+0x31e/0x350

Dec 12 00:11:06 Fukuoka [<c0452ce7>] lock_sock+0x17/0x40

Dec 12 00:11:06 Fukuoka [<c04500c7>] sys_send+0x37/0x40

Dec 12 00:11:06 Fukuoka [<c0450ac0>] sys_socketcall+0x180/0x2b0

Dec 12 00:11:06 Fukuoka [<c012427b>] sys_gettimeofday+0x3b/0x90

Dec 12 00:11:06 Fukuoka [<c0103147>] sysenter_past_esp+0x54/0x75

Dec 12 00:11:06 Fukuoka Code: 24 60 83 e2 07 83 fa 04 0f 8f 61 01 00 00 89 d0 c1 e0 04 8d 8c 90 00 ef 57 c0 8b 44 24 60 31 d2 e8 40 be cc ff 85 c0 89 44 24 4c <0f> 85 be f9 ff ff 8b 47 20 ff 50 48 f6 47 24 10 0f 85 c5 f6 ff 

```

Anybody else with this problem? Do you think it shows memory problem?

My kernel is:

```
Linux Fukuoka 2.6.15-gentoo-r1 #6 SMP PREEMPT Mon Dec 11 18:00:16 EST 2006 i686 AMD Athlon(tm) MP 1800+ AuthenticAMD GNU/Linux
```

And gcc's version is 

```

Using built-in specs.

Target: i686-pc-linux-gnu

Configured with: /var/tmp/portage/gcc-4.1.1-r1/work/gcc-4.1.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu

Thread model: posix

gcc version 4.1.1 (Gentoo 4.1.1-r1)

```

Thanks!

Charles

----------

## Keruskerfuerst

You can check your memory by using memtest.

The lastest kernel is version 2.6.18-r4.

What glibc version is installed? (emerge --info)

I have used Bittorrent with GUI without any problems for some time.

----------

## charlesnadeau

 *Keruskerfuerst wrote:*   

> You can check your memory by using memtest.
> 
> The lastest kernel is version 2.6.18-r4.
> 
> What glibc version is installed? (emerge --info)
> ...

 

Oups...

```

Fukuoka linux # emerge --info

!!! Invalid token (not "=") export

Traceback (most recent call last):

  File "/usr/bin/emerge", line 4049, in ?

    emerge_main()

  File "/usr/bin/emerge", line 3768, in emerge_main

    settings, trees, mtimedb = load_emerge_config()

  File "/usr/bin/emerge", line 3679, in load_emerge_config

    trees = portage.create_trees(trees=trees, **kwargs)

  File "/usr/lib/portage/pym/portage.py", line 6780, in create_trees

    config_incrementals=portage_const.INCREMENTALS)

  File "/usr/lib/portage/pym/portage.py", line 1045, in __init__

    env_d = getconfig(

  File "/usr/lib/portage/pym/portage_util.py", line 283, in getconfig

    raise portage_exception.ParseError(str(e)+" in "+mycfg)

portage_exception.ParseError: "ParseError: Invalid token (not '='): /etc/profile.env: line 46 in /etc/profile.env"

```

And here's profile.env

```

# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.

# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES

# GO INTO /etc/profile NOT /etc/profile.env

export ORACLE_OWNER='oracle'

export DISTCC_LOG=''

export KDEDIRS='/usr/kde/3.5:/usr:/usr/local'

export OPENGL_PROFILE='xorg-x11'

export ORACLE_HOSTNAME='Fukuoka.mosix.cyberus.ca'

export DISABLE_HUGETLBFS='1'

export CLASSPATH='.:/opt/oracle/product/10.1.0.3/jdbc/lib/classes12.zip'

export PRELINK_PATH_MASK='/usr/lib/gstreamer-0.10:/usr/lib/gstreamer-0.8'

export GCC_SPECS=''

export JAVA_HOME='/opt/blackdown-jdk-1.4.2.03'

export LESSOPEN='|lesspipe.sh %s'

export ANT_HOME='/usr/share/ant-core'

export ROOTPATH='/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/kde/3.4/sbin:/usr/kde/3.4/bin:/usr/NX/bin:/opt/oracle/product/10.1.0.3/bin'

export LESS='-R -M --shift 5'

export PATH='/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.1:/opt/blackdown-jdk-1.4.2.03/bin:/opt/blackdown-jdk-1.4.2.03/jre/bin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/kde/3.4/bin:/usr/NX/bin:/opt/oracle/product/10.1.0.3/bin'

export VMHANDLE='blackdown-jdk-1.4.2'

export ORACLE_BASE='/opt/oracle'

export GDK_USE_XFT='1'

export G_BROKEN_FILENAMES='1'

export CVS_RSH='ssh'

export LD_LIBRARY_PATH='/opt/oracle/product/10.1.0.3/lib:/opt/oracle/product/10.1.0.3/lib32'

export GENERATION='2'

export PKG_CONFIG_PATH='/usr/qt/3/lib/pkgconfig'

export MANPATH='/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/man:/opt/blackdown-jdk-1.4.2.03/man:/etc/java-config/system-vm/man/:/usr/qt/3/doc/man'

export ORA_NLS10='/opt/oracle/product/10.1.0.3/nls/data'

export G_FILENAME_ENCODING='UTF-8'

export ORACLE_HOME='/opt/oracle/product/10.1.0.3'

export ORACLE_TERM='xterm'

export PAGER='/usr/bin/less'

export TNS_ADMIN='/opt/oracle/product/10.1.0.3/network/admin'

export MOZILLA_FIVE_HOME='/usr/lib/mozilla'

export CONFIG_PROTECT_MASK='/etc/java-config/vms/ /etc/env.d/java/ /etc/gconf /etc/terminfo /etc/texmf/web2c /etc/revdep-rebuild'

export PYTHONDOCS='/usr/share/doc/python-docs-2.4.3/html'

export CONFIG_PROTECT='/usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/kde/3.5/share/config /usr/kde/3.5/env /usr/kde/3.5/shutdown /usr/share/config /usr/kde/3.4/share/config /usr/kde/3.4/env /usr/kde/3.4/shutdown'

export QMAKESPEC='linux-g++'

export NLS_LANG='AMERICAN_AMERICA.WE8ISO8859P1'

export JDK_HOME='/opt/blackdown-jdk-1.4.2.03'

export DCCC_PATH='/usr/lib/distcc/bin'

export DISTCC_VERBOSE='0'

export QTDIR='/usr/qt/3'

export ORACLE_SID=''db1''

export JAVAC='/opt/blackdown-jdk-1.4.2.03/bin/javac'

export PYTHONPATH='/usr/lib/portage/pym'

export RUBYOPT='-rauto_gem'

export INFOPATH='/usr/share/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.16.1/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.1.1/info'

```

How should I fix it?

Thanks!

Charles

----------

## Keruskerfuerst

What says emerge -av --deep world?

----------

## charlesnadeau

 *Keruskerfuerst wrote:*   

> What says emerge -av --deep world?

 

```

Fukuoka / # emerge -av --deep world

!!! Invalid token (not "=") export

Traceback (most recent call last):

  File "/usr/bin/emerge", line 4049, in ?

    emerge_main()

  File "/usr/bin/emerge", line 3768, in emerge_main

    settings, trees, mtimedb = load_emerge_config()

  File "/usr/bin/emerge", line 3679, in load_emerge_config

    trees = portage.create_trees(trees=trees, **kwargs)

  File "/usr/lib/portage/pym/portage.py", line 6780, in create_trees

    config_incrementals=portage_const.INCREMENTALS)

  File "/usr/lib/portage/pym/portage.py", line 1045, in __init__

    env_d = getconfig(

  File "/usr/lib/portage/pym/portage_util.py", line 283, in getconfig

    raise portage_exception.ParseError(str(e)+" in "+mycfg)

portage_exception.ParseError: "ParseError: Invalid token (not '='): /etc/profile.env: line 46 in /etc/profile.env"

```

----------

## Keruskerfuerst

emerge --sync

emerge portage

----------

## charlesnadeau

 *Keruskerfuerst wrote:*   

> emerge --sync
> 
> emerge portage

 

Doesn't look good...

```

Fukuoka / # emerge --sync

!!! Invalid token (not "=") export

Traceback (most recent call last):

  File "/usr/bin/emerge", line 4049, in ?

    emerge_main()

  File "/usr/bin/emerge", line 3768, in emerge_main

    settings, trees, mtimedb = load_emerge_config()

  File "/usr/bin/emerge", line 3679, in load_emerge_config

    trees = portage.create_trees(trees=trees, **kwargs)

  File "/usr/lib/portage/pym/portage.py", line 6780, in create_trees

    config_incrementals=portage_const.INCREMENTALS)

  File "/usr/lib/portage/pym/portage.py", line 1045, in __init__

    env_d = getconfig(

  File "/usr/lib/portage/pym/portage_util.py", line 283, in getconfig

    raise portage_exception.ParseError(str(e)+" in "+mycfg)

portage_exception.ParseError: "ParseError: Invalid token (not '='): /etc/profile.env: line 46 in /etc/profile.env"

```

I have this no matter what is the argument after "emerge".

Thanks!

Charles

----------

## Keruskerfuerst

As a last chance, you can download the stage3 tarball.

Extract it and copy the emerge binary to the default directory on your harddisk.

----------

## charlesnadeau

 *Keruskerfuerst wrote:*   

> As a last chance, you can download the stage3 tarball.
> 
> Extract it and copy the emerge binary to the default directory on your harddisk.

 

By looking at the error message, it points to a problem with /etc/profile.env. Could I replace this file by the one from another machine I have running Gentoo?

Thanks!

Charles

----------

## Keruskerfuerst

Try to execute env-update.

----------

## charlesnadeau

 *Keruskerfuerst wrote:*   

> What says emerge -av --deep world?

 

I found the bugger. The error message was slightly mistaken. It said:

```
portage_exception.ParseError: "ParseError: Invalid token (not '='): /etc/profile.env: line 46 in /etc/profile.env" 
```

while the error was with the line above:

```
export ORACLE_SID=''db1''
```

So this is fixed and here is what you asked:

```

Fukuoka / # emerge --info

Portage 2.1.1-r2 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.15-gentoo-r1 i686)

=================================================================

System uname: 2.6.15-gentoo-r1 i686 AMD Athlon(tm) MP 1800+

Gentoo Base System version 1.12.6

Last Sync: Sun, 10 Dec 2006 20:00:07 +0000

distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]

ccache version 2.3 [enabled]

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.7, 2.0.30

dev-lang/python:     2.3.5-r2, 2.4.3-r4

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     2.3

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.60

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.3.14

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.17-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-march=athlon-mp -O3 -pipe -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"

CXXFLAGS="-O2 -mcpu=i686 -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig ccache distlocks metadata-transfer sandbox sfperms strict"

GENTOO_MIRRORS="ftp://cs.ubishops.ca/pub/gentoo ftp://gentoo.risq.qc.ca/ http://adelie.polymtl.ca/ http://gentoo.mirrored.ca/"

LINGUAS="fr"

MAKEOPTS="-j3"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://192.168.0.52/gentoo-portage"

USE="x86 3dnow X alsa apache2 arts bash-completion berkdb bitmap-fonts cairo cdr cgi cli cracklib crypt cups dbase dbus dlloader doc dri dv dvd dvdr eds elibc_glibc emboss encode esd examples exif fam firefox fortran gdbm gif gphoto2 gpm gstreamer gtk hal iconv ieee1394 innodb input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kdexdeltas kernel_linux ldap libg++ linguas_fr logrotate mad maildir mikmod mmx mozilla mp3 mpeg mysql ncurses nls nptl nptlonly nvidia ogg opengl oss pam pcre pda pdf perl pic png postgres ppds pppd python qt qt3 qt4 quicktime readline reflection ruby samba sdl session simplexml slp snmp soap spell spl sse ssl tcpd threads truetype truetype-fonts type1-fonts udev userland_GNU v4l vcd video_cards_nv video_cards_vga vorbis win32codecs xml xmlrpc xorg xv zip zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

Thanks!

Charles

----------

