






@cadr the segfault is in port-next-location
, which assumes that any struct is a certain kind of struct

I think you wrote that code and I’m not sure what it’s supposed to do

@samth do we know the input that makes it error?

it’s a print-port-info
struct

Traceback (most recent call last):
File "/home/samth/sw/pycket/pycket/__main__.py", line 32, in main
sys.exit(f(sys.argv))
File "/home/samth/sw/pycket/pycket/entry_point.py", line 46, in entry_point
return actual_entry(argv)
File "/home/samth/sw/pycket/pycket/entry_point.py", line 103, in actual_entry
racket_entry(names, config, pycketconfig, current_cmd_args)
File "/home/samth/sw/pycket/pycket/racket_entry.py", line 246, in racket_entry
namespace_require_plus(require_spec, pycketconfig)
File "/home/samth/sw/pycket/pycket/racket_entry.py", line 200, in namespace_require_plus
namespace_require.call_interpret([m], pycketconfig)
File "/home/samth/sw/pycket/pycket/base.py", line 73, in call_interpret
return interpret_one(ast, env, cont)
File "/home/samth/sw/pycket/pycket/interpreter.py", line 2601, in interpret_one
inner_interpret(ast, env, cont)
File "/home/samth/sw/pycket/pycket/interpreter.py", line 2558, in inner_interpret_two_state
ast, env, cont = ast.interpret(env, cont)
File "/home/samth/sw/pycket/pycket/cont.py", line 373, in interpret
return func(*args)
File "/home/samth/sw/pycket/pycket/interpreter.py", line 840, in safe_return_multi_vals
return cont.plug_reduce(vals, env)
File "/home/samth/sw/pycket/pycket/cont.py", line 315, in plug_reduce
return func(*args)
File "/home/samth/sw/pycket/pycket/prims/general.py", line 1366, in struct_port_loc_cont
lin = pr.get_line()
AttributeError: 'W_StructSize7' object has no attribute 'get_line'
> /home/samth/sw/pycket/pycket/prims/general.py(1366)struct_port_loc_cont()
-> lin = pr.get_line()
(Pdb)
(Pdb) p pr
<rpython.tool.pairtype.W_StructSize7 object at 0x0000558371914090>
(Pdb) p pr.tostring()
'#<print-port-info>'

line 1542 of racket/pretty.rkt

@samth yeah I have a strong hypothesis on exactly what the issue is, fixing it now

pycket-c-linklets -e "(require racket/pretty)" -e "(pretty-print 1)"
segfaults







(module p ’#%kernel (define-values (struct:printing-port make-printing-port printing-port? printing-port-port printing-port-info) (let-values (((struct: make- ? -ref -set!) (let-values () (let-values () (#%app make-struct-type ‘printing-port ’#f ‘2 ’0 ’#f (#%app list (#%app cons prop:output-port ‘1) (#%app cons prop:input-port ’1)) (#%app current-inspector) ’#f ’(0 1) ’#f ‘printing-port))))) (#%app values struct: make- ? (#%app make-struct-field-accessor -ref ’0 ’port) (#%app make-struct-field-accessor -ref ’1 ’info)))) (define-values (w) (#%app open-output-string)) (#%app write ’“hey” w) (define-values (p) (#%app make-printing-port w ’dummy)) (define-values (a b c) (#%app port-next-location p)) (#%app printf "~a ~a ~a\n" a b c))



I’m getting this error when compiling contract/private/object.rkt
->
#<procedure:rhs?>
boolean?
listof
#<procedure:sattr?:1>
#<procedure:rhs?>
<collects>/syntax/parse/private/rep.rkt
ERROR : fixup-rhs: contract violation
expected: #<procedure:rhs?>
given: #s(rhs (#s(attr value 0 #f)) #t #<syntax> (#s(variant #<syntax> (#s(attr value 0 #f) #s(attr x 0 #t)) #s(pat:and (#s(pat:ord #s(pat:fixup #<syntax> #<syntax> #<syntax> #<syntax> #s(arguments () () ()) #f #f) group2 0) #s(pat:ord #s(pat:action #s(action:and (#s(action:ord #s(action:post #s(action:fail #<syntax> #<syntax>)) group1 0) #s(action:bind #s(attr #<syntax> 0 #f) #<syntax>) #s(action:ord #s(action:post #s(action:fail #<syntax> #<syntax>)) group1 2) #s(action:ord #s(action:post #s(action:fail #<syntax> #<syntax>)) group1 3) #s(action:do (#<syntax>)))) #s(pat:any)) group2 1))) ())) () #t #t)
in: the 1st argument of
contract from:
blaming: <collects>/syntax/parse/private/parse.rkt
(assuming the contract is correct)
at: <collects>/syntax/parse/private/rep.rkt:1.0

i get that too

but did you remove all your zo files?

I’m trying again with no zo files

also, I don’t understad the issue with liberal-define-context?

it’s in general.py

with the right conditional

can you take a look?

@samth sure

Also I didn’t clean the zo files myself, I just ran make recompile-racket-modules

@samth 15 / 266 failed
with that fixup-rhs: contract violation
error above

yes, I get that with just running racket/contract/private/object with -c

I think it’s a duplicate module error again

can you use the instrumentation you used before to look at it?

@samth sure, let me reproduce it first





> (require syntax/parse/private/rep-data)
> rhs?
#<procedure:rhs?>
> (rhs? (rhs #f #F #F #f #F))
exn:fail : #<procedure:rhs>: wrong number of arguments; expected 7 but got 5
> (rhs? (rhs #f #F #F #f #F #f #f))
#t
> (rhs? #s(rhs #f #F #F #f #F #f #f))
#f
>





