Discussion:
https related crash
Johannes Hofmann
2013-02-28 21:44:15 UTC
Permalink
Hi,

from time to time I get the crash below.
Would a simple NULL check in a_Chain_check() be the correct fix?

Cheers,
Johannes

nated with signal 11, Segmentation fault.
#0 0x0805d359 in a_Chain_check (FuncStr=0x81135b3 "a_Capi_ccc", Op=2, Branch=1, Dir=2,
Info=0x0) at chain.c:192
192 if (Info->Flags & (CCC_Ended + CCC_Aborted)) {
(gdb) p Info
$1 = (ChainLink *) 0x0
(gdb) bt
#0 0x0805d359 in a_Chain_check (FuncStr=0x81135b3 "a_Capi_ccc", Op=2, Branch=1, Dir=2,
Info=0x0) at chain.c:192
#1 0x08062f03 in a_Capi_ccc (Op=2, Branch=1, Dir=2, Info=0x0, Data1=0x28c83670, Data2=0x0)
at capi.c:622
#2 0x0806372f in a_Capi_dpi_send_data (url=0x0, bw=0x2871da20,
data=0x29563748 "<cmd='answer' to_cmd='dialog' msg='1' '>", data_sz=40,
server=0x2940ee70 "proto.https", flags=<optimized out>) at capi.c:576
#3 0x0806381a in a_Capi_dpi_send_cmd (url=0x0, bw=0x2871da20,
cmd=0x29563748 "<cmd='answer' to_cmd='dialog' msg='1' '>",
server=0x2940ee70 "proto.https", flags=0) at capi.c:593
#4 0x08085bed in Dpiapi_dialog_answer_cb (answer=<optimized out>, bw=<optimized out>)
at dpiapi.c:43
#5 a_Dpiapi_dialog (bw=0x2871da20, server=0x2940ee70 "proto.https",
dpip_tag=0x286612d0 "<cmd='dialog' title='Dillo HTTPS: Missing issuer certificate!' msg='Unable to get local issuer certificate. The issuer certificate of an untrusted certificate cannot be found.' alt1='Continue' alt2='C"...) at dpiapi.c:74
#6 0x0805d21f in a_Chain_fcb (Op=684209776, Info=0x2878cec0, Data1=0x286612d0,
Data2=0x29ecb9d0) at chain.c:114
#7 0x0808b533 in Dpi_parse_token (conn=<optimized out>) at dpi.c:228
#8 Dpi_process_dbuf (conn=<optimized out>, Data1=<optimized out>, Op=<optimized out>)
at dpi.c:326
#9 a_Dpi_ccc (Op=2, Branch=2, Dir=1, Info=0x2878cec0, Data1=0x29e55470, Data2=0x0)
at dpi.c:713
#10 0x0805d21f in a_Chain_fcb (Op=684209776, Info=0x28788fc0, Data1=0x29e55470, Data2=0x0)
at chain.c:114
#11 0x0808ba6e in a_IO_ccc (Op=2, Branch=2, Dir=1, Info=0x28788fc0, Data1=0x292f6d40,
Data2=0x0) at IO.c:425
#12 0x0808bc80 in IO_read (io=0x292f6d40) at IO.c:194
#13 0x0808bd88 in IO_callback (io=0x0) at IO.c:259
#14 0x0808be47 in IO_fd_read_cb (fd=6, data=0x6d7) at IO.c:280
#15 0x080e7d15 in fl_wait(double) ()
#16 0x080c36fc in Fl::wait(double) ()
#17 0x080c377b in Fl::run() ()
#18 0x0804e1f1 in main (argc=1, argv=0xbfbff8c4) at dillo.cc:502
(gdb)
Jorge Arellano Cid
2013-03-01 16:37:13 UTC
Permalink
Hi Johannes,
Post by Johannes Hofmann
Hi,
from time to time I get the crash below.
Would a simple NULL check in a_Chain_check() be the correct fix?
I gave it a first review, and it looks like the connection gets closed
before the dialog sends an answer. So, at resume time, the sending branch
is gone. It'd be great to have a test case.

Anyway, in the interim, please try the following patch:

diff -r 8c8975054b06 src/capi.c
--- a/src/capi.c Wed Jan 30 10:04:00 2013 +0100
+++ b/src/capi.c Fri Mar 01 13:32:38 2013 -0300
@@ -571,10 +571,13 @@ int a_Capi_dpi_send_data(const DilloUrl
/* Re-use an open connection */
conn = Capi_conn_find(server);
if (conn) {
- /* found */
- dbuf = a_Chain_dbuf_new(data, data_sz, 0);
- a_Capi_ccc(OpSend, 1, BCK, conn->InfoSend, dbuf, NULL);
- dFree(dbuf);
+ if (conn->InfoSend) {
+ /* found & operative*/
+ dbuf = a_Chain_dbuf_new(data, data_sz, 0);
+ a_Capi_ccc(OpSend, 1, BCK, conn->InfoSend, dbuf, NULL);
+ dFree(dbuf);
+ } else
+ MSG(" ERROR: [a_Capi_dpi_send_data] Connection not operative\n");
} else {
MSG(" ERROR: [a_Capi_dpi_send_data] No open connection found\n");
}

diff -r 8c8975054b06 src/chain.c
--- a/src/chain.c Wed Jan 30 10:04:00 2013 +0100
+++ b/src/chain.c Fri Mar 01 13:32:38 2013 -0300
@@ -189,7 +189,10 @@ int a_Chain_check(char *FuncStr, int Op,
/* Show status information */
Chain_debug_msg(FuncStr, Op, Branch, Dir, Info);

- if (Info->Flags & (CCC_Ended + CCC_Aborted)) {
+ if (!Info) {
+ MSG_WARN("CCC: call on a NULL node.\n"
+ "Caught as last resort; Most probably a BUG.\n");
+ } else if (Info->Flags & (CCC_Ended + CCC_Aborted)) {
/* CCC is not operative */
MSG_WARN("CCC: call on already finished chain. Flags=%s%s\n",
Info->Flags & CCC_Ended ? "CCC_Ended " : "",
--
Cheers
Jorge.-
Johannes Hofmann
2013-03-04 21:07:21 UTC
Permalink
Post by Jorge Arellano Cid
Hi Johannes,
Post by Johannes Hofmann
Hi,
from time to time I get the crash below.
Would a simple NULL check in a_Chain_check() be the correct fix?
I gave it a first review, and it looks like the connection gets closed
before the dialog sends an answer. So, at resume time, the sending branch
is gone. It'd be great to have a test case.
Sorry, I can't reproduce it atm. I keep trying.
Will do, once I can reproduce the crash.

Thanks,
Johannes
Jorge Arellano Cid
2013-03-05 16:40:08 UTC
Permalink
Post by Johannes Hofmann
Post by Jorge Arellano Cid
Hi Johannes,
Post by Johannes Hofmann
Hi,
from time to time I get the crash below.
Would a simple NULL check in a_Chain_check() be the correct fix?
I gave it a first review, and it looks like the connection gets closed
before the dialog sends an answer. So, at resume time, the sending branch
is gone. It'd be great to have a test case.
Sorry, I can't reproduce it atm. I keep trying.
Will do, once I can reproduce the crash.
AFAIR there're a few obscure corner cases not explicitly handled
by the CCC (ATM not worth the coding effort), and those are silently
caught by the CCC's check code.

From a distance, and with the proposed patch, it doesn't look
like a show stopper at all.
--
Cheers
Jorge.-
Continue reading on narkive:
Loading...