Author Message

<  Everything Coding  ~  dispatcher: jimtcl; corrupted heap

PostPosted: Tue Aug 07, 2018 4:50 pm Reply with quote
Posts: 4 Joined: Tue Aug 07, 2018 4:32 pm

I'm cross-compiling usb-modeswitch-2.5.2 for ARM board and using install-static to get minimal installed size. However service fails with:
systemd[1]: Starting USB_ModeSwitch_3-1.4.2:1.0...
usb_modeswitch_dispatcher[148]: corrupted size vs. prev_size
systemd[1]: usb_modeswitch@3-1.4.2:1.0.service: Main process exited, code=killed, status=6/ABRT
systemd[1]: usb_modeswitch@3-1.4.2:1.0.service: Failed with result 'signal'.
systemd[1]: Failed to start USB_ModeSwitch_3-1.4.2:1.0.

while running
/usr/sbin/usb_modeswitch_dispatcher --switch-mode 3-1.4.2:1.0

from command line works as expected. I didn't investigate where exactly problem is, but importing jimtcl-0.78 fixes above issue. Could that be done officially for next version?

PostPosted: Thu Aug 09, 2018 8:33 am Reply with quote
Site Admin Posts: 6496 Joined: Sat Nov 03, 2007 12:30 am
Of course I can update jimtcl. Thanks for the report!

PostPosted: Fri Sep 07, 2018 12:17 pm Reply with quote
Posts: 4 Joined: Tue Aug 07, 2018 4:32 pm
It there any estimated release date for the next version? I'm not pushing on you to release immediately, just want to know for decision how to fix currently broken PTXdist package. Thank you.

PostPosted: Wed Sep 12, 2018 10:47 am Reply with quote
Posts: 4 Joined: Tue Aug 07, 2018 4:32 pm
Perhaps removing builtin jimtcl would be the most feasible solution after all as:
  • Debian package uses system libjim
  • RPM package uses system libjim
  • Arch is using script and depends on Tcl
  • Gentoo has option to either use system libjim or install Tcl script
Perhaps something like this could be a starting point for discussion.

PostPosted: Sun Nov 18, 2018 1:54 am Reply with quote
Posts: 1 Joined: Sun Nov 18, 2018 1:37 am
First of all - hello from new forum member!

As to problem at hand: I've been working on custom distro (Buildroot) for my own little project that is using a 3G dongle to do networking. Unfortunately usb_modeswitch most of the time crashed due to outdated scripting library.
Now, since I didn't want to wait for upstream to update, I took a little initiative and I've basically ended up with rewriting usb_modeswitch to CMake.
Here's the Git repo: ... rc/master/

What have changed:
- project does not embed jimtcl library source, rather it expect it to be somewhere ready to be linked to, like coming from system. If there is a need for internal jimtcl compilation, it can be done as a dependant CMake project.
- logic of Tcl script embedding inside C/C++ compatible header is now done in CMake itself rather than in Tcl, so Tcl is no longer a build dependency.
- there's a switch CMAKE_USE_LOCAL_TCL_INTERPRETER that can force build to use local Tcl's binary to interpret the scripts (only if executable tclsh is actually found) - AFAIR there's a problem with detecting this executable while cross-compiling (at least on Buildroot env), might need some more tweaking. Works for host target compilation, though.

I've tested it on x86_64 machine (my host) and inside Buildroot with cross-compiler (crosstool-ng) for ARMv7 - in both cases usb_modeswitch compiles and works - without crashes!

If author would like to get it upstreamed, don't hesitate and give it a try.



Display posts from previous:  Sort by:

All times are UTC+02:00
Page 1 of 1
5 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum