Skip to content

v0.4.8.19 Crashes when start/stop more then once. #94

Open

Description

@Fonta1n3

When my app goes into the background I force Tor to quit and when it reenters the foreground it reboots. Previously this worked fine without any crashes.

Now I notice that if Tor.framework v0.4.8.19 is forced to quit and reboot more than once it crashes my app with an ugly error:

Image

Activity

  1. tladesignz commented on Nov 18, 2025

    @tladesignz
    Member

    Maybe it's this problem?

    guardianproject/orbot-android#1479 (comment)

    I released 0.4.8.20 yesterday. Is it still a problem?

  2. Fonta1n3 commented on Nov 19, 2025

    @Fonta1n3
    Author

    Thank you, will test and revert back soon.

  3. Fonta1n3 commented on Nov 19, 2025

    @Fonta1n3
    Author

    Can confirm the issue remains, same error message, same crash.

  4. tladesignz commented on Nov 25, 2025

    @tladesignz
    Member

    Just released a 0.4.8.21 build. Still the same?

  5. Fonta1n3 commented on Nov 25, 2025

    @Fonta1n3
    Author

    Just tried and yes I am still getting a crash:

    warning: Tor was compiled with optimization - stepping may behave oddly; variables may not be available.Can't show file for stack frame : <DBGLLDBStackFrame: 0x3518b0e70> - stackNumber:0 - name:worker_thread_main [inlined]. The file path does not exist on the file system: /var/folders/mr/lw68m7t562z9sccvfy8qrdwc0000gn/T/tmp.4cWhf2K5l2/tor/src/lib/evloop/workqueue.c
    
  6. tladesignz commented on Nov 25, 2025

    @tladesignz
    Member
    warning: Tor was compiled with optimization - stepping may behave oddly; variables may not be available.Can't show file for 
    stack frame : <DBGLLDBStackFrame: 0x3518b0e70> - stackNumber:0 - name:worker_thread_main [inlined]. The file path 
    does not exist on the file system: 
    /var/folders/mr/lw68m7t562z9sccvfy8qrdwc0000gn/T/tmp.4cWhf2K5l2/tor/src/lib/evloop/workqueue.c
    

    That's just a message from the debugger, meaning, the debugger is sorry for not being able to show you code instead of memory addresses and opcodes. (Because you use production builds, which don't have debugging information attached.)

    Anyway, these are the referenced code pieces from your screenshot:

  7. Fonta1n3 commented on Nov 25, 2025

    @Fonta1n3
    Author

    If there is anything more i can provide to help debug please let me know.

    I'll just downgrade for now.

  8. tladesignz commented on Nov 25, 2025

    @tladesignz
    Member

    So, just to be clear: .18 was fine?

    Would it be possible for you to git bisect this?

    You would need to check out Tor.framework and reference the local checkout from your project.

    git clone git@github.com:iCepa/Tor.framework.git
    cd Tor.framework
    
    mkdir build
    cd build
    
    git clone --recursive  https://gitlab.torproject.org/tpo/core/tor.git
    
    cd tor
    git bisect start
    git bisect good 801ef23181a1c09c06701f49003b35825b9e9a5c # tor-0.4.8.18
    git bisect bad ffe63d09dc162ca109f7612ad782cb950598aed5 # tor-0.4.8.19
    
    cd ../..
    ./build-xcframwork.sh -d

    Here's a patch for build-xcframework.sh, so you only build the minimum (no LZMA, only iOS arm64 real device binaries):

    diff --git a/build-xcframework.sh b/build-xcframework.sh
    index af40f41..6e07091 100755
    --- a/build-xcframework.sh
    +++ b/build-xcframework.sh
    @@ -378,70 +378,24 @@ create_framework() {
         cp -r "${HEADERS[@]}" "$BUILDDIR/$SDK/$NAME.framework/Headers" >> "$LOG" 2>&1
     }
     
    -build_liblzma       iphoneos            arm64           15.0
     build_libssl        iphoneos            arm64           15.0
     build_libevent      iphoneos            arm64           15.0
    -build_libtor        iphoneos            arm64           15.0
     build_libtor        iphoneos            arm64           15.0    nolzma
    -create_framework    iphoneos
     create_framework    iphoneos            ""              nolzma
     
    -build_liblzma       iphonesimulator     arm64           15.0
    -build_liblzma       iphonesimulator     x86_64          15.0
    -fatten              liblzma             iphonesimulator
    -build_libssl        iphonesimulator     arm64           15.0
    -build_libssl        iphonesimulator     x86_64          15.0
    -fatten              libssl              iphonesimulator
    -fatten              libssl              iphonesimulator libcrypto
    -build_libevent      iphonesimulator     arm64           15.0
    -build_libevent      iphonesimulator     x86_64          15.0
    -fatten              libevent            iphonesimulator
    -build_libtor        iphonesimulator     arm64           15.0
    -build_libtor        iphonesimulator     x86_64          15.0
    -fatten              libtor              iphonesimulator
    -build_libtor        iphonesimulator     arm64           15.0    nolzma
    -build_libtor        iphonesimulator     x86_64          15.0    nolzma
    -fatten              libtor-nolzma       iphonesimulator libtor
    -create_framework    iphonesimulator     fat
    -create_framework    iphonesimulator     fat             nolzma
    -
    -build_liblzma       macosx              arm64           11.0
    -build_liblzma       macosx              x86_64          11.0
    -fatten              liblzma             macosx
    -build_libssl        macosx              arm64           11.0
    -build_libssl        macosx              x86_64          11.0
    -fatten              libssl              macosx
    -fatten              libssl              macosx          libcrypto
    -build_libevent      macosx              arm64           11.0
    -build_libevent      macosx              x86_64          11.0
    -fatten              libevent            macosx
    -build_libtor        macosx              arm64           11.0
    -build_libtor        macosx              x86_64          11.0
    -fatten              libtor              macosx
    -build_libtor        macosx              arm64           11.0    nolzma
    -build_libtor        macosx              x86_64          11.0    nolzma
    -fatten              libtor-nolzma       macosx          libtor
    -create_framework    macosx              fat
    -create_framework    macosx              fat             nolzma
    -
     echo "- Create xcframework"
     
     LOG="$BUILDDIR/framework.log"
     
    -for name in "tor" "tor-nolzma"
    +for name in "tor-nolzma"
     do
         rm -rf "$ROOT/$name.xcframework" "$ROOT/$name.xcframework.zip" >> "$LOG" 2>&1
     
         xcodebuild -create-xcframework \
             -framework "$BUILDDIR/iphoneos/$name.framework" \
    -        -framework "$BUILDDIR/iphonesimulator/$name.framework" \
    -        -framework "$BUILDDIR/macosx/$name.framework" \
             -output "$ROOT/$name.xcframework" >> "$LOG" 2>&1
     
         cd "$ROOT"
    -
    -    zip -r -9 "$name.xcframework.zip" "$name.xcframework" >> "$LOG" 2>&1
    -    shasum -a 256 "$name.xcframework.zip"
     done
     
     if [ -z $DEBUG ]; then
    
  9. Fonta1n3 commented on Nov 26, 2025

    @Fonta1n3
    Author

    So, just to be clear: .18 was fine?

    Good question, let me test more and make sure that is the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions