Closed sansyrox closed 2 years ago
Hello
No, this is the first time I'm seeing this. It would help if you could minimize the reproducer to something shorter. Also, a stack trace from gdb could shed some light into what's happening. And honestly, segfault is a bit suspicious thing here, as poy3-log has no unsafe code in it β the theory is that it should be impossible to cause it from such code due to Rust safety guarantees and that the problem probably lies somewhere else (or at least part of the problem).
Hi @vorner ,
Thank you for your revert. I was able to isolate the problem to some extent(updated in the description).
However, I am still learning on how to use gdb with python. I will update the trace as soon as I can figure it out.
Just tried out lldb
, which is similar to gdb
.
But I still got this. I created a simple bash script to run the script with the venv Python.
(lldb) platform shell /Users/bruhh/Desktop/robyn/a.sh
/Users/bruhh/Desktop/robyn/a.sh: line 3: 97612 Segmentation fault: 11 /Users/bruhh/Desktop/robyn/venv/bin/python /Users/bruhh/Desktop/robyn/integration_tests/base_routes.py
error: command returned with status 139
Hi @vorner ,
I was unable to debug what was causing the seg fault. But I was able to find a fix to this issue. My repo is using pyo3-0.14.x
and the latest version of pyo3-log
requires atleast 0.16.0
(correct me if I am wrong).
I fixed it by downgrading pyo3-log
.
Let me re-check I understand it correctly. Your program contained two versions of pyo3
, using both? If that's the case, then it's something that I wouldn't expect to work and matching the versions is the right solution.
Anyway, the last few versions of pyo3-log differ only in the version of pyo3 they depend on, so you're not missing anything by downgrading (at least, not on the pyo3-log side).
Let me re-check I understand it correctly. Your program contained two versions of pyo3, using both? If that's the case, then it's something that I wouldn't expect to work and matching the versions is the right solution.
Nope. It only contained one pyo3(0.14.1).
Anyway, the last few versions of pyo3-log differ only in the version of pyo3 they depend on, so you're not missing anything by downgrading (at least, not on the pyo3-log side).
Ah, perfect then! :D
Nope. It only contained one pyo3(0.14.1).
I mean including the indirect dependencies. You depended (directly) on 0.14.1 and pyo3-log depended on 0.16, so it pulled in both into the dep graph.
Do you still have the old version somewhere? Can you do cargo tree
on that? (you might need to install it) or attach the Cargo.lock
or Cargo.toml
here?
@vorner ,
I mean including the indirect dependencies. You depended (directly) on 0.14.1 and pyo3-log depended on 0.16, so it pulled in both into the dep graph.
That would have been possible.
Here is the cargo tree
robyn v0.16.3 (/Users/bruhh/Desktop/robyn)
βββ actix v0.13.0
β βββ actix-rt v2.7.0
β β βββ futures-core v0.3.21
β β βββ tokio v1.18.2
β β βββ bytes v1.1.0
β β βββ libc v0.2.125
β β βββ memchr v2.5.0
β β βββ mio v0.8.3
β β β βββ libc v0.2.125
β β β βββ log v0.4.17
β β β βββ cfg-if v1.0.0
β β βββ num_cpus v1.13.1
β β β βββ libc v0.2.125
β β βββ once_cell v1.10.0
β β βββ parking_lot v0.12.0
β β β βββ lock_api v0.4.7
β β β β βββ scopeguard v1.1.0
β β β β [build-dependencies]
β β β β βββ autocfg v1.1.0
β β β βββ parking_lot_core v0.9.3
β β β βββ cfg-if v1.0.0
β β β βββ libc v0.2.125
β β β βββ smallvec v1.8.0
β β βββ pin-project-lite v0.2.9
β β βββ signal-hook-registry v1.4.0
β β β βββ libc v0.2.125
β β βββ socket2 v0.4.5
β β β βββ libc v0.2.125
β β βββ tokio-macros v1.7.0 (proc-macro)
β β βββ proc-macro2 v1.0.38
β β β βββ unicode-xid v0.2.3
β β βββ quote v1.0.18
β β β βββ proc-macro2 v1.0.38 (*)
β β βββ syn v1.0.92
β β βββ proc-macro2 v1.0.38 (*)
β β βββ quote v1.0.18 (*)
β β βββ unicode-xid v0.2.3
β βββ actix_derive v0.6.0 (proc-macro)
β β βββ proc-macro2 v1.0.38 (*)
β β βββ quote v1.0.18 (*)
β β βββ syn v1.0.92 (*)
β βββ bitflags v1.3.2
β βββ bytes v1.1.0
β βββ crossbeam-channel v0.5.4
β β βββ cfg-if v1.0.0
β β βββ crossbeam-utils v0.8.8
β β βββ cfg-if v1.0.0
β β βββ lazy_static v1.4.0
β βββ futures-core v0.3.21
β βββ futures-sink v0.3.21
β βββ futures-task v0.3.21
β βββ futures-util v0.3.21
β β βββ futures-channel v0.3.21
β β β βββ futures-core v0.3.21
β β β βββ futures-sink v0.3.21
β β βββ futures-core v0.3.21
β β βββ futures-io v0.3.21
β β βββ futures-macro v0.3.21 (proc-macro)
β β β βββ proc-macro2 v1.0.38 (*)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β βββ futures-sink v0.3.21
β β βββ futures-task v0.3.21
β β βββ memchr v2.5.0
β β βββ pin-project-lite v0.2.9
β β βββ pin-utils v0.1.0
β β βββ slab v0.4.6
β βββ log v0.4.17 (*)
β βββ once_cell v1.10.0
β βββ parking_lot v0.12.0 (*)
β βββ pin-project-lite v0.2.9
β βββ smallvec v1.8.0
β βββ tokio v1.18.2 (*)
β βββ tokio-util v0.7.1
β βββ bytes v1.1.0
β βββ futures-core v0.3.21
β βββ futures-sink v0.3.21
β βββ pin-project-lite v0.2.9
β βββ tokio v1.18.2 (*)
β βββ tracing v0.1.34
β βββ cfg-if v1.0.0
β βββ log v0.4.17 (*)
β βββ pin-project-lite v0.2.9
β βββ tracing-attributes v0.1.21 (proc-macro)
β β βββ proc-macro2 v1.0.38 (*)
β β βββ quote v1.0.18 (*)
β β βββ syn v1.0.92 (*)
β βββ tracing-core v0.1.26
β βββ lazy_static v1.4.0
βββ actix-files v0.6.0
β βββ actix-http v3.0.4
β β βββ actix-codec v0.5.0
β β β βββ bitflags v1.3.2
β β β βββ bytes v1.1.0
β β β βββ futures-core v0.3.21
β β β βββ futures-sink v0.3.21
β β β βββ log v0.4.17 (*)
β β β βββ memchr v2.5.0
β β β βββ pin-project-lite v0.2.9
β β β βββ tokio v1.18.2 (*)
β β β βββ tokio-util v0.7.1 (*)
β β βββ actix-rt v2.7.0 (*)
β β βββ actix-service v2.0.2
β β β βββ futures-core v0.3.21
β β β βββ paste v1.0.7 (proc-macro)
β β β βββ pin-project-lite v0.2.9
β β βββ actix-utils v3.0.0
β β β βββ local-waker v0.1.3
β β β βββ pin-project-lite v0.2.9
β β βββ ahash v0.7.6
β β β βββ getrandom v0.2.6
β β β β βββ cfg-if v1.0.0
β β β β βββ libc v0.2.125
β β β βββ once_cell v1.10.0
β β β [build-dependencies]
β β β βββ version_check v0.9.4
β β βββ base64 v0.13.0
β β βββ bitflags v1.3.2
β β βββ brotli v3.3.4
β β β βββ alloc-no-stdlib v2.0.3
β β β βββ alloc-stdlib v0.2.1
β β β β βββ alloc-no-stdlib v2.0.3
β β β βββ brotli-decompressor v2.3.2
β β β βββ alloc-no-stdlib v2.0.3
β β β βββ alloc-stdlib v0.2.1 (*)
β β βββ bytes v1.1.0
β β βββ bytestring v1.0.0
β β β βββ bytes v1.1.0
β β βββ derive_more v0.99.17 (proc-macro)
β β β βββ convert_case v0.4.0
β β β βββ proc-macro2 v1.0.38 (*)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β β [build-dependencies]
β β β βββ rustc_version v0.4.0
β β β βββ semver v1.0.9
β β βββ encoding_rs v0.8.31
β β β βββ cfg-if v1.0.0
β β βββ flate2 v1.0.23
β β β βββ cfg-if v1.0.0
β β β βββ crc32fast v1.3.2
β β β β βββ cfg-if v1.0.0
β β β βββ libc v0.2.125
β β β βββ miniz_oxide v0.5.1
β β β βββ adler v1.0.2
β β βββ futures-core v0.3.21
β β βββ h2 v0.3.13
β β β βββ bytes v1.1.0
β β β βββ fnv v1.0.7
β β β βββ futures-core v0.3.21
β β β βββ futures-sink v0.3.21
β β β βββ futures-util v0.3.21 (*)
β β β βββ http v0.2.7
β β β β βββ bytes v1.1.0
β β β β βββ fnv v1.0.7
β β β β βββ itoa v1.0.1
β β β βββ indexmap v1.8.1
β β β β βββ hashbrown v0.11.2
β β β β [build-dependencies]
β β β β βββ autocfg v1.1.0
β β β βββ slab v0.4.6
β β β βββ tokio v1.18.2 (*)
β β β βββ tokio-util v0.7.1 (*)
β β β βββ tracing v0.1.34 (*)
β β βββ http v0.2.7 (*)
β β βββ httparse v1.7.1
β β βββ httpdate v1.0.2
β β βββ itoa v1.0.1
β β βββ language-tags v0.3.2
β β βββ local-channel v0.1.3
β β β βββ futures-core v0.3.21
β β β βββ futures-sink v0.3.21
β β β βββ futures-util v0.3.21 (*)
β β β βββ local-waker v0.1.3
β β βββ log v0.4.17 (*)
β β βββ mime v0.3.16
β β βββ percent-encoding v2.1.0
β β βββ pin-project-lite v0.2.9
β β βββ rand v0.8.5
β β β βββ libc v0.2.125
β β β βββ rand_chacha v0.3.1
β β β β βββ ppv-lite86 v0.2.16
β β β β βββ rand_core v0.6.3
β β β β βββ getrandom v0.2.6 (*)
β β β βββ rand_core v0.6.3 (*)
β β βββ sha-1 v0.10.0
β β β βββ cfg-if v1.0.0
β β β βββ cpufeatures v0.2.2
β β β βββ digest v0.10.3
β β β βββ block-buffer v0.10.2
β β β β βββ generic-array v0.14.5
β β β β βββ typenum v1.15.0
β β β β [build-dependencies]
β β β β βββ version_check v0.9.4
β β β βββ crypto-common v0.1.3
β β β βββ generic-array v0.14.5 (*)
β β β βββ typenum v1.15.0
β β βββ smallvec v1.8.0
β β βββ zstd v0.10.0+zstd.1.5.2
β β βββ zstd-safe v4.1.4+zstd.1.5.2
β β βββ libc v0.2.125
β β βββ zstd-sys v1.6.3+zstd.1.5.2
β β βββ libc v0.2.125
β β [build-dependencies]
β β βββ cc v1.0.73
β β βββ jobserver v0.1.24
β β βββ libc v0.2.125
β βββ actix-service v2.0.2 (*)
β βββ actix-utils v3.0.0 (*)
β βββ actix-web v4.0.1
β β βββ actix-codec v0.5.0 (*)
β β βββ actix-http v3.0.4 (*)
β β βββ actix-macros v0.2.3 (proc-macro)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β βββ actix-router v0.5.0
β β β βββ bytestring v1.0.0 (*)
β β β βββ firestorm v0.5.0
β β β βββ http v0.2.7 (*)
β β β βββ log v0.4.17 (*)
β β β βββ regex v1.5.5
β β β β βββ aho-corasick v0.7.18
β β β β β βββ memchr v2.5.0
β β β β βββ memchr v2.5.0
β β β β βββ regex-syntax v0.6.25
β β β βββ serde v1.0.137
β β βββ actix-rt v2.7.0 (*)
β β βββ actix-server v2.1.1
β β β βββ actix-rt v2.7.0 (*)
β β β βββ actix-service v2.0.2 (*)
β β β βββ actix-utils v3.0.0 (*)
β β β βββ futures-core v0.3.21
β β β βββ futures-util v0.3.21 (*)
β β β βββ mio v0.8.3 (*)
β β β βββ num_cpus v1.13.1 (*)
β β β βββ socket2 v0.4.5 (*)
β β β βββ tokio v1.18.2 (*)
β β β βββ tracing v0.1.34 (*)
β β βββ actix-service v2.0.2 (*)
β β βββ actix-utils v3.0.0 (*)
β β βββ actix-web-codegen v4.0.0 (proc-macro)
β β β βββ actix-router v0.5.0 (*)
β β β βββ proc-macro2 v1.0.38 (*)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β βββ ahash v0.7.6 (*)
β β βββ bytes v1.1.0
β β βββ bytestring v1.0.0 (*)
β β βββ cfg-if v1.0.0
β β βββ cookie v0.16.0
β β β βββ percent-encoding v2.1.0
β β β βββ time v0.3.9
β β β βββ itoa v1.0.1
β β β βββ libc v0.2.125
β β β βββ num_threads v0.1.6
β β β β βββ libc v0.2.125
β β β βββ time-macros v0.2.4 (proc-macro)
β β β [build-dependencies]
β β β βββ version_check v0.9.4
β β βββ derive_more v0.99.17 (proc-macro) (*)
β β βββ encoding_rs v0.8.31 (*)
β β βββ futures-core v0.3.21
β β βββ futures-util v0.3.21 (*)
β β βββ itoa v1.0.1
β β βββ language-tags v0.3.2
β β βββ log v0.4.17 (*)
β β βββ mime v0.3.16
β β βββ once_cell v1.10.0
β β βββ pin-project-lite v0.2.9
β β βββ regex v1.5.5 (*)
β β βββ serde v1.0.137
β β βββ serde_json v1.0.81
β β β βββ itoa v1.0.1
β β β βββ ryu v1.0.9
β β β βββ serde v1.0.137
β β βββ serde_urlencoded v0.7.1
β β β βββ form_urlencoded v1.0.1
β β β β βββ matches v0.1.9
β β β β βββ percent-encoding v2.1.0
β β β βββ itoa v1.0.1
β β β βββ ryu v1.0.9
β β β βββ serde v1.0.137
β β βββ smallvec v1.8.0
β β βββ socket2 v0.4.5 (*)
β β βββ time v0.3.9 (*)
β β βββ url v2.2.2
β β βββ form_urlencoded v1.0.1 (*)
β β βββ idna v0.2.3
β β β βββ matches v0.1.9
β β β βββ unicode-bidi v0.3.8
β β β βββ unicode-normalization v0.1.19
β β β βββ tinyvec v1.6.0
β β β βββ tinyvec_macros v0.1.0
β β βββ matches v0.1.9
β β βββ percent-encoding v2.1.0
β βββ askama_escape v0.10.3
β βββ bitflags v1.3.2
β βββ bytes v1.1.0
β βββ derive_more v0.99.17 (proc-macro) (*)
β βββ futures-core v0.3.21
β βββ http-range v0.1.5
β βββ log v0.4.17 (*)
β βββ mime v0.3.16
β βββ mime_guess v2.0.4
β β βββ mime v0.3.16
β β βββ unicase v2.6.0
β β [build-dependencies]
β β βββ version_check v0.9.4
β β [build-dependencies]
β β βββ unicase v2.6.0 (*)
β βββ percent-encoding v2.1.0
β βββ pin-project-lite v0.2.9
βββ actix-http v3.0.4 (*)
βββ actix-web v4.0.1 (*)
βββ actix-web-actors v4.1.0
β βββ actix v0.13.0 (*)
β βββ actix-codec v0.5.0 (*)
β βββ actix-http v3.0.4 (*)
β βββ actix-web v4.0.1 (*)
β βββ bytes v1.1.0
β βββ bytestring v1.0.0 (*)
β βββ futures-core v0.3.21
β βββ pin-project-lite v0.2.9
β βββ tokio v1.18.2 (*)
βββ anyhow v1.0.57
βββ dashmap v4.0.2 (https://github.com/quake/dashmap?branch=parking_lot#c964e5c2)
β βββ cfg-if v1.0.0
β βββ num_cpus v1.13.1 (*)
β βββ parking_lot v0.11.2
β βββ instant v0.1.12
β β βββ cfg-if v1.0.0
β βββ lock_api v0.4.7 (*)
β βββ parking_lot_core v0.8.5
β βββ cfg-if v1.0.0
β βββ instant v0.1.12 (*)
β βββ libc v0.2.125
β βββ smallvec v1.8.0
βββ futures v0.3.21
β βββ futures-channel v0.3.21 (*)
β βββ futures-core v0.3.21
β βββ futures-executor v0.3.21
β β βββ futures-core v0.3.21
β β βββ futures-task v0.3.21
β β βββ futures-util v0.3.21 (*)
β βββ futures-io v0.3.21
β βββ futures-sink v0.3.21
β βββ futures-task v0.3.21
β βββ futures-util v0.3.21 (*)
βββ futures-util v0.3.21 (*)
βββ matchit v0.4.6
βββ pyo3 v0.14.5
β βββ cfg-if v1.0.0
β βββ indoc v0.3.6
β β βββ indoc-impl v0.3.6 (proc-macro)
β β β βββ proc-macro-hack v0.5.19 (proc-macro)
β β β βββ proc-macro2 v1.0.38 (*)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β β βββ unindent v0.1.9
β β βββ proc-macro-hack v0.5.19 (proc-macro)
β βββ libc v0.2.125
β βββ parking_lot v0.11.2 (*)
β βββ paste v0.1.18
β β βββ paste-impl v0.1.18 (proc-macro)
β β β βββ proc-macro-hack v0.5.19 (proc-macro)
β β βββ proc-macro-hack v0.5.19 (proc-macro)
β βββ pyo3-macros v0.14.5 (proc-macro)
β β βββ pyo3-macros-backend v0.14.5
β β β βββ proc-macro2 v1.0.38 (*)
β β β βββ pyo3-build-config v0.14.5
β β β β βββ once_cell v1.10.0
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β βββ quote v1.0.18 (*)
β β βββ syn v1.0.92 (*)
β βββ unindent v0.1.9
β [build-dependencies]
β βββ pyo3-build-config v0.14.5 (*)
βββ pyo3-asyncio v0.14.1
β βββ futures v0.3.21 (*)
β βββ inventory v0.1.11
β β βββ ctor v0.1.22 (proc-macro)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β βββ ghost v0.1.4 (proc-macro)
β β β βββ proc-macro2 v1.0.38 (*)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β βββ inventory-impl v0.1.11 (proc-macro)
β β βββ proc-macro2 v1.0.38 (*)
β β βββ quote v1.0.18 (*)
β β βββ syn v1.0.92 (*)
β βββ once_cell v1.10.0
β βββ pin-project-lite v0.2.9
β βββ pyo3 v0.14.5 (*)
β βββ pyo3-asyncio-macros v0.14.1 (proc-macro)
β β βββ proc-macro2 v1.0.38 (*)
β β βββ quote v1.0.18 (*)
β β βββ syn v1.0.92 (*)
β βββ tokio v1.18.2 (*)
βββ pyo3-log v0.6.0
β βββ arc-swap v1.5.0
β βββ log v0.4.17 (*)
β βββ pyo3 v0.16.5
β βββ cfg-if v1.0.0
β βββ indoc v1.0.6 (proc-macro)
β βββ libc v0.2.125
β βββ parking_lot v0.12.0 (*)
β βββ pyo3-ffi v0.16.5
β β βββ libc v0.2.125
β β [build-dependencies]
β β βββ pyo3-build-config v0.16.5
β β βββ once_cell v1.10.0
β β βββ target-lexicon v0.12.4
β β [build-dependencies]
β β βββ target-lexicon v0.12.4
β βββ pyo3-macros v0.16.5 (proc-macro)
β β βββ proc-macro2 v1.0.38 (*)
β β βββ pyo3-macros-backend v0.16.5
β β β βββ proc-macro2 v1.0.38 (*)
β β β βββ quote v1.0.18 (*)
β β β βββ syn v1.0.92 (*)
β β βββ quote v1.0.18 (*)
β β βββ syn v1.0.92 (*)
β βββ unindent v0.1.9
β [build-dependencies]
β βββ pyo3-build-config v0.16.5 (*)
βββ serde v1.0.137
βββ serde_json v1.0.81 (*)
βββ socket2 v0.4.5 (*)
βββ tokio v1.18.2 (*)
βββ uuid v0.8.2
βββ getrandom v0.2.6 (*)
βββ serde v1.0.137
Thanks. Yes, this contains both versions of pyo3
. I'd say that's never going to work, I'll close this bug report β this is not exactly pyo3-log's fault, this is how version resolution works for Rust.
Hi,
I am trying to add pyo3-log in my code but it is resulting in a seg fault.
Here is the rust code
and here is the python code
I was able to identify the problem to this snippet by using comments and print statements.
I am getting the following error code:
and I am using maturin as the development system.
Do you happen to know a fix for this?