Coder Social home page Coder Social logo

Comments (14)

arriven avatar arriven commented on July 23, 2024

went ahead and added all the goarch options that did compile with the code. I can't guarantee all the features will work though

from db1000n.

1o1o1 avatar 1o1o1 commented on July 23, 2024

Ok) OpenWRT 19.07.8 on MikroTik SXT Lite2 CPU 600MHz AR9344 mips kernel-4.14.241

db1000n_linux_mips.tar.gz

[17:15][root@OpenWrt:~]# nice -n 19 .bins/db1000n
Illegal instruction

:)

from db1000n.

deputinizer avatar deputinizer commented on July 23, 2024

mipsle maybe?

https://go.dev/doc/install/source#environment

  | linux | mips
  | linux | mipsle
  | linux | mips64
  | linux | mips64le

from db1000n.

1o1o1 avatar 1o1o1 commented on July 23, 2024

with mipsle :)

[17:25][root@OpenWrt:~]# .bins/db1000n
.bins/db1000n: line 1: syntax error: unexpected "("

It is MIPSBE :)

https://mikrotik.com/product/RBSXT2nDr3

need to compile for MIPSBE ....

from db1000n.

arriven avatar arriven commented on July 23, 2024

Based on what I'm seeing, I'm not sure go can cross compile for mipsbe but I'll check a bit more thoroughly in couple hours

from db1000n.

arriven avatar arriven commented on July 23, 2024

UPD: according to all the docs I've found mipsbe should be just mips. Go has an option to compile hardfloat vs softfloat (default being only hardfloat) though, maybe that could be the missing part?

from db1000n.

arriven avatar arriven commented on July 23, 2024

Ideally we'd want to try and install go on that machine and inspect env variables it sets here
https://go.dev/doc/install/source#environment
Not sure you'd be able to easily install go on microtik but in case softfloat doesn't work it's worth a try

from db1000n.

1o1o1 avatar 1o1o1 commented on July 23, 2024

No) I can't install go 99.5 MB) there's not enough space) available 101.5 MB :)

from db1000n.

arriven avatar arriven commented on July 23, 2024

Have you tried mips_softfloat?

from db1000n.

1o1o1 avatar 1o1o1 commented on July 23, 2024

yes

[08:55][root@OpenWrt:~]# nice -n 19 .bins/db1000n
Segmentation fault

from db1000n.

arriven avatar arriven commented on July 23, 2024

hmm, I think segfault in this case means that this is the architecture to use but there's a bug somewhere in the code itself that doesn't present itself on other systems (maybe some of the packages used have some bugs or logic that doesn't work for softfloat or smth like that).
I'll either need to setup a VM for that or get some sort of debug build that would at least print out the goroutines when getting that segfault, I'll check what is easier during the weekend

from db1000n.

arriven avatar arriven commented on July 23, 2024

so I've tried running mips binary via qemu and it seems to be working fine (weirdly enough it works both with softfloat and hardfloat)
As for "debug" build - I haven't managed to make a code that would produce such an error message. the one I'm getting is a lot more descriptive:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x76f88a]

goroutine 1 [running]:
go.uber.org/zap.(*Logger).check(0x0, 0x0, {0xcaafb1, 0xf})
        /home/arriven/go/pkg/mod/go.uber.org/[email protected]/logger.go:270 +0x6a
go.uber.org/zap.(*Logger).Info(0xc0001a8120?, {0xcaafb1?, 0xa?}, {0x0, 0x0, 0x0})
        /home/arriven/go/pkg/mod/go.uber.org/[email protected]/logger.go:191 +0x3b
main.main()
        /home/arriven/work/db1000n/main.go:67 +0x2b3

you could try building the executable yourself on your main OS with GOOS=linux GOARCH=mips GOMIPS=softfloat go build -o db1000n but I'm not sure it will be more descriptive on your system

from db1000n.

arriven avatar arriven commented on July 23, 2024

@1o1o1 I think I know what the issue is. How much RAM does that router have? db1000n needs at least 200mb to be able to run properly (and you'd need to provide --skip-encrypted argument, otherwise it's up to 500mb). I just tried running it in qemu with 100mb RAM and it does end up catching a panic (although it's still more descriptive)
I doubt I'll be able to optimize memory usage away without sacrificing functionality but we could figure out some alternatives (i.e. https://github.com/Yneth/distress-releases/releases which doesn't have mips support yet but I could talk to the author in theory)

from db1000n.

1o1o1 avatar 1o1o1 commented on July 23, 2024

:) MikroTik SXT Lite2 CPU 600MHz AR9344 (--> RAM 64Mb <--) NAND 128Mb

with 256-512Mb is too much expensive and usually with arm cpu :)

from db1000n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.