# [solved-ish] hal segfaults in libglib

## Jim6

hal segfaults every time it is started. The instruction pointer is always the same. 

```
hald[17893]: segfault at 8a38 ip b7e54e15 sp bfbb7ba8 error 4 in libglib-2.0.so.0.2000.4[b7dfa000+d0000]

hald[27080]: segfault at 8a38 ip b7e83e15 sp bfaf8288 error 4 in libglib-2.0.so.0.2000.4[b7e29000+d0000]

hald[19667]: segfault at 9c58 ip b7e58e15 sp bff27718 error 4 in libglib-2.0.so.0.2000.4[b7dfe000+d0000]

hald[19160]: segfault at 9c58 ip b7e93e15 sp bf80a868 error 4 in libglib-2.0.so.0.2000.4[b7e39000+d0000]

hald[17517]: segfault at 9c58 ip b7e3ee15 sp bf987ef8 error 4 in libglib-2.0.so.0.2000.4[b7de4000+d0000]

hald[17541]: segfault at 9c58 ip b7e80e15 sp bfcf0e98 error 4 in libglib-2.0.so.0.2000.4[b7e26000+d0000]

hald[21838]: segfault at 9c58 ip b7e2ce15 sp bfa724d8 error 4 in libglib-2.0.so.0.2000.4[b7dd2000+d0000]

hald[1314]: segfault at 9c58 ip b7ecfe15 sp bfe12078 error 4 in libglib-2.0.so.0.2000.4[b7e75000+d0000]

hald[1463]: segfault at 9c58 ip b7e09e15 sp bfaec2a8 error 4 in libglib-2.0.so.0.2000.4[b7daf000+d0000]

hald[1619]: segfault at 9c58 ip b7e70e15 sp bfe463d8 error 4 in libglib-2.0.so.0.2000.4[b7e16000+d0000]
```

I have tried the following versions of hal and glib

hal:  

0.5.9.1-r3   

0.5.11-r8    

0.5.12_rc1-r7

glib:  

2.18.4-r1 

2.20.4

I have run revdep-rebuild many many times at this point  :Smile: 

I believe that this thread may be related, but maybe not. 

make.conf

dmesg

hald --daemon=no --verbose=yes &> hald.txt

strace hald &> hald-strace.txt

hald --daemon=no --verbose=yes &> hald-strace2.txt

Does anyone have any ideas?Last edited by Jim6 on Fri Jul 24, 2009 6:01 pm; edited 1 time in total

----------

## Jim6

I discovered that I was using gcc-4.1.2, so I'm going to try to switch to 4.3.2 and emerge -e world.

I have already tried re-building hal and glib using gcc-4.3.2, so this is a long shot 

```
sofabox ~ # gcc-config -l

 [1] i686-pc-linux-gnu-4.1.2

 [2] i686-pc-linux-gnu-4.3.2 *

```

----------

## Jim6

Well, I have it working, but only with no optimisations: 

For posterity: 

```
~ # gcc-config -l

 [1] i686-pc-linux-gnu-4.1.2

 [2] i686-pc-linux-gnu-4.3.2

 [3] i686-pc-linux-gnu-4.4.1 *

```

```
CFLAGS="-O0 -march=native -pipe -fomit-frame-pointer"
```

then an emerge -av hal glib

Barely a fix, but it's working and that's good enough for the moment.

----------

## Jim6

I just ran into this problem again upgrading hal. 

You don't have to re-build glib with -O0. (only hal)

Check out the bug for details

----------

