Mailing List Archive



Back to the month index Back to the list index

Graeme Merrall (a.hacker@clear.net.nz)
Thu, 03 Apr 1997 14:59:40 +1200


Message-Id: <3.0.32.19970403145930.0068bbc0@pop.clear.net.nz>
Date: Thu, 03 Apr 1997 14:59:40 +1200
From: Graeme Merrall <a.hacker@clear.net.nz>
Subject: [mSQL] Hit by the ol' sig 11 in Beta 5

(loooong message)

Hi.
I've been throwing together a page using B5 on a linux box, here'e the guts
of it.

Linux mailhost 2.0.29 #1 Fri Mar 21 05:57:51 NZST 1997 i486

Version Details :-

        msqladmin version 2.0 Beta 5 Pre2
        mSQL server version 2.0 Beta 5 Pre2
        mSQL protocol version 22
        mSQL connection Localhost via UNIX socket
        Target platform Linux-2.0.29-i486

Configuration Details :-

        Default config file /usr/local/msql/msql.conf
        TCP socket 1114
        UNIX socket /usr/local/msql/msql2.sock
        mSQL user www
        Admin user root
        Install directory /usr/local/msql
        PID file location /usr/local/msql/msql2d.pid
   
I'm constructing a page using a query inside a query as it's the only way I
can think of doing it. The code from Lite looks like this. I hope it's
reasonably legible and doesn't make too many people wince. I'm learning as
I go :) What I tried to achieve is to create a HTML able with the result
from each query appearing once and it's sub-parts appearing more than once
without running the whole thing through one query and repeating the first
field over and over again. I haven't had a chance to see if this works cos
I can't debug it.
i.e.
size1 type price order
      type price order
      type price order

size2 type price order
      type price order
      type price order

<!

$qType = msqlEncode($parent);
if (msqlQuery($sock,"SELECT name,size,_rowid FROM bedrange WHERE name =
'$parent'") < 0)
{
     fatal("Error : $ERRMSG\n");
}

$res = msqlStoreResult();
$row = msqlFetchRow($res);
while (#$row > 0)
  {
  printf("<table width=100\\% border=1><tr><td width=50></td>\n");
  printf("<td>%s</td>", $row[1]);
  if (msqlQuery($sock,"SELECT type,price FROM bedrange WHERE _rowid =
'$row[2]'") < 0)
    {
    fatal("Error : $ERRMSG\n");
    }

  $intres = msqlStoreResult();
  $introw = msqlFetchRow($intres);
  while (#$introw > 0)
  {
    printf("<td>%s</td><td>%s</td>", $introw[0], $introw[1]);
    $introw = msqlFetchRow($intres);
    printf("<td><A href=\"/cgi-bin/w3-msql/order" +
     ".htm?parent=%s\"> Order</a></td></tr>\n", $row[2]);
                        }
    msqlFreeResult($intres);
    $row = msqlFetchRow($res);
  }
  msqlFreeResult($res);
>

Doing this resulted in a sig 11. I repeated the process and captured the
output of strace.

select(256, [5 6 7], NULL, NULL, NULL) = 1 (in [7])
time(NULL) = 860034825
read(7, "?\0\0\0", 4) = 4
read(7, "3:SELECT name,size,_rowid FROM b"..., 63) = 63
time(NULL) = 860034825
open("/usr/local/msql/msqldb/beds/bedrange.def", O_RDONLY) = 10
read(10, "bedrange\0\0\0\0\0\0\0\0\0\0\0\0"..., 11700) = 780
close(10) = 0
open("/usr/local/msql/msqldb/beds/bedrange.idx", O_RDONLY) = 10
read(10, "", 144) = 0
close(10) = 0
open("/usr/local/msql/msqldb/beds/bedrange.dat", O_RDWR) = 10
open("/usr/local/msql/msqldb/beds/bedrange.ofl", O_RDWR) = 11
fstat(10, {st_mode=S_IFREG|0600, st_size=66441, ...}) = 0
mmap(0, 66441, PROT_READ|PROT_WRITE, MAP_SHARED, 10, 0) = 0x400da000
fstat(11, {st_mode=S_IFREG|0600, st_size=4, ...}) = 0
mmap(0, 4, PROT_READ|PROT_WRITE, MAP_SHARED, 11, 0) = 0x400eb000
write(7, "\5\0\0\0001:3:\n", 9) = 9
write(7, "\26\0\0\0007:Cezanne6:Single2:30"..., 26) = 26
write(7, "\26\0\0\0007:Cezanne6:Single2:31"..., 26) = 26
write(7, "\26\0\0\0007:Cezanne6:Single2:32"..., 26) = 26
write(7, "\26\0\0\0007:Cezanne6:Double2:33"..., 26) = 26
write(7, "\26\0\0\0007:Cezanne6:Double2:34"..., 26) = 26
write(7, "\26\0\0\0007:Cezanne6:Double2:35"..., 26) = 26
write(7, "\25\0\0\0007:Cezanne5:Queen2:36\n"..., 25) = 25
write(7, "\25\0\0\0007:Cezanne5:Queen2:37\n"..., 25) = 25
write(7, "\25\0\0\0007:Cezanne5:Queen2:38\n"..., 25) = 25
write(7, "\24\0\0\0007:Cezanne4:King2:39\n"..., 24) = 24
write(7, "\24\0\0\0007:Cezanne4:King2:40\n"..., 24) = 24
write(7, "\24\0\0\0007:Cezanne4:King2:41\n"..., 24) = 24
write(7, "\31\0\0\0007:Cezanne9:SuperKing2"..., 29) = 29
write(7, "\31\0\0\0007:Cezanne9:SuperKing2"..., 29) = 29
write(7, "\31\0\0\0007:Cezanne9:SuperKing2"..., 29) = 29
write(7, "\6\0\0\0-100:\n", 10) = 10
write(7, "\35\0\0\0008:bedrange4:name1:22:"..., 33) = 33
write(7, "\35\0\0\0008:bedrange4:size1:22:"..., 33) = 33
write(7, "\36\0\0\0008:bedrange6:_rowid1:1"..., 34) = 34
write(7, "\6\0\0\0-100:\n", 10) = 10
select(256, [5 6 7], NULL, NULL, NULL) = 1 (in [7])
time(NULL) = 860034825
read(7, "=\0\0\0", 4) = 4
read(7, "3:SELECT type,price,_rowid FROM "..., 61) = 61
time(NULL) = 860034825
write(7, "\5\0\0\0001:3:\n", 9) = 9
--- SIGSEGV (Segmentation fault) ---
sigaction(SIGSEGV, {SIG_IGN}, {SIG_DFL}) = 0
write(2, "\nHit by a sig 11\n\n", 18) = 18
write(1, "\n\nForced server shutdown due t"..., 45) = 45
write(1, "Forcing close on Socket 7\n", 26) = 26
shutdown(7, 2 /* send and receive */) = 0
close(7) = 0
shutdown(5, 2 /* send and receive */) = -1 ENOTCONN (Transport endpoint
is not connected)
close(5) = 0
shutdown(6, 2 /* send and receive */) = 0
close(6) = 0
unlink("/usr/local/msql/msql2.sock") = 0
write(1, "\n", 1) = 1
sigprocmask(SIG_UNBLOCK, [ABRT], NULL) = 0
getpid() = 10568
kill(10568, SIGABRT) = 0
--- SIGABRT (IOT trap/Abort) ---
+++ killed by SIGABRT +++
--------------------------------------------------------------------------
To remove yourself from the Mini SQL mailing list send a message containing
"unsubscribe" to "unsubscribe" to msql-list-request@bunyip.com. Send a message containing
"info msql-list" to majordomo@bunyip.com for info on monthly archives of
the list. For more help, mail owner-msql-list@bunyip.com NOT the msql-list!