Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jemalloc assertion while building pkg #17

Open
emaste opened this issue Mar 24, 2015 · 1 comment
Open

jemalloc assertion while building pkg #17

emaste opened this issue Mar 24, 2015 · 1 comment

Comments

@emaste
Copy link
Member

emaste commented Mar 24, 2015

config.status: creating scripts/periodic/460.pkg-checksum
config.status: creating scripts/periodic/490.status-pkg-changes
config.status: creating scripts/sbin/pkg2ng
config.status: creating scripts/completion/_pkg.bash
config.status: creating scripts/completion/_pkg
config.status: creating libpkg/repo/binary/Makefile
config.status: creating pkg_config.h
config.status: pkg_config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing pkg_repos.h commands
config.status: executing mkdir commands
<jemalloc>: jemalloc_jemalloc.c:1227: Failed assertion: "malloc_initialized || IS_INITIALIZER"
*** Signal 6

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/pkg
@emaste
Copy link
Member Author

emaste commented Apr 21, 2015

It seems this wasn't reproducible after increasing the memory for the VM (from 1G to 4G)

emaste pushed a commit that referenced this issue Jan 6, 2020
With WITNESS enabled we see the following warning:

    lock order reversal: (sleepable after non-sleepable)
     1st 0xffffffd0847c7210 fu540spi0 (fu540spi0) @
     /usr/home/kp/axiado/hornet-freebsd/src/sys/riscv/sifive/fu540_spi.c:297
      2nd 0xffffffc00372bb30 Clock topology lock (Clock topology lock) @
      /usr/home/kp/axiado/hornet-freebsd/src/sys/dev/extres/clk/clk.c:1137
      stack backtrace:
      #0 0xffffffc0002a579e at witness_checkorder+0xb72
      #1 0xffffffc0002a5556 at witness_checkorder+0x92a
      #2 0xffffffc000254c7a at _sx_slock_int+0x66
      #3 0xffffffc00025537a at _sx_slock+0x8
      #4 0xffffffc000123022 at clk_get_freq+0x38
      #5 0xffffffc0005463e4 at __clzdi2+0x2bb8
      #6 0xffffffc00014af58 at randomdev_getkey+0x76e
      #7 0xffffffc0001278b0 at simplebus_add_device+0x7ee
      #8 0xffffffc00027c9a8 at device_attach+0x2e6
      #9 0xffffffc00027c634 at device_probe_and_attach+0x7a
      #10 0xffffffc00027d76a at bus_generic_attach+0x10
      #11 0xffffffc00014aab0 at randomdev_getkey+0x2c6
      #12 0xffffffc00027c9a8 at device_attach+0x2e6
      #13 0xffffffc00027c634 at device_probe_and_attach+0x7a
      #14 0xffffffc00027d76a at bus_generic_attach+0x10
      #15 0xffffffc000278bd2 at config_intrhook_oneshot+0x52
      #16 0xffffffc000278b3e at config_intrhook_establish+0x146
      #17 0xffffffc000278cf2 at config_intrhook_disestablish+0xfe

The clock topology lock can sleep, which means we cannot attempt to
acquire it while holding the non-sleepable mutex.

Fix that by retrieving the clock speed once, during attach and not every
time during SPI transaction setup.

Submitted by:   kp
Sponsored by:   Axiado
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant