[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with scheduler on Solaris
I tried replacing the call to Solaris qsort to gnu qsort, and it didn't
solve the scheduler core dump problem for me.
--Eric Riehl
On Thu, 5 Dec 1996, Swen Thuemmler wrote:
> Hi,
>
> I'm having problems with scheduler. It dumps core, but I don't know why.
> It seems to be a bug in qsort(). I think this is rather unlikely, but who
> knows...
>
> #0 0x1eb00 in vtx_ctime_cmp (ap=0x5b8f4, bp=0x5b8fc) at threads.c:594
> 594 if ((*a)->cfp->ctime < (*b)->cfp->ctime)
> (gdb) where
> #0 0x1eb00 in vtx_ctime_cmp (ap=0x5b8f4, bp=0x5b8fc) at threads.c:594
> #1 0xef650304 in qsort ()
> #2 0x1ec44 in thread_vertex_shuffle (thr=0x67848) at threads.c:641
> #3 0x1f43c in pick_next_vertex (proc=0x812f8, ok=1, justfree=0)
> at threads.c:970
> #4 0x1ae44 in unvertex (vp=0x789e8, justfree=0, ok=1) at update.c:303
> #5 0x1b770 in vtxupdate (vp=0x789e8, index=6, ok=1) at update.c:579
> #6 0x1bb50 in u_ok (vp=0x789e8, index=6, inum=52484, offset=159,
> notary=0x1b196a "", message=0x0) at update.c:694
> #7 0x1aa78 in update (fd=494056, diagnostic=0x1b196b "ok") at update.c:210
> #8 0x1a344 in readfrom (fd=30) at transport.c:882
> #9 0x19e90 in mux (timeout=245760) at transport.c:708
> #10 0x14aa0 in main (argc=6, argv=0x3c000) at scheduler.c:586
> (gdb) print a
> $1 = (struct vertex **) 0x5b8f4
> ======> Note the address of a!
> (gdb) up
> #1 0xef650304 in qsort ()
> (gdb) up
> #2 0x1ec44 in thread_vertex_shuffle (thr=0x67848) at threads.c:641
> 641 qsort((void*)ur_arr, n, sizeof(struct vertex *), vtx_ctime_cmp);
> (gdb) print &ur_arr[0]
> $2 = (struct vertex **) 0x5b8f8
> ======> This should be expected
> (gdb) print &ur_arr[-1]
> $3 = (struct vertex **) 0x5b8f4
> ======> Somehow qsort calls the compare function with a negative index.
> ======> This should not happen
>
> I solved this by using the qsort from glibc. The cores vanished...
>
> Perhaps someone knows an answer to this puzzle....
>
> Greetings, Swen
>
>
>
>