[racket-users] hot reloading code and html templates for web app development

2016-01-06 Thread Matthew Eric Bassett
Hi all,

I often use serve/servlet to launch my webapp.  Often from the repl
while I'm developing.

One major annoyance I have, however, is that I cannot easily hot-swap
code.  If I change a required dependency I then need to kill the process
(usually re-enter! from the repl to update the changed dependency) and
serve/servlet again.  It's an annoying process, but as enter! only
updates changed files it only takes a few seconds.

Things get worse when I change templates.  These don't reload until I've
exited out of the repl and come in again - enter! doesn't seem to notice
that templates have changed.   This is an intolerable annoyance!

I must be doing something silly, as this is a very inefficient process.
 Is there a way to get racket to hotswap templates and updated
dependencies without having to explicitly restart the serve/servlet
thread, or worse the entire racket machine ?

Thanks,

-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] Re: new #lang sicp

2016-03-21 Thread Matthew Eric Bassett
This is great Neil. I am running a London study group on SICP and we can help 
test this after the easter holiday.

Many thanks to everyone who has worked on this.

Matthew Eric Bassett | https://mebassett.info

> On Mar 21, 2016, at 14:55, Brian Adkins  wrote:
> 
>> On Friday, March 18, 2016 at 8:03:29 AM UTC-4, Neil Van Dyke wrote:
>> Could anyone currently working through or teaching SICP please try out 
>> the new `#lang sicp` support, in Jens Axel Sogaard's `sicp` package in 
>> the new package system?
>> 
>> http://docs.racket-lang.org/sicp-manual/
>> 
>> If you find any problems with this, please let me and Jens Axel know.
>> 
>> I'd prefer to shake out any glaring problems now, before people start 
>> working through SICP in the summer or September.  (I expect a few 
>> problems, and I don't want them to be first encountered by new students 
>> trying to do their homework, so am "crowdsourcing QA" in advance.)
>> 
>> I've updated my old PLaneT package 
>> ("http://www.neilvandyke.org/racket/sicp/";) to point people to Jens 
>> Axel's new one.
>> 
>> Neil V.
> 
> This is great - thanks to all who had a part in updating the package. I've 
> had "work through SICP" on my list for a while, so I'll use the package when 
> I start that in a couple months or so, and post any issues.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


smime.p7s
Description: S/MIME cryptographic signature


[racket-users] Weirdness with typed racket and hashes

2016-05-23 Thread Matthew Eric Bassett
Hi all,

I noticed something weird today when playing around with typed racket (and
flirting with the idea of using it in production).

If I do something like:

-> (ann (cons 'a 1) (Pairof Any Any))
- : (Pairof Any Any)
'(a . 1)

That works as expected.  As does:

-> (define t (cons 'a 1))
-> (ann t (Pairof Any Any))
- : (Pairof Any Any)
'(a . 1)

Now, if I do

-> (ann (hash 'a 1 'b "cat") (HashTable Any Any))
- : (HashTable Any Any)
'#hash((a . 1) (b . "cat"))

That also works as expected.  Things get weird if I do:

-> (define t* (hash 'a 1 'b "cat"))
-> (ann t* (HashTable Any Any))

This gives a type mismatch error:

; readline-input:30:5: Type Checker: type mismatch
;   expected: (HashTable Any Any)
;   given: (HashTable Symbol (U String One))
;   in: t*


Am I being completely daft here?  Is there some hidden knowledge
required to use
hash tables here?

Note that the following also does not work:

-> (ann t* (HashTable Symbol (U String Integer)))
; readline-input:31:5: Type Checker: type mismatch
;   expected: (HashTable Symbol (U Integer String))
;   given: (HashTable Symbol (U String One))
;   in: t*

Regards,

Matthew Eric

-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] Weirdness with typed racket and hashes

2016-05-23 Thread Matthew Eric Bassett
Thank you, Brian, that was very helpful.

On 05/23/2016 03:46 PM, Brian LaChance wrote:
> Hi, Matthew
> 
> I'm pretty sure the problem you're having is that, even when you make
> a hash table using hash, TR can't tell that it's immutable. It only
> has one hash table type, HashTable, which is used for both mutable and
> immutable variants. You'll see a similar problem with your cons
> examples if you switch those to mutable pairs using mcons/MPairof.
> 
> As for why you can annotate the first hash expression, the one that
> works as expected, it's the same reason you can define t* with an
> annotation like
> 
> (: t* (HashTable Any Any))
> (define t* (hash 'a 1 'b "cat"))
> 
> The other examples don't work because when you define t* without the
> explicit annotation, it's as if you had annotated it with the "given"
> type that you see in the error messages. If you were able to then
> later annotate it with the rejected types, you could put arbitrary
> values into the hash table. A consumer who thought they were getting
> (U String One) values out (after all, that's t*'s type) could be
> surprised with a non-One Integer.
> 
> Commingling mutable and immutable hash tables into the same type is
> definitely confusing in TR. Hopefully we can tease them apart in the
> future to remove at least some of the confusion. Let me know if this
> didn't help clear things up.
> 
> -Brian
> 
> On Mon, May 23, 2016 at 6:54 AM, Matthew Eric Bassett
>  wrote:
>> Hi all,
>>
>> I noticed something weird today when playing around with typed racket (and
>> flirting with the idea of using it in production).
>>
>> If I do something like:
>>
>> -> (ann (cons 'a 1) (Pairof Any Any))
>> - : (Pairof Any Any)
>> '(a . 1)
>>
>> That works as expected.  As does:
>>
>> -> (define t (cons 'a 1))
>> -> (ann t (Pairof Any Any))
>> - : (Pairof Any Any)
>> '(a . 1)
>>
>> Now, if I do
>>
>> -> (ann (hash 'a 1 'b "cat") (HashTable Any Any))
>> - : (HashTable Any Any)
>> '#hash((a . 1) (b . "cat"))
>>
>> That also works as expected.  Things get weird if I do:
>>
>> -> (define t* (hash 'a 1 'b "cat"))
>> -> (ann t* (HashTable Any Any))
>>
>> This gives a type mismatch error:
>>
>> ; readline-input:30:5: Type Checker: type mismatch
>> ;   expected: (HashTable Any Any)
>> ;   given: (HashTable Symbol (U String One))
>> ;   in: t*
>>
>>
>> Am I being completely daft here?  Is there some hidden knowledge
>> required to use
>> hash tables here?
>>
>> Note that the following also does not work:
>>
>> -> (ann t* (HashTable Symbol (U String Integer)))
>> ; readline-input:31:5: Type Checker: type mismatch
>> ;   expected: (HashTable Symbol (U Integer String))
>> ;   given: (HashTable Symbol (U String One))
>> ;   in: t*
>>
>> Regards,
>>
>> Matthew Eric
>>
>> --
>> Matthew Eric Bassett | http://mebassett.info
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 

-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


[racket-users] typed racket, pattern matching, and hash tables

2016-06-13 Thread Matthew Eric Bassett
Hi all,

I'm really having a lot of fun playing with typed racket these days.

But I keep hitting some confusing issues with hash tables.

The following bit of code works fine in #lang racket but chokes on #lang
typed/racket:

(match (hash 'low 5 'high 5)
  [(hash-table ('low (? integer? low))
   ('high (? integer? high)))
   (list low high)])

racket responds with:

Type Checker: Polymorphic function `hash-map' could not be applied to
arguments:
Domains: HashTableTop (-> Any Any c)
 (HashTable a b) (-> a b c)
Arguments: (HashTable Symbol Integer) (All (a) (-> a * (Listof a)))
 in: (match (hash (quote low) 5 (quote high) 5) ((hash-table ((quote
low) (? integer? low)) ((quote high) (? integer? high))) (list low high)))

In an ideal world, I would use (match (bytes->jsexpr
hopefuly-valid-json-bytes) [(hash-table ...)]) to extract typed
parameters from some json input in a reasonable way.  But perhaps I'm
abusing match.

For the moment set that problem aside - why doesn't my match work in
typed racket?  What am I not understanding?

Thanks,

M.e.


-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] warnings for requiring opaque types in typed racket 6.6

2016-08-19 Thread Matthew Eric Bassett
Hi all,

I note that Racket 6.6 now issues warnings for certain generated
contracts in typed/untyped interactions.  In particular, these warnings
come up when requiring an untyped file from a typed file.  For example,
say I have

test.rkt:
-
#lang racket


(define my-type
 (let ()
  (struct my-type () )
  (my-type)))
(define (my-type? x)
 (eq? x my-type))


(provide my-type? my-type)

And follow that with type interactions:

$ racket -I typed/racket
Welcome to Racket v6.6.
-> (require/typed "test.rkt" [#:opaque My-Type my-type?] [my-type My-Type])
my-type?: contract violation
  any-wrap/c: Unable to protect opaque value passed as `Any`
  value: #
  This warning will become an error in a future release.
  in: the 1st argument of
  a part of the or/c of
  (or/c
   struct-predicate-procedure?/c
   (-> Any boolean?))
  contract from: (interface for my-type?)
  blaming: top-level
   (assuming the contract is correct)
  at: readline-input:1.44

I use a similar pattern to call the untyped db library from typed code,
say with
(require/typed db [#:opaque Sql-Null] [sql-null Sql-Null]), which would
bring up a similar warning.

Is there a "correct" way to handle these sorts of cases?

Thanks!

Matthew Eric


-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] warnings for requiring opaque types in typed racket 6.6

2016-08-24 Thread Matthew Eric Bassett
thank you for your reply, Alex.  That was informative and helpful.

On 08/19/2016 02:56 PM, Alex Knauth wrote:
> So to work around that, you can use `define-new-subtype` along with 
> `unsafe-require/typed`.
> 
> #lang typed/racket
> (require typed/racket/unsafe)
> (define-new-subtype My-Type (make-my-type My-Type))
> (unsafe-require/typed "untyped.rkt" [my-type? (-> Any Boolean : My-Type)] 
> [my-type My-Type])
> 

This is quite wonky and the warnings in the Typed Racket docs about
unsafe make me very wary about using such stuff in production.  Can the
others confirm if this is indeed the desired behavior or something that
might be fixed in a later version?

Regards,

M.e.




> 
> Alex Knauth
> 
>> Hi all,
>>
>> I note that Racket 6.6 now issues warnings for certain generated
>> contracts in typed/untyped interactions.  In particular, these warnings
>> come up when requiring an untyped file from a typed file.  For example,
>> say I have
>>
>> test.rkt:
>> -
>> #lang racket
>>
>>
>> (define my-type
>> (let ()
>>  (struct my-type () )
>>  (my-type)))
>> (define (my-type? x)
>> (eq? x my-type))
>>
>>
>> (provide my-type? my-type)
>>
>> And follow that with type interactions:
>>
>> $ racket -I typed/racket
>> Welcome to Racket v6.6.
>> -> (require/typed "test.rkt" [#:opaque My-Type my-type?] [my-type My-Type])
>> my-type?: contract violation
>>  any-wrap/c: Unable to protect opaque value passed as `Any`
>>  value: #
>>  This warning will become an error in a future release.
>>  in: the 1st argument of
>>  a part of the or/c of
>>  (or/c
>>   struct-predicate-procedure?/c
>>   (-> Any boolean?))
>>  contract from: (interface for my-type?)
>>  blaming: top-level
>>   (assuming the contract is correct)
>>  at: readline-input:1.44
>>
>> I use a similar pattern to call the untyped db library from typed code,
>> say with
>> (require/typed db [#:opaque Sql-Null] [sql-null Sql-Null]), which would
>> bring up a similar warning.
>>
>> Is there a "correct" way to handle these sorts of cases?
>>
>> Thanks!
>>
>> Matthew Eric
>>
>> -- 
>> Matthew Eric Bassett | http://mebassett.info
> 
> 

-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] warnings for requiring opaque types in typed racket 6.6

2016-08-24 Thread Matthew Eric Bassett
On 08/24/2016 02:28 PM, Alex Knauth wrote:
> That's the short-term solution. A better solution would be for typed racket 
> to implement a different version of #:opaque that would actually wrap the 
> values in opaque structs when they flow from untyped-to-typed and unwrap them 
> when they flow from typed-to-untyped. That way typed racket would know how to 
> protect the values.

we will be eagerly awaiting such a change to typed racket, as unsafe
requires are worrisome.   If a lay-programmer could contribute do let me
know, though I am not sure I know where to start.

-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] TR issue with the type of expt

2016-09-27 Thread Matthew Eric Bassett
I do not believe this is an oversight.  The function expt has type
signature (-> Number Number Number).  Mathematically, yes, a^b is a real
when a and b are reals.  But the implementation of expt is not aware of
it (it is, in principle, possible to do case-by-case types for a
function, but expt does not appear to take advantage of this).

Because of this, (expt a b) is a Number, but your function definition
requires it to be the more restrictive Real.  Since you know that a and
b are reals, you could probably get away with a cast to Real.

On 09/27/2016 02:23 PM, Tim Brown wrote:
> The following snippet:
> 
> --
> #lang typed/racket
> (: ** [Real Real -> Real])
> (define (** a b)
>   (expt a b))
> --
> 
> Throws:
> unsaved editor:5:2: Type Checker: type mismatch expected: Real given: Number 
> in: (expt a b)
>   #(67 10)
> 
> 
> I believe (because I can’t think of a counterexample) that
> (expt Real Real) is never Complex; and therefore expt can be of type
> (Real Real -> Real).
> 
> First off, is the statement above true?
> 
> Is there a technical reason why my example HAS TO fall back to
> (Number Number -> Number)? Or is this simply an oversight?
> 
> Regards,
> 
> Tim
> 
> Version: 6.6.0.4--2016-09-08(-/f) [3m].
> 

-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


[racket-users] `apply`ing polymorphic functions in typed/racket

2017-01-04 Thread Matthew Eric Bassett
Hi everyone,

I have a strange example for you.  The following code throws an error in
typed/racket 6.7:

> (define (list1) : (Listof (Setof  Positive-Byte))
(list (set 2) (set 3 2)))
  (apply set-union (list1))
Type Checker: Bad arguments to function in `apply':
Domain: (Setof e) (Setof e) *
Arguments: (Listof (Setof Positive-Byte)) *
in: (apply set-union (list1))

At first I thought "doh! There's a note in the docs about polymorphic
function, just use inst".  But on the other hand,

> (define list0 
(list (set 2) (set 3 2)))
  (apply set-union list0)

Happily compiles and evaluates to the expected result.  For the record,
(inst set-union Positive-Byte) does not help.

What is weirder is that if I open a fresh repl and try:

> (define list0 : (Listof (Setof Positive-Byte)) 
(list (set 2) (set 3 2)))
  (apply set-union list0)

It then throws the same error.

I wasn't able to get the same error with other polymorphic functions as
much as I tried. It turns out this is limited to set-union and
set-subtract.  the type signatures of this functions are:
(-> (Setof e) (Setof e) * (Setof e))

Therein lies our problem.  we need to curry set-union, et al, to get rid
of that leading argument!  But to curry we run into polymorphic type
problems.  so we do:

> (apply (curry (inst set-union Positive-Byte) (ann (set) (Setof 
> Positive-Byte))) (list1))

That's a bit of a mouthful, but racket is as happy as a clam.  Might I
hope for a cleaner way to write this in a later version?
Somewhat related, I have one parting question: Out of the two:

> (define list0 
(list (set 2) (set 3 2)))
  (apply set-union list0)

> (define list2 : (Listof (Setof Positive-Byte)) 
(list (set 2) (set 3 2)))
  (apply set-union list2)

Why does the former work and the latter fail ?

Thanks,

Matthew Eric

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


[racket-users] European Racketeers and conferences

2017-08-22 Thread Matthew Eric Bassett
Hi all,

Gutted I can't make it to RacketCon this year.  Really glad to see it
growing.

Question for y'all - how many Racketeers are active on this side of the
Atlantic?  Enough for a specific get-together over here?  Or are there
already appropriate venues for that that I'm unaware of (I am already
familiar with the European lisp symposium)

Best,


-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] European Racketeers and conferences

2017-08-23 Thread Matthew Eric Bassett
So there's at least 7 of us around UK/Germany/France/Netherlands that
are active on the mailing list.  What would we need at a European
Rackeeteers Meeting to ensure that *at least* all 7 of us would travel
to it ?

@Matthias - it'd be fantastic if we could arrange something in London or
Oxford.  I'm just getting back from Salone this week and wasn't planning
on making to ICFP, but I'll see if I can help organize something.  Can
you sure your itinerary ?


On 08/23/2017 11:13 AM, 'Paulo Matos' via Racket Users wrote:
> 
> 
> On 22/08/17 16:20, Daniel Brunner wrote:
>> Hey Matthew,
>>
>> I live in Germany and use Racket for teaching students, teaching our
>> apprentices (dual education system in Germany) and use it "in
>> production" for some tasks.
>>
> 
> In Germany as well - Nuernberg to be precise. I learned Racket back in
> version 53 - that was something around 1999. On and off for a few years
> and now I am using in commercially in my own company.
> 
> Happy to join a European Racket gathering.
> 
> Paulo Matos
> 
>> Best wishes,
>> Daniel
>>
>> Am 22.08.2017 um 15:15 schrieb Matthew Eric Bassett:
>>> Hi all,
>>>
>>> Gutted I can't make it to RacketCon this year.  Really glad to see it
>>> growing.
>>>
>>> Question for y'all - how many Racketeers are active on this side of the
>>> Atlantic?  Enough for a specific get-together over here?  Or are there
>>> already appropriate venues for that that I'm unaware of (I am already
>>> familiar with the European lisp symposium)
>>>
>>> Best,
>>>
>>>
>>
> 


-- 
Matthew Eric Bassett | http://mebassett.info

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] European Racketeers and conferences

2017-09-04 Thread Matthew Eric Bassett
I regret that I am not able to make it and that I didn't organise anything. 
Best wishes to everyone!

Sent from my iPad

> On 4 Sep 2017, at 10:07, Tim Jervis  wrote:
> 
> Looking forward to meeting you.
> 
> Tim
> 
>> On 3 Sep 2017, at 11:04, Matthew Flatt  wrote:
>> 
>> For anyone who can make the trip to Oxford, we'll be at the Swan & Castle at 
>> 6:30pm on Monday. We hope to see you there!
>> 
>> Matthew
>> 
>>> On Aug 27, 2017, at 8:12 PM, Matthias Felleisen  
>>> wrote:
>>> 
>>> 
>>> HI — we compared constraints with Matthew B. (London) to coordinate but we 
>>> haven’t heard back from him whether we’ll meet in Oxford or London. Sadly 
>>> the other 3 (Sam of Typed Racket fame is attending too) are now at a 
>>> secret-cabal-ifip meeting seem to be off-line too. If anything gets 
>>> organized still, we’ll get i touch with the Oxford/London people. — Matthias
>>> 
>>> 
>>> 
>>> 
>>>> On Aug 27, 2017, at 7:16 AM, Chris Gallagher  wrote:
>>>> 
>>>> Hi Matthias.  I am based near Oxford and would be interested in joining an 
>>>> informal get together while people are at ICFP. 
>>>> 
>>>> Kind Regards
>>>> Chris
>>>> 
>>>>> On Tuesday, 22 August 2017 15:51:03 UTC+1, Matthias Felleisen  wrote:
>>>>> Matthew F, Robby, and I will be in Oxford for ICFP starting late next 
>>>>> week. None of us thought of this before but I am sure we could at least 
>>>>> arrange for some dinner or afternoon get-together. — Matthias
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Aug 22, 2017, at 10:44 AM, Tim Jervis  wrote:
>>>>>> 
>>>>>> Hi Matthew,
>>>>>> 
>>>>>> I’m based in London and would be interested in a get-together.
>>>>>> 
>>>>>> Kind regards,
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Tim
>>>>>> 
>>>>>>> On 22 Aug 2017, at 15:20, Daniel Brunner  wrote:
>>>>>>> 
>>>>>>> Hey Matthew,
>>>>>>> 
>>>>>>> I live in Germany and use Racket for teaching students, teaching our
>>>>>>> apprentices (dual education system in Germany) and use it "in
>>>>>>> production" for some tasks.
>>>>>>> 
>>>>>>> Best wishes,
>>>>>>> Daniel
>>>>>>> 
>>>>>>>> Am 22.08.2017 um 15:15 schrieb Matthew Eric Bassett:
>>>>>>>> Hi all,
>>>>>>>> 
>>>>>>>> Gutted I can't make it to RacketCon this year.  Really glad to see it
>>>>>>>> growing.
>>>>>>>> 
>>>>>>>> Question for y'all - how many Racketeers are active on this side of the
>>>>>>>> Atlantic?  Enough for a specific get-together over here?  Or are there
>>>>>>>> already appropriate venues for that that I'm unaware of (I am already
>>>>>>>> familiar with the European lisp symposium)
>>>>>>>> 
>>>>>>>> Best,
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> -- 
>>>>>>> You received this message because you are subscribed to the Google 
>>>>>>> Groups "Racket Users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>>>> an email to racket-users+unsubscr...@googlegroups.com.
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>> 
>>>>>> 
>>>>>> Tim Jervis
>>>>>> 
>>>>>> http://timjervis.com/
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Racket Users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>>> an email to racket-users+unsubscr...@googlegroups.com.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to racket-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>> 
>> 
> 
> 
> Tim Jervis
> 
> http://timjervis.com/
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket] net/url current-proxy-servers implementation for ssl?

2014-02-19 Thread Matthew Eric Bassett

Hello fellow racketeers,

So we have a few web crawlers written in Racket that for the most part 
work quite well - however, we often have them running behind our 
corporate proxy.  We were quite bemused today when one stopped working 
when it found an https link.


A quick check of the docs revealed:


(current-proxy-servers)
 → (listof (list/c string? string? (integer-in 0 65535)))
(current-proxy-servers mapping) → void?
  mapping : (listof (list/c string? string? (integer-in 0 65535)))

A parameter that determines a mapping of proxy servers used for 
connections. Each mapping is a list of three elements:

* the URL scheme, such as "http";
* the proxy server address; and
* the proxy server port number.

Currently, **the only proxiable scheme is "http"**. The default 
mapping is the empty list (i.e., no proxies).


Are there any plans for a proxy implementation for https?  Or any major 
obstacles preventing such?  I know very little about the dark 
innerworkings of ssl.


Thanks,

Matthew Eric



--
Matthew Eric Bassett | http://mebassett.info


 Racket Users list:
 http://lists.racket-lang.org/users


Re: [racket] Racket 6.0 does not work

2014-03-09 Thread Matthew Eric Bassett

On 03/05/2014 09:03 PM, Junia Magellan wrote:

I would like you to understand that most people are not PhD in
Computer Science. 90% of people want to run out of the box
applications. Even programmers don't have in depth knowledge about the
workings of computers and operating systems. I don't know why Racket
6.0 needs libc.so.6, or GLIBC_2.14. I just want to run statistics
programs written in Racket from an Internet page.

Hi Junia,

I'm not a racket dev, indeed, I've not even downloaded Racket 6.0.  I am 
a heavy user of racket.  In fact, I several people in my company 
(NBCUniversal) use racket nearly every day.  These aren't PhD's in 
computer science - these are finance managers, marketers, and sales 
people who never use anything other than excel, outlook, and ie...and 
well, now, racket.  Albeit version 5.3.6.


The racket devs work very hard (for free, too), and they put out an 
excellent product.  DrRacket is a superb ide, and the racket language 
(and its language-building libraries) are superb tools for multiple 
environments.  They, in fact, do work out of the box for those who 
aren't expecting to be able to compile from source.


Racket 6.0 has some pretty big changes, and the errors you're reporting 
are a bit a fluke.  To be fair, I don't know anyone who has had a 
pain-free conversion from python 2 to python 3, either.


It's great of you to report the errors and your build environment, and 
to help the community iron out the issues with the 6.0 branch.  But the 
condescending lecture doesn't help.  The Racket devs "get it".


I felt a need to defend them, and [more importantly] also to encourage 
you to keep using racket (we use v5.3.6, which you noted compiles fine 
out of the box.  and the binaries work great, too).


Regards,

Matthew Eric

--
Matthew Eric Bassett | http://mebassett.info


 Racket Users list:
 http://lists.racket-lang.org/users


[racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-14 Thread Matthew Eric Bassett

Hey folks,

I was playing around with distributed places and I ran into a some 
problems.  I'm using racket v5.3 and am following the docs from the 
racket reference 
(http://docs.racket-lang.org/reference/distributed-places.html)


Let's say we have an example just like the one in the reference.

hello-world-place.rkt
--
(define (hello-world)
(place ch (printf "hello-world received: ~a\n" (place-channel-get ch))
(place-channel-put ch "Hello World\n")
(printf "hello-world sent: Hello World\n")))

Then from the racket xrepl we do

>> (define-values (node pl)
(spawn-node-supervise-dynamic-place-at remote-node 
"hello-world-place.rkt" 'hello-world))

; there's now a racket process running on my remote-node
>> (*channel-put pl "hi")
; the remote node shuts down as we expect, giving the place-channel-get 
should have locked it until this point.

>> (*channel-get pl)
; dcgm-type: contract violation
;   expected: dcgm?
;   given: #
;   context...:
; /usr/local/lib/racket/collects/racket/place/distributed.rkt:442:8: loop
;/usr/local/lib/racket/collects/xrepl/xrepl.rkt:1341:0
;/usr/local/lib/racket/collects/racket/private/misc.rkt:87:7

I've tried [naively] using place-channel-put/get instead of 
*channel-put/get, same result.  Wrapping it in a message-router makes no 
difference.


>> (message-router node (after-seconds 2 (*channel-put pl "hi!") 
(*channel-get pl)))

; gives same result as above.

Any ideas what I'm doing wrong or what I'm missing?

Many thanks,


--
Matthew Eric Bassett | http://mebassett.info


 Racket Users list:
 http://lists.racket-lang.org/users


Re: [racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-14 Thread Matthew Eric Bassett
Just to update, also tried this on v5.3.1 using 
spawn-node-supervise-place-at with #:thunk set.  same result.


On 12/14/2012 03:31 PM, Matthew Eric Bassett wrote:

Hey folks,

I was playing around with distributed places and I ran into a some 
problems.  I'm using racket v5.3 and am following the docs from the 
racket reference 
(http://docs.racket-lang.org/reference/distributed-places.html)


Let's say we have an example just like the one in the reference.

hello-world-place.rkt
--
(define (hello-world)
(place ch (printf "hello-world received: ~a\n" (place-channel-get 
ch))

(place-channel-put ch "Hello World\n")
(printf "hello-world sent: Hello World\n")))

Then from the racket xrepl we do

>> (define-values (node pl)
(spawn-node-supervise-dynamic-place-at remote-node 
"hello-world-place.rkt" 'hello-world))

; there's now a racket process running on my remote-node
>> (*channel-put pl "hi")
; the remote node shuts down as we expect, giving the 
place-channel-get should have locked it until this point.

>> (*channel-get pl)
; dcgm-type: contract violation
;   expected: dcgm?
;   given: #
;   context...:
; /usr/local/lib/racket/collects/racket/place/distributed.rkt:442:8: loop
;/usr/local/lib/racket/collects/xrepl/xrepl.rkt:1341:0
;/usr/local/lib/racket/collects/racket/private/misc.rkt:87:7

I've tried [naively] using place-channel-put/get instead of 
*channel-put/get, same result.  Wrapping it in a message-router makes 
no difference.


>> (message-router node (after-seconds 2 (*channel-put pl "hi!") 
(*channel-get pl)))

; gives same result as above.

Any ideas what I'm doing wrong or what I'm missing?

Many thanks,





--
Matthew Eric Bassett | http://mebassett.info


 Racket Users list:
 http://lists.racket-lang.org/users


Re: [racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-15 Thread Matthew Eric Bassett

Kevin,

Many thanks for your response.

The only significant difference between your code and mine is the use of 
localhost (which makes distributed places a lot less distributed) and 
the port specification.  In any case, I've tried your code verbatim on 
two machines now.  It also throws the same dcgm contract violation.


What OS are you running?  Perhaps there's something funny about my 
build?  I don't know anything about distributed/places internals here, 
I'm just guessing.


I've tested this on Fedora 17 x64, and on an amazon stock x64 ec2 machine.

Regards,

Matthew Eric

On 12/15/2012 04:05 AM, Kevin Tew wrote:

The following thunk example works for me.
Uncommenting the message-router line will pump back stdout and stderr 
from the remote node so you can see any errors that may be occurring 
at the remote-node.
You will have to kill the message router by hitting CTRL-C when you 
want to end the program.



EXAMPLE 1
-
#lang racket
(require racket/place/distributed)
(define (hello-world)
  (place ch
(printf/f "hello-world received: ~a\n" (place-channel-get ch))
(place-channel-put ch "Hello World\n")
(printf/f "hello-world sent: Hello World\n")))
(provide hello-world)

(module+ main
  (define-values (node pl) (spawn-node-supervise-place-at "localhost" 
#:listen-port 7000 "hello-world-place.rkt" 'hello-world #:thunk #t))

  (*channel-put pl "Hello bozo")
  (*channel-get pl)
  #;(message-router node)
  )


Example 2 show how I would normally write distributed places code 
without using the #:thunk keyword argument.


EXAMPLE 2

#lang racket
(require racket/place/distributed)
(define (hello-world ch)
  (printf/f "hello-world received: ~a\n" (place-channel-get ch))
  (place-channel-put ch "Hello World\n")
  (printf/f "hello-world sent: Hello World\n"))
(provide hello-world)

(module+ main
  (define-values (node pl) (spawn-node-supervise-place-at "localhost" 
#:listen-port 7000 "hello-world-place.rkt" 'hello-world))

  (*channel-put pl "Hello bozo")
  (*channel-get pl)
  #;(message-router node)
  )


On 12/15/2012 02:16 AM, Matthew Eric Bassett wrote:
Just to update, also tried this on v5.3.1 using 
spawn-node-supervise-place-at with #:thunk set.  same result.


On 12/14/2012 03:31 PM, Matthew Eric Bassett wrote:

Hey folks,

I was playing around with distributed places and I ran into a some 
problems.  I'm using racket v5.3 and am following the docs from the 
racket reference 
(http://docs.racket-lang.org/reference/distributed-places.html)


Let's say we have an example just like the one in the reference.

hello-world-place.rkt
--
(define (hello-world)
(place ch (printf "hello-world received: ~a\n" 
(place-channel-get ch))

(place-channel-put ch "Hello World\n")
(printf "hello-world sent: Hello World\n")))

Then from the racket xrepl we do

>> (define-values (node pl)
(spawn-node-supervise-dynamic-place-at remote-node 
"hello-world-place.rkt" 'hello-world))

; there's now a racket process running on my remote-node
>> (*channel-put pl "hi")
; the remote node shuts down as we expect, giving the 
place-channel-get should have locked it until this point.

>> (*channel-get pl)
; dcgm-type: contract violation
;   expected: dcgm?
;   given: #
;   context...:
; /usr/local/lib/racket/collects/racket/place/distributed.rkt:442:8: 
loop

;/usr/local/lib/racket/collects/xrepl/xrepl.rkt:1341:0
; /usr/local/lib/racket/collects/racket/private/misc.rkt:87:7

I've tried [naively] using place-channel-put/get instead of 
*channel-put/get, same result.  Wrapping it in a message-router 
makes no difference.


>> (message-router node (after-seconds 2 (*channel-put pl "hi!") 
(*channel-get pl)))

; gives same result as above.

Any ideas what I'm doing wrong or what I'm missing?

Many thanks,










--
Matthew Eric Bassett | http://mebassett.info


 Racket Users list:
 http://lists.racket-lang.org/users


Re: [racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-16 Thread Matthew Eric Bassett

Kevin,

Thanks again for your time looking into this - hope the dissertation 
edits are going well. :)


Some clarification after I tried it this morning:  Invoking racket (with 
"-W debug", thanks for the tip!) on your hello-world-place.rkt hangs at 
the following:


SPAWNED-PROCESS:2865 (/usr/bin/ssh localhost /usr/local/bin/racket -lm 
racket/place/distributed/launch spawn 7000)

try 0 waiting 1 sec to retry connection to localhost:7000

From the racket repl I tried the following:

>(define-values (node pl) (spawn-node-supervise-place-at "localhost" 
#:listen-port 7000 "hello-world-place.rkt" 'hello-world))

>(*channel-put pl "hello")
>(*channel-get pl)
; dcgm-type: contract violation
; expected: dcgm?
; context...: ; 
/usr/local/lib/racket/collects/racket/place/distributed.rkt:436:8: loop

; /usr/local/lib/racket/collects/xrepl/xrepl.rkt:1342:0
; /usr/local/lib/racket/collects/racket/private/misc.rkt:87:7

Thanks,

Matthew



On 12/15/2012 10:22 PM, Matthew Eric Bassett wrote:

Kevin,

Many thanks for your response.

The only significant difference between your code and mine is the use 
of localhost (which makes distributed places a lot less distributed) 
and the port specification.  In any case, I've tried your code 
verbatim on two machines now.  It also throws the same dcgm contract 
violation.


What OS are you running?  Perhaps there's something funny about my 
build?  I don't know anything about distributed/places internals here, 
I'm just guessing.


I've tested this on Fedora 17 x64, and on an amazon stock x64 ec2 
machine.


Regards,

Matthew Eric

On 12/15/2012 04:05 AM, Kevin Tew wrote:

The following thunk example works for me.
Uncommenting the message-router line will pump back stdout and stderr 
from the remote node so you can see any errors that may be occurring 
at the remote-node.
You will have to kill the message router by hitting CTRL-C when you 
want to end the program.



EXAMPLE 1
-
#lang racket
(require racket/place/distributed)
(define (hello-world)
  (place ch
(printf/f "hello-world received: ~a\n" (place-channel-get ch))
(place-channel-put ch "Hello World\n")
(printf/f "hello-world sent: Hello World\n")))
(provide hello-world)

(module+ main
  (define-values (node pl) (spawn-node-supervise-place-at "localhost" 
#:listen-port 7000 "hello-world-place.rkt" 'hello-world #:thunk #t))

  (*channel-put pl "Hello bozo")
  (*channel-get pl)
  #;(message-router node)
  )


Example 2 show how I would normally write distributed places code 
without using the #:thunk keyword argument.


EXAMPLE 2

#lang racket
(require racket/place/distributed)
(define (hello-world ch)
  (printf/f "hello-world received: ~a\n" (place-channel-get ch))
  (place-channel-put ch "Hello World\n")
  (printf/f "hello-world sent: Hello World\n"))
(provide hello-world)

(module+ main
  (define-values (node pl) (spawn-node-supervise-place-at "localhost" 
#:listen-port 7000 "hello-world-place.rkt" 'hello-world))

  (*channel-put pl "Hello bozo")
  (*channel-get pl)
  #;(message-router node)
  )


On 12/15/2012 02:16 AM, Matthew Eric Bassett wrote:
Just to update, also tried this on v5.3.1 using 
spawn-node-supervise-place-at with #:thunk set. same result.


On 12/14/2012 03:31 PM, Matthew Eric Bassett wrote:

Hey folks,

I was playing around with distributed places and I ran into a some 
problems.  I'm using racket v5.3 and am following the docs from the 
racket reference 
(http://docs.racket-lang.org/reference/distributed-places.html)


Let's say we have an example just like the one in the reference.

hello-world-place.rkt
--
(define (hello-world)
(place ch (printf "hello-world received: ~a\n" 
(place-channel-get ch))

(place-channel-put ch "Hello World\n")
(printf "hello-world sent: Hello World\n")))

Then from the racket xrepl we do

>> (define-values (node pl)
(spawn-node-supervise-dynamic-place-at remote-node 
"hello-world-place.rkt" 'hello-world))

; there's now a racket process running on my remote-node
>> (*channel-put pl "hi")
; the remote node shuts down as we expect, giving the 
place-channel-get should have locked it until this point.

>> (*channel-get pl)
; dcgm-type: contract violation
;   expected: dcgm?
;   given: #
;   context...:
; 
/usr/local/lib/racket/collects/racket/place/distributed.rkt:442:8: 
loop

;/usr/local/lib/racket/collects/xrepl/xrepl.rkt:1341:0
; /usr/local/lib/racket/collects/racket/private/misc.rkt:87:7

I've tried [naively] using place-channel-put/get instead of 
*channel-put/get, same result.  Wrapping it in a message-router 
makes no dif

Re: [racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-16 Thread Matthew Eric Bassett
Thanks, but ssh is set up correctly. If not, racket typically complains 
that it cannot connect to the remote node, rather than throwing the 
contract violation.  In fact, with both the remote and the localhost, I 
can see the new spawned racket process running.   I get the error on 
*channel-get and only when the remote process has already put something 
on the channel.


On 12/16/2012 11:46 AM, Michael Wilber wrote:

This is just a shot in the dark, but do you have your SSH keys set up?
If you get a password prompt when you 'ssh remote-node-name', I think it
might not work.

(From the looks of things, since you're spawning a node on localhost, I
think you might have to get 'ssh localhost' working the same way. Maybe
something like cat .ssh/id_rsa >> .ssh/authorized_keys might help?)

Matthew Eric Bassett  writes:

Kevin,

Thanks again for your time looking into this - hope the dissertation
edits are going well. :)

Some clarification after I tried it this morning:  Invoking racket (with
"-W debug", thanks for the tip!) on your hello-world-place.rkt hangs at
the following:

SPAWNED-PROCESS:2865 (/usr/bin/ssh localhost /usr/local/bin/racket -lm
racket/place/distributed/launch spawn 7000)
try 0 waiting 1 sec to retry connection to localhost:7000

  From the racket repl I tried the following:

  >(define-values (node pl) (spawn-node-supervise-place-at "localhost"
#:listen-port 7000 "hello-world-place.rkt" 'hello-world))
  >(*channel-put pl "hello")
  >(*channel-get pl)
; dcgm-type: contract violation
; expected: dcgm?
; context...: ;
/usr/local/lib/racket/collects/racket/place/distributed.rkt:436:8: loop
; /usr/local/lib/racket/collects/xrepl/xrepl.rkt:1342:0
; /usr/local/lib/racket/collects/racket/private/misc.rkt:87:7

Thanks,

Matthew



On 12/15/2012 10:22 PM, Matthew Eric Bassett wrote:

Kevin,

Many thanks for your response.

The only significant difference between your code and mine is the use
of localhost (which makes distributed places a lot less distributed)
and the port specification.  In any case, I've tried your code
verbatim on two machines now.  It also throws the same dcgm contract
violation.

What OS are you running?  Perhaps there's something funny about my
build?  I don't know anything about distributed/places internals here,
I'm just guessing.

I've tested this on Fedora 17 x64, and on an amazon stock x64 ec2
machine.

Regards,

Matthew Eric

On 12/15/2012 04:05 AM, Kevin Tew wrote:

The following thunk example works for me.
Uncommenting the message-router line will pump back stdout and stderr
from the remote node so you can see any errors that may be occurring
at the remote-node.
You will have to kill the message router by hitting CTRL-C when you
want to end the program.


EXAMPLE 1
-
#lang racket
(require racket/place/distributed)
(define (hello-world)
   (place ch
 (printf/f "hello-world received: ~a\n" (place-channel-get ch))
 (place-channel-put ch "Hello World\n")
 (printf/f "hello-world sent: Hello World\n")))
(provide hello-world)

(module+ main
   (define-values (node pl) (spawn-node-supervise-place-at "localhost"
#:listen-port 7000 "hello-world-place.rkt" 'hello-world #:thunk #t))
   (*channel-put pl "Hello bozo")
   (*channel-get pl)
   #;(message-router node)
   )


Example 2 show how I would normally write distributed places code
without using the #:thunk keyword argument.

EXAMPLE 2

#lang racket
(require racket/place/distributed)
(define (hello-world ch)
   (printf/f "hello-world received: ~a\n" (place-channel-get ch))
   (place-channel-put ch "Hello World\n")
   (printf/f "hello-world sent: Hello World\n"))
(provide hello-world)

(module+ main
   (define-values (node pl) (spawn-node-supervise-place-at "localhost"
#:listen-port 7000 "hello-world-place.rkt" 'hello-world))
   (*channel-put pl "Hello bozo")
   (*channel-get pl)
   #;(message-router node)
   )


On 12/15/2012 02:16 AM, Matthew Eric Bassett wrote:

Just to update, also tried this on v5.3.1 using
spawn-node-supervise-place-at with #:thunk set. same result.

On 12/14/2012 03:31 PM, Matthew Eric Bassett wrote:

Hey folks,

I was playing around with distributed places and I ran into a some
problems.  I'm using racket v5.3 and am following the docs from the
racket reference
(http://docs.racket-lang.org/reference/distributed-places.html)

Let's say we have an example just like the one in the reference.

hello-world-place.rkt
--
(define (hello-world)
 (place ch (printf "hello-world received: ~a\n"
(place-channel-get ch))
 (place-channel-put ch "Hello World\n")
 (printf "hello-world sent: Hello World\n")))

Then fr

Re: [racket] distributed places - throwing dcgm-type contract violation on *channel-get

2012-12-16 Thread Matthew Eric Bassett

On 12/16/2012 04:57 PM, Kevin Tew wrote:
I think the remote node may not be able to find the 
"hello-world-place.rkt" module.
I've added some better error reporting to git head that may help you 
determine if this is the case.
I think this is it!  I ran the spawn command via ssh myself, like you 
suggested, and the process did fail, being unable to find the file.  I 
moved the file into the home directory and that seemed to get things 
working.  I'll checkout the new code from git later on - thanks for your 
help!


--
Matthew Eric Bassett | http://mebassett.info


 Racket Users list:
 http://lists.racket-lang.org/users


[racket] SIGSEGV MAPERR si_code 1 fault on addr 0x7...; can't isolate or consistently reproduce in source code; stack trace points to scheme_uncopy_stack

2013-05-02 Thread Matthew Eric Bassett

Hi all,

It might be better to send this to dev@racket-lang.  Then again, it 
might be completely useless to them.


So we have a job scheduler program written in racket that handles 
various places and tcp clients.  This program sporadically and 
inconsistently terminates with the following error message:


SIGSEGV MAPERR si_code 1 fault on addr 0x7fffb044ef48

We've caught the error at various different point of execution, but 
can't consistently reproduce it (yet).  We do have a core dump of the 
program running and terminating from the racket repl (loaded with 
"enter!") v 5.3.3.  I've made it available via dropbox at 
https://www.dropbox.com/s/rkd6pl511acll2r/core.12346.gz.


I don't have much experience reading core dumps, but it looks to me 
like racket is hitting a stackoverflow in scheme_uncopy_stack in 
setjmpup.c.


In particular, at the first time scheme_uncopy_stack appears in the 
stack with args scheme_uncopy_stack (ok=0, b=0x7f857b2b3510, 
prev=0x7fffb044f5e0) we have:



(gdb) p prev

$1 = (intptr_t *) 0x7fffb044f5e0

(gdb) p *prev

$2 = 0

(gdb) p b

$3 = (Scheme_Jumpup_Buf *) 0x7f857b2b3510

(gdb) p *b
$4 = {stack_from = 0x0, stack_copy = 0x0, stack_size = 0, 
stack_max_size = 0, cont = 0x0, buf = {jb = {{jb = {{
__jmpbuf = {0, 0, 0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, 
__saved_mask = {__val = {
0 , stack_frame = 0}}, gcvs = 0, 
gcvs_cnt = 0}, gc_var_stack = 0x0,

  external_stack = 0x0}

scheme_uncopy_stack remains in the stack for several thousand frames.

The racket interpreter was compiled from source (so I don't know if 
others can even read that coredump!) on a linux kernel 
3.4.37-40.44.amzn1.x86_64 #1 SMP Thu Mar 21 01:17:08 UTC 2013 x86_64 
x86_64 x86_64 GNU/Linux with glibc/-devel 
glibc-2.12-1.107.43.amzn1.x86_64.


I was able to capture the same error running from the MacOSX binaries 
5.3.3 from racket-lang.org.  That core dump is available at 
https://www.dropbox.com/s/jfneqr4zlkmkjhh/core.41166.gz.



Is this an error in racket?  IF not, do you have any suggestions on how 
I can proceed in debugging this (I'm at a loss?) or even to figure out 
which bits of my racket code to look at?  (I've tried doing "info 
locals" from gdb at various points in the stack, but I've not reached 
enlightenment.  Again, I have little experience with reading core 
dumps).


I've not included any of our racket code, as we don't know which part 
is causing the problem.


Thanks for reading,

--
Matthew Eric Bassett | http://mebassett.info

 Racket Users list:
 http://lists.racket-lang.org/users


Re: [racket] SIGSEGV MAPERR si_code 1 fault on addr 0x7...; can't isolate or consistently reproduce in source code; stack trace points to scheme_uncopy_stack

2013-05-09 Thread Matthew Eric Bassett
After some hard, clever work by my colleague, we've managed to narrow 
this one down a bit further.


First, we have compiled racket with optimization disabled, and we do 
have an all-zeroed Scheme_Jmpup_Buf.  Please see our gdb session at 
http://pastebin.com/aBx2FTcK


Second, we've managed to consistently reproduce the segfault in a 
single line of code (a core dump of the racket session looks a lot like 
the one running with our code).  The offending line is



(let loop () (thread (const '())) (loop))


Obviously, we don't have that exact line in our production code :)  but 
it produces the same error more quickly and more consistently.  
Interestingly,



(let loop () (thread (thunk '())) (loop))


Does not produce a segfault.

We've caught this segv on racket compiled on an AWS machine and on the 
Mac OSX binaries distributed by you guys.





On 2013-05-03 02:04, Matthew Flatt wrote:
A stack overflow in scheme_uncopy_stack() sounds like a thread that 
is
trying to jump to a continuation whose representation is corrupted. 
(An

all-zeroed Scheme_Jmpup_Buf could have that effect, but I don't
particularly trust gdb to tell us the actual content, unless you
disabled optimization when compiling `racket'.)

Assuming that the latest in the Racket git repo doesn't work any 
better
for you --- and I don't expect that it does in this case --- if you 
can

send me something to run that provokes the crash, I can investigate
more.

At Thu, 02 May 2013 18:42:56 +0100, Matthew Eric Bassett wrote:

Hi all,

It might be better to send this to dev@racket-lang.  Then again, it
might be completely useless to them.

So we have a job scheduler program written in racket that handles
various places and tcp clients.  This program sporadically and
inconsistently terminates with the following error message:

SIGSEGV MAPERR si_code 1 fault on addr 0x7fffb044ef48

We've caught the error at various different point of execution, but
can't consistently reproduce it (yet).  We do have a core dump of 
the

program running and terminating from the racket repl (loaded with
"enter!") v 5.3.3.  I've made it available via dropbox at
https://www.dropbox.com/s/rkd6pl511acll2r/core.12346.gz.

I don't have much experience reading core dumps, but it looks to me
like racket is hitting a stackoverflow in scheme_uncopy_stack in
setjmpup.c.

In particular, at the first time scheme_uncopy_stack appears in the
stack with args scheme_uncopy_stack (ok=0, b=0x7f857b2b3510,
prev=0x7fffb044f5e0) we have:

>>(gdb) p prev
$1 = (intptr_t *) 0x7fffb044f5e0
>>(gdb) p *prev
$2 = 0
>>(gdb) p b
$3 = (Scheme_Jumpup_Buf *) 0x7f857b2b3510
>>(gdb) p *b
$4 = {stack_from = 0x0, stack_copy = 0x0, stack_size = 0,
stack_max_size = 0, cont = 0x0, buf = {jb = {{jb = {{
 __jmpbuf = {0, 0, 0, 0, 0, 0, 0, 0}, __mask_was_saved = 
0,

__saved_mask = {__val = {
 0 , stack_frame = 0}}, gcvs = 
0,

gcvs_cnt = 0}, gc_var_stack = 0x0,
   external_stack = 0x0}

scheme_uncopy_stack remains in the stack for several thousand 
frames.


The racket interpreter was compiled from source (so I don't know if
others can even read that coredump!) on a linux kernel
3.4.37-40.44.amzn1.x86_64 #1 SMP Thu Mar 21 01:17:08 UTC 2013 x86_64
x86_64 x86_64 GNU/Linux with glibc/-devel
glibc-2.12-1.107.43.amzn1.x86_64.

I was able to capture the same error running from the MacOSX 
binaries

5.3.3 from racket-lang.org.  That core dump is available at
https://www.dropbox.com/s/jfneqr4zlkmkjhh/core.41166.gz.


Is this an error in racket?  IF not, do you have any suggestions on 
how
I can proceed in debugging this (I'm at a loss?) or even to figure 
out

which bits of my racket code to look at?  (I've tried doing "info
locals" from gdb at various points in the stack, but I've not 
reached

enlightenment.  Again, I have little experience with reading core
dumps).

I've not included any of our racket code, as we don't know which 
part

is causing the problem.

Thanks for reading,

--
Matthew Eric Bassett | http://mebassett.info

  Racket Users list:
  http://lists.racket-lang.org/users


  Racket Users list:
  http://lists.racket-lang.org/users


--
--
Matthew Eric Bassett | http://mebassett.info

 Racket Users list:
 http://lists.racket-lang.org/users