[Wifidog] On WRT54G

Philippe April papril777 at yahoo.com
Sat Apr 17 21:10:48 EDT 2004


Sur x86, tout va bien...

Sur le WRT54G:
/tmp # ./test_thread
Select()....
Segmentation fault

execve("./test_thread", ["./test_thread"], [/* 7 vars */]) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0,
0) = 0x2aaa8000
readlink("/lib/ld-uClibc.so.0", "/rom/lib/ld-uClibc.so.0", 1024) = 23
open("/rom/lib/libc.so.0", O_RDONLY)    = 3
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0,
0) = 0x2aaa9000
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\10\0\1\0\0\0\200\265"...,
4096) = 4096
old_mmap(NULL, 692224, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x2ab06000
old_mmap(0x2ab06000, 403012, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED,
3, 0) = 0x2ab06000
old_mmap(0x2aba8000, 5948, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3,
0x62000) = 0x2aba8000
old_mmap(0x2abaa000, 16760, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2abaa000
close(3)                                = 0
munmap(0x2aaa9000, 4096)                = 0
ioctl(0, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, TIOCNXCL, {B38400 opost isig icanon echo ...}) = 0
getpid()                                = 6461
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
setrlimit(RLIMIT_STACK, {rlim_cur=2040*1024, rlim_max=1073741823}) = 0
rt_sigaction(SIGRT_0, {SIG_DFL}, NULL, 16) = 0
rt_sigaction(SIGRT_1, {SIG_DFL}, NULL, 16) = 0
rt_sigaction(SIGRT_2, {SIG_DFL}, NULL, 16) = 0
rt_sigprocmask(SIG_BLOCK, [RT_0], NULL, 16) = 0
brk(0x10007980)                         = 0x10007980
brk(0x10008000)                         = 0x10008000
brk(0x10009000)                         = 0x10009000
pipe([2147450747, 716889600])           = 3
clone(Process 6462 attached (waiting for parent)
Process 6462 resumed (parent 6461 ready)
child_stack=0x10008a40, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND)
= 6462
[pid  6462] --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid  6462] rt_sigprocmask(SIG_SETMASK, ~[TRAP RT_1],  <unfinished ...>
[pid  6461] write(4,
"@\304\0\20\5\0\0\0\210i\0\20@\304\0\20\200\223\265*4\216"..., 148
<unfinished ...>
[pid  6462] <... rt_sigprocmask resumed> NULL, 16) = 0
[pid  6462] read(3,
"@\304\0\20\5\0\0\0\210i\0\20@\304\0\20\200\223\265*4\216"..., 148) = 148
[pid  6462] poll( <unfinished ...>
[pid  6461] <... write resumed> )       = 148
[pid  6461] rt_sigprocmask(SIG_SETMASK, NULL, [RT_0], 16) = 0
[pid  6461] write(4, "
@\0\20\0\0\0\0\0\0\0\0\304\'@\0\0\0\0\0\0\0\0\200\0\0"..., 148 <unfinished
...>
[pid  6462] <... poll resumed> [{fd=3, events=POLLIN, revents=POLLIN}], 1,
2000) = 1
[pid  6461] <... write resumed> )       = 148
[pid  6462] getppid( <unfinished ...>
[pid  6461] rt_sigprocmask(SIG_SETMASK, NULL,  <unfinished ...>
[pid  6462] <... getppid resumed> )     = 6461
[pid  6461] <... rt_sigprocmask resumed> [RT_0], 16) = 0
[pid  6462] read(3, "
@\0\20\0\0\0\0\0\0\0\0\304\'@\0\0\0\0\0\0\0\0\200\0\0"..., 148) = 148
[pid  6461] rt_siguspend([] <unfinished ...>
[pid  6462] old_mmap(0x7f7fc000, 16384, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_GROWSDOWN, -1, 0) = 0x7f7fc000
[pid  6462] clone(Process 6463 attached
child_stack=0x7f7ffe00,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|SIGRT_1) = 6463
[pid  6463] --- SIGSTOP (Stopped (signal)) @ 0 (0) ---
[pid  6463] getpid()                    = 6463
[pid  6463] rt_sigprocmask(SIG_SETMASK, [RT_0], NULL, 16) = 0
[pid  6463] time( <unfinished ...>
[pid  6462] kill(6461, SIGRT_0 <unfinished ...>
[pid  6463] <... time resumed> NULL)    = 946700639
[pid  6462] <... kill resumed> )        = 0
[pid  6461] --- SIGRT_0 (Unknown signal 32) @ 0 (0) ---
[pid  6461] <... rt_siguspend resumed> ) = -1 EINTR (Interrupted system call)
[pid  6461] sigreturn( <unfinished ...>
[pid  6463] --- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 6463 detached
[pid  6462] poll( <unfinished ...>
[pid  6461] <... sigreturn resumed> )   = ? (mask now ~[HUP INT QUIT IOT
BUS SYS PIPE USR1 USR2 CHLD PWR WINCH URG IO TSTP CONT TTIN TTOU VTALRM
PROF XCPU XFSZ RT_0 RT_3 RT_5 RT_6 RT_7 RT_8 RT_9 RT_10 RT_11 RT_12 RT_13
RT_14 RT_15 RT_16 RT_17 RT_18 RT_19 RT_20 RT_21 RT_22 RT_23 RT_24 RT_25
RT_26 RT_27 RT_28 RT_29 RT_30 RT_31 RT_32 RT_33 RT_34 RT_35 RT_36 RT_37
RT_39 RT_42 RT_45 RT_46 RT_47 RT_48 RT_49 RT_51 RT_52 RT_53 RT_54 RT_55
RT_56 RT_57 RT_58 RT_59 RT_60 RT_62 RT_63 RT_64 RT_65 RT_66 RT_67 RT_68
RT_70 RT_71 RT_73 RT_74 RT_76 RT_79 RT_83 RT_84 RT_85 RT_86 RT_87 RT_88
RT_89 RT_90 RT_91 RT_92 RT_94])
[pid  6461] write(2, "Select()....\n", 13Select()....
) = 13
[pid  6462] <... poll resumed> [{fd=3, events=POLLIN}], 1, 2000) = -1
EINTR (Interrupted system call)
[pid  6461] _newselect(0, [], NULL, NULL, {10, 0} <unfinished ...>
[pid  6462] --- SIGRT_1 (Unknown signal 33) @ 0 (0) ---
[pid  6462] sigreturn()                 = ? (mask now [HUP ILL EMT BUS
RT_38 RT_40 RT_41 RT_43 RT_44 RT_50 RT_61])
[pid  6462] getppid()                   = 6461
[pid  6462] wait4(-1, [WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV],
WNOHANG|__WCLONE, NULL) = 6463
[pid  6462] munmap(0x7f600000, 2097152) = 0
[pid  6462] kill(6461, SIGSEGV)         = 0
[pid  6462] exit(0)                     = ?
Process 6462 detached
<... _newselect resumed> )              = ? ERESTARTNOHAND (To be restarted)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


> 	Essaye le boutte de code que j'ai inclus ici.
>
> Compilation (linux x86):
>
> gcc -o test_thread test_thread.c -lpthread
>
> 	Ca cree un thread qui roule pic qui fait in fprintf() apres chaque
> wake-up de pthread_cond_timedwait() (au 15s). Pis un loop qui roule
> select()
> avec un timeout de 10s dans le main()...
>
> Alex
>
> On Sat, Apr 17, 2004 at 05:58:09PM -0400, Philippe April wrote:
>> Date: Sat, 17 Apr 2004 17:58:09 -0400 (EDT)
>> Subject: Re: [Wifidog] On WRT54G
>> From: "Philippe April" <papril777 at yahoo.com>
>> To: "The WiFi Guard Dog project" <Wifidog at isf.waglo.com>
>>
>> Ya...
>>
>> it crashes when httpdGetConnection() gets called (it never returns and
>> segfaults).
>>
>> But it does not crash on my Linux box.
>>
>> See if you can find anything obvious, otherwise..... well... we'll see..
>>
>> Btw, I compile statically with libpthread.a because I can't seem to find
>> out how to include libpthread.so it in my firmware..
>>
>> Send me your phone number directly so I can call you and explain if you
>> can't see anything :)
>>
>> Philippe
>>
>> > On Sat, Apr 17, 2004 at 05:51:13PM -0400, Philippe April wrote:
>> >>
>> >> I tried WiFiDog on the WRT54G, and it segfaults right after "Waiting
>> for
>> >> connections"...
>> >>
>> >> I'll enable more debugging and see what's up and keep you posted.
>> It's
>> >> possibly because of some changes to the firewall scripts that I made,
>> >> maybe it segfaults when I call "fw.counters"..
>> >
>> > 	Was this with the current CVS version with libhttpd folded back
>> > into wifidog?
>> >
>> > Alex
>> >
>> > _______________________________________________
>> > Wifidog mailing list
>> > Wifidog at isf.waglo.com
>> > http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com
>> >
>>
>>
>> _______________________________________________
>> Wifidog mailing list
>> Wifidog at isf.waglo.com
>> http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com
>>
>
> _______________________________________________
> Wifidog mailing list
> Wifidog at isf.waglo.com
> http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com
>


_______________________________________________
Wifidog mailing list
Wifidog at isf.waglo.com
http://isf.waglo.com/mailman/listinfo/wifidog_isf.waglo.com



More information about the Wifidog mailing list