Priyaranjan Mudliar
06/16/2025, 12:31 PMpactffi_verifier_execute ).
The in progress PR is - https://github.com/greyorange-labs/pact_erlang/pull/49
It will be really helpful if anyone knows how to debug/fix this issue. ThanksYousaf Nabi (pactflow.io)
Priyaranjan Mudliar
06/16/2025, 1:18 PM0.4.7 , will try with latest
2. glibc linuxPriyaranjan Mudliar
06/16/2025, 1:19 PM#0 _int_malloc(av=0x7c75a0000030, bytes=208) at ./malloc/malloc.c:4122
#1 __GI___libc_malloc(bytes=208) at ./malloc/malloc.c:3336
#2 alloc::vec::Vec<T,A> as core::clone::Clone>::clone()
#3 reqwest::async_impl::request::Request::try_clone()
#4 reqwest::async_impl::request::RequestBuilder::try_clone()
#5 futures_util::stream::fold::Fold::poll()
#6 pact_verifier::utils::with_retries::{{closure}}()
#7 pact_verifier::pact_broker::HALClient::fetch::{{closure}}()
#8 pact_verifier::pact_broker::HALClient::navigate::{{closure}}()
#9 pact_verifier::fetch_pact::{{closure}}::{{closure}}()
#10 tracing::instrument::Instrumented<T>::poll()
#11 futures_util::stream::flatten::Flatten::poll_next()
#12 futures_util::stream::collect::Collect::poll()
#13 pact_verifier::fetch_pacts::{{closure}}::{{closure}}()
#14 pact_verifier::verify_provider_async::{{closure}}::{{closure}}()
#15 tracing::instrument::Instrumented<T>::poll()
#16 tokio::task::task_local::TaskLocalFuture<T,F>::poll()
#17 pact_verifier::verify_provider_async::{{closure}}()
#18 tokio::runtime::context::blocking::BlockingRegionGuard::block_on()
#19 tokio::runtime::context::runtime::enter_runtime()
#20 tokio::runtime::runtime::Runtime::block_on()
#21 pact_ffi::verifier::handle::VerifierHandle::execute()
#22 pact_ffi::error::panic::catch_panic()
#23 pactffi_verifier_execute()
#24 verify_via_broker_direct() at pactffi_nif.c:778
#25 verify_via_broker_direct() at pactffi_nif.c:713
#26 erts_call_dirty_nif() at beam/erl_nif.c:466
#27 erts_dirty_process_main() at beam/beam_common.c:280
#28 sched_dirty_io_thread_func() at beam/erl_process.c:8768
#29 thr_wrapper() at pthread/ethread.c:116
#30 start_thread() at pthread_create.c:447
#31 clone3() at clone3.S:78Yousaf Nabi (pactflow.io)
Priyaranjan Mudliar
06/16/2025, 1:21 PMYousaf Nabi (pactflow.io)
Also i tried using gdb for analysing the dump, the backtrace i got from gdb is the following:Great stuff, can you isolate to the particular test? and the ffi calls made be in it? We should be able to create a test case repro in rust and test x plat in ci 👍
Yousaf Nabi (pactflow.io)
Priyaranjan Mudliar
06/16/2025, 2:06 PMGreat stuff, can you isolate to the particular test? and the ffi calls made be in it?
We should be able to create a test case repro in rust and test x plat in ciYes, i will try to reproduce this in C without using erlang and report it..
Priyaranjan Mudliar
07/03/2025, 12:09 PMPriyaranjan Mudliar
07/03/2025, 12:10 PMPriyaranjan Mudliar
07/03/2025, 2:29 PMPriyaranjan Mudliar
07/04/2025, 8:10 AMPriyaranjan Mudliar
07/04/2025, 9:00 PMYousaf Nabi (pactflow.io)
Priyaranjan Mudliar
07/07/2025, 9:53 AMPriyaranjan Mudliar
07/07/2025, 9:58 AMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
In the end, I am thinking its because of compatibility issues of pact FFI with the erlang-C interface (or atleast how pact_erlang is using the erlang NIF right now). But I may be wrongIt’s definitely possible and possibly the most likely, I’ve seen issues in go, where our c interface hasn’t been quite right and it resulted in segfaults. @uglyog do you know about the thread safety guarantees of the FFI, most specifically on the verifier side. Is there any?
Priyaranjan Mudliar
07/07/2025, 10:57 AMI need to take it for a spin, I only had a very cursory look at erlang when going through my FFI adventure.You can look at the test folder, it has examples and you can run the tests after cloning the repo using:
make ct
or if rebar3 is installed then just run:
rebar3 ct
PS: running the tests requires docker to be installed