Discussion:
[bug-serveez] SEGV in guile_error
Mike Gran
2013-02-22 15:41:56 UTC
Permalink
Thien-Thi Nguyen
2013-02-24 17:10:11 UTC
Permalink
() Mike Gran <***@yahoo.com>
() Fri, 22 Feb 2013 07:41:56 -0800 (PST)

[patch]

Thanks. Do you happen to have a test case handy?
--
Thien-Thi Nguyen ..................................... GPG key: 4C807502
. NB: ttn at glug dot org is not me .
. (and has not been since 2007 or so) .
. ACCEPT NO SUBSTITUTES .
........... please send technical questions to mailing lists ...........
Thien-Thi Nguyen
2013-02-26 08:21:16 UTC
Permalink
() Thien-Thi Nguyen <***@gnuvola.org>
() Sun, 24 Feb 2013 18:10:11 +0100

[test case]

Here's something i cooked up:
Mike Gran
2013-02-26 14:47:50 UTC
Permalink
Unfortunately, under Guile 1.8.7, it doesn't segfault, but instead shows
"undefined:0:0" (w/o the change to use ‘SCM_OPINPORTP’).  Likewise, w/
the patch applied.
I get the same result as you.  Mine is a slightly different case.
In yours, the port is #<undefined> instead of #<closed: file 0>, I think.

The original error was something like the code below.
Obviously, you'd need to send a UDP packet to 1069
to make the error happen.

 -----

(define (serv1-handle-request socket binary size)
  ;; Make sure the config file is closed
  (gc)
  ;; Doubly-define a port to cause a serveez guile error
  (define-port! 'serv2-port `((proto . udp)
                  (port . 1070)
                  (ipaddr . *)))
  (define-port! 'serv2-port `((proto . udp)
                  (port . 1071)
                  (ipaddr . *)))
  0)

(define-servertype!
  '((prefix . "serv1")
    (description . "server error test")
    (handle-request . serv1-handle-request)
    (configuration . ())))

(define-port! 'serv1-port `((proto . udp)
               (port . 1069)
               (ipaddr . *)))

(define-server! 'serv1-server)

(bind-server! 'serv1-port 'serv1-server)

-----

Thanks,

Mike
Thien-Thi Nguyen
2013-03-01 11:28:54 UTC
Permalink
() Mike Gran <***@yahoo.com>
() Tue, 26 Feb 2013 06:47:50 -0800 (PST)

The original error was something like the code below.
Obviously, you'd need to send a UDP packet to 1069
to make the error happen.

I have constructed test/t007 (attached) but am unable to get it to fail
under Guile 1.8.7, possibly due to errors in the test case, but most
likely due to differences between 1.8.7 and the version you're running
(presumably 2.0.x). Could you please try it out? (Copy to test/ and do
"make check TESTS=t007 VERBOSE=1".)
Thien-Thi Nguyen
2013-03-06 08:26:46 UTC
Permalink
() Mike Gran <***@yahoo.com>
() Tue, 26 Feb 2013 06:47:50 -0800 (PST)

[segv-triggering config]

Well, i found the gumption to try t007 on Guile 2.0.7 and was able to
reproduce the segv. Probably how the assumptions behind ‘SCM_PORTP’ and
‘SCM_OPINPORT’ changed between 1.8 and 2.0 should be investigated fully,
as that might point to bigger and better bugs to fix, but for now, this
change seems harmless enough (famous last words). Please see:

http://git.savannah.gnu.org/cgit/serveez.git/log/?h=next

which has this change (immediately prior to the one adding a test).
--
Thien-Thi Nguyen
GPG key: 4C807502
Mike Gran
2013-03-06 09:00:52 UTC
Permalink
Thi-
Post by Thien-Thi Nguyen
Well, i found the gumption to try t007 on Guile 2.0.7 and was able to
reproduce the segv.  Probably how the assumptions behind ‘SCM_PORTP’ and
‘SCM_OPINPORT’ changed between 1.8 and 2.0 should be investigated fully,
as that might point to bigger and better bugs to fix, but for now, this
http://git.savannah.gnu.org/cgit/serveez.git/log/?h=next
which has this change (immediately prior to the one adding a test).
Thanks.

Congratulations on getting Guile 2.0.x to build. ;-)

Sorry I wasn't responsive in checking out your patch: I'm on travel.

Thanks,

Mike
Thien-Thi Nguyen
2013-03-06 09:30:17 UTC
Permalink
() Mike Gran <***@yahoo.com>
() Wed, 6 Mar 2013 01:00:52 -0800 (PST)

Congratulations on getting Guile 2.0.x to build. ;-)

Yeah, one day my computer will lose its magic smoke, most likely during
a Guile 2 build...

Sorry I wasn't responsive in checking out your patch: I'm on travel.

No worries.
--
Thien-Thi Nguyen
GPG key: 4C807502
Loading...