[gnutls-devel] Guile-GnuTLS | Segmentation fault following `read_from_session_record_port`, calling `scm_to_bool` with an invalid value (#29)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Wed Feb 12 14:14:20 CET 2025
Christopher Baines created an issue: https://gitlab.com/gnutls/guile/-/issues/29
I'm seeing Guile segfault, I think while trying to print an exception that originates from Guile GnuTLS.
`read_from_session_record_port` is calling `scm_to_bool` with an invalid value. Maybe `scm_is_true` should be used instead of `scm_to_bool`? I presume there's some underlying problem that would still exist though.
```
#0 iprin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x0, port=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>,
pstate=0x7fcf32ba2e08) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:628
#1 0x00007fcf3ecc907a in scm_iprin1 (exp=<optimized out>, port=<optimized out>, pstate=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:561
#2 0x00007fcf3ecc94ff in scm_iprlist (hdr=hdr at entry=0x7fcf3ed19af0 "(",
exp=exp at entry=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777d0, tlr=tlr at entry=41,
port=port at entry=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>, pstate=pstate at entry=0x7fcf32ba2e08)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:1019
#3 0x00007fcf3ecc7f72 in iprin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777d0,
port=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>, pstate=0x7fcf32ba2e08)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:653
#4 0x00007fcf3ecc907a in scm_iprin1 (exp=<optimized out>, port=<optimized out>, pstate=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:561
#5 0x00007fcf3ecc928c in scm_prin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777d0, port=<optimized out>,
writingp=<optimized out>) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:840
#6 0x00007fcf3ecc93a2 in scm_write (obj=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777d0,
port=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcd84fcc3e0)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:1099
#7 0x00007fcf3ecf473f in vm_regular_engine (thread=0x7fcf32d4a6c0) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/vm-engine.c:972
#8 0x00007fcf3ed02445 in scm_call_n (proc=<optimized out>, argv=<optimized out>, nargs=2)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/vm.c:1616
#9 0x00007fcf3ec6b71a in scm_call_2 (proc=<optimized out>, arg1=<optimized out>, arg2=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/eval.c:503
#10 0x00007fcf3ecc8f29 in iprin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcedc18db40,
port=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>, pstate=0x7fcf32ba2e08)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:645
#11 0x00007fcf3ecc907a in scm_iprin1 (exp=<optimized out>, port=<optimized out>, pstate=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:561
#12 0x00007fcf3ecc94ff in scm_iprlist (hdr=hdr at entry=0x7fcf3ed19af0 "(",
exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc377420,
exp at entry=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc377480, tlr=tlr at entry=41,
port=port at entry=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>, pstate=pstate at entry=0x7fcf32ba2e08)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:1019
#13 0x00007fcf3ecc7f72 in iprin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc377480,
port=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>, pstate=0x7fcf32ba2e08)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:653
#14 0x00007fcf3ecc907a in scm_iprin1 (exp=<optimized out>, port=<optimized out>, pstate=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:561
#15 0x00007fcf3ecc928c in scm_prin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc377480, port=<optimized out>,
writingp=<optimized out>) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:840
#16 0x00007fcf3ecc93a2 in scm_write (obj=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc377480,
port=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcd84fcc500)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:1099
#17 0x00007fcf3ecf473f in vm_regular_engine (thread=0x7fcf32d4a6c0) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/vm-engine.c:972
#18 0x00007fcf3ed02445 in scm_call_n (proc=<optimized out>, argv=<optimized out>, nargs=2)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/vm.c:1616
--Type <RET> for more, q to quit, c to continue without paging--
#19 0x00007fcf3ec6b71a in scm_call_2 (proc=<optimized out>, arg1=<optimized out>, arg2=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/eval.c:503
#20 0x00007fcf3ecc8f29 in iprin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcedc190ea0,
port=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>, pstate=0x7fcf32ba2e08)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:645
#21 0x00007fcf3ecc907a in scm_iprin1 (exp=<optimized out>, port=<optimized out>, pstate=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:561
#22 0x00007fcf3ecc924d in scm_prin1 (exp=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcedc190ea0,
port=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>, writingp=1)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:840
#23 0x00007fcf3ecc93a2 in scm_write (obj=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcedc190ea0,
port=#<port #<port-type custom-port 7fcf3e1b7900> 7fcd84fcc580>) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/print.c:1099
#24 0x00007fcf3ecf473f in vm_regular_engine (thread=0x7fcf32d4a6c0) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/vm-engine.c:972
#25 0x00007fcf3ed02445 in scm_call_n (proc=<optimized out>, argv=<optimized out>, nargs=5)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/vm.c:1616
#26 0x00007fcf3ec6fff9 in scm_apply_0 (proc=#<program 7fcf3e217240>, args=()) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/eval.c:603
#27 0x00007fcf3ecf232d in scm_throw (key=wrong-type-arg, args=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3776b0)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/throw.c:262
#28 0x00007fcf3ecf2349 in scm_ithrow (key=<optimized out>, args=<optimized out>, no_return=<optimized out>)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/throw.c:457
#29 0x00007fcf3ec6cee5 in scm_error_scm (key=key at entry=wrong-type-arg, subr=<optimized out>, message=message at entry="Wrong type: ~S",
args=args at entry=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777d0,
data=data at entry=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777e0)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/error.c:90
#30 0x00007fcf3ec6cf40 in scm_error (key=wrong-type-arg, subr=subr at entry=0x0, message=<optimized out>,
args=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777d0,
rest=rest at entry=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7fcefc3777e0)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/error.c:62
#31 0x00007fcf3ec6e0ca in scm_wrong_type_arg (subr=0x0, pos=0, bad_value=<error reading variable: ERROR: Cannot access memory at address 0x0>0x0)
at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/error.c:247
#32 0x00007fcf3ec64620 in scm_to_bool (x=<optimized out>) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/boolean.c:100
#33 scm_to_bool (x=<optimized out>) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/boolean.c:93
#34 0x00007fcf3011ab8a in read_from_session_record_port (port=<optimized out>, dst=<optimized out>, start=<optimized out>, count=1024) at core.c:1124
#35 0x00007fcf3ecbfe0c in trampoline_to_c_read (port=#<port #<port-type gnutls-session-port 7fcf3e1b7b40> 7fcefc4e1e00>, dst="#<vu8vector>" = {...}, start=0,
count=1024) at /tmp/guix-build-guile-next-3.0.10-0.5d3f561.drv-0/source/libguile/ports.c:266
```
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/guile/-/issues/29
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20250212/27391f81/attachment-0001.html>
More information about the Gnutls-devel
mailing list