Fix use-after-free in x11 backend during shutdown

The xcb_connection_t instance that is used here comes from
XGetXCBConnection(), is created by XOpenDisplay(), and is owned by the
returned Display*. Calling xcb_disconnect() directly on it leads to
various use-after-frees during shutdown, as reported by valgrind. The
first one of the about 30 errors is:
    Invalid read of size 4
       at 0x71F2051: xcb_take_socket (in /usr/lib64/libxcb.so.1.1.0)
       by 0x78551DD: ??? (in /usr/lib64/libX11.so.6.3.0)
       by 0x7855A14: _XFlush (in /usr/lib64/libX11.so.6.3.0)
       by 0x7858504: _XGetRequest (in /usr/lib64/libX11.so.6.3.0)
       by 0x7838966: XFreeGC (in /usr/lib64/libX11.so.6.3.0)
       by 0x783238B: XCloseDisplay (in /usr/lib64/libX11.so.6.3.0)
       by 0x4E680C2: wlr_x11_backend_destroy (backend.c:333)
       by 0x4E57E94: wlr_backend_destroy (backend.c:39)
       by 0x4E629FB: multi_backend_destroy (backend.c:47)
       by 0x4E62B5A: handle_display_destroy (backend.c:90)
       by 0x50B7E9F: ??? (in /usr/lib64/libwayland-server.so.0.1.0)
       by 0x50B8476: wl_display_destroy (in /usr/lib64/libwayland-server.so.0.1.0)
     Address 0xc14dda0 is 0 bytes inside a block of size 21,152 free'd
       at 0x4C2DD18: free (vg_replace_malloc.c:530)
       by 0x4E680A5: wlr_x11_backend_destroy (backend.c:330)
       by 0x4E57E94: wlr_backend_destroy (backend.c:39)
       by 0x4E629FB: multi_backend_destroy (backend.c:47)
       by 0x4E62B5A: handle_display_destroy (backend.c:90)
       by 0x50B7E9F: ??? (in /usr/lib64/libwayland-server.so.0.1.0)
       by 0x50B8476: wl_display_destroy (in /usr/lib64/libwayland-server.so.0.1.0)
       by 0x40C54E: main (main.c:84)
     Block was alloc'd at
       at 0x4C2EA1E: calloc (vg_replace_malloc.c:711)
       by 0x71F0C60: xcb_connect_to_fd (in /usr/lib64/libxcb.so.1.1.0)
       by 0x71F4BD4: xcb_connect_to_display_with_auth_info (in /usr/lib64/libxcb.so.1.1.0)
       by 0x7854AA1: _XConnectXCB (in /usr/lib64/libX11.so.6.3.0)
       by 0x7845481: XOpenDisplay (in /usr/lib64/libX11.so.6.3.0)
       by 0x4E681B6: wlr_x11_backend_create (backend.c:376)
       by 0x4E580EE: wlr_backend_autocreate (backend.c:99)
       by 0x40C27D: main (main.c:35)

Normally, one would expect this to crash during XCloseDisplay() when
xcb_disconnect() is called again and frees the same data again (glibc would
detect a double free). However, XCloseDisplay() tries to clean up some internal
caches first for which it has to send requests to the X11 server (e.g. the
XFreeGC() above). This fails since the file descriptor was already closed,
which causes an IO error. Xlib's _XDefaultIOError() handles this by printing an
error message and calling exit(1).
Thus, the only symptom of this problem was compositors exiting
mid-shutdown and printing an error message:
    XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
          after 6 requests (6 known processed) with 0 events remaining.

Fixes: https://github.com/swaywm/wlroots/issues/745
Signed-off-by: Uli Schlachter<EMAIL_ADDRESS>

Thanks!


disclosure triangle in light mode with default theme

disclosure triangle is difficult to see

resolved in v7.0.2


Improved types corresponding to export actions

Motivation and context

Changed some any to correct types, removed unused file
How has this been tested?

Checklist

[x] I submit my changes into the develop branch
[ ] I have created a changelog fragment
[ ] I have updated the documentation accordingly
[ ] I have added tests to cover my changes
[ ] I have linked related issues (see GitHub docs)
[ ] I have increased versions of npm packages if it is necessary
(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)

License

[x] I submit my code changes under the same MIT License that covers the project.
Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

Improvements

Enhanced modal functions to accept more specific parameter types, improving clarity and reducing errors.
Added a safety check in the Export Dataset Modal to prevent issues when closing the modal.

Refactor

Renamed Task to Project in various parts of the codebase for better alignment with updated data models.

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.27%. Comparing base (b17d293) to head (e09f0bd).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8122      +/-   ##
===========================================
- Coverage    83.62%   83.27%   -0.35%
===========================================
  Files          383      389       +6
  Lines        40507    41274     +767
  Branches      3830     3855      +25
===========================================
+ Hits         33873    34370     +497
- Misses        6634     6904     +270

Components
Coverage Δ

cvat-ui
79.39% <76.49%> (-0.25%)
:arrow_down:

cvat-server
86.75% <75.90%> (-0.51%)
:arrow_down:


Adding text search to search widget

Search only works with the real mongo because mongoquery does not support text search.

Somehow a merge commit ended up here, which doesn't seem right. Doing some git surgery now (which is why the GitHub UI marked this as "closed"). Will post a summary of what I did when it's complete.

Please do not make PRs from your master branch. In general, collaborators will push to PR branches to provide help, and doing a PR from a master branch interferes with this. It's also better git hygiene to keep your master branch in sync with upstream, and do development work on feature branches.
I'll open a new PR with your commit.

See https://scikit-beam.github.io/scikit-beam/development/workflow/development_workflow.html#workflow


Frontend UI is glitchy on a phone

just open up the Devika web app on a phone (I am using an iPhone 14 Pro Max (latest iOS, latest Safari)) and you'll see the view is glitchy

Bro how to install ollam in phone how you install in  phone

I am running the app on a server lol

fetch the latest changes. currnetly not responsive UI but we'll try.
https://github.com/stitionai/devika/pull/295


Dean account

Hi, I am making similar app and would love to see the functionaliy of app. I have some questions. How to add dean's account? How to make firebase database for app? Thank You very much.

Yes, that's correct. You'll need to create your own Firebase Realtime DB for that. Database scheme is described in this README.md file.
https://github.com/hanlinag/ams-teacher#readme


Support the build cache and parallel test execution with the JaCoCo plugin applied

Update
The wider implications of this bug is captured well here:
https://github.com/gradle/gradle/issues/5269#issuecomment-390489401
Expected Behavior
If you use the Jacoco plugin with it's default configuration, it should not break the Test task's ability to be cached.
Current Behavior
Applying the Jacoco plugin to your project makes the Test task not support caching.
https://github.com/gradle/gradle/blob/76387d95bd2d785eb76991d252102b9546551696/subprojects/jacoco/src/main/java/org/gradle/testing/jacoco/plugins/JacocoPluginExtension.java#L131-L136
https://docs.gradle.org/current/dsl/org.gradle.testing.jacoco.plugins.JacocoTaskExtension.html#org.gradle.testing.jacoco.plugins.JacocoTaskExtension:append

Whether or not data should be appended if the destinationFile already exists. Defaults to true.

Context
It makes sense that if you have custom configuration for the Jacoco plugin you might prevent Build Caching from working, but in it's default configuration it should work.
Steps to Reproduce (for bugs)
Add the Jacoco plugin to a project and be using the Build Cache.
Workaround
Using the Kotlin DSL:
tasks.withType<Test> {
    extensions.configure(typeOf<JacocoTaskExtension>()) {
        isAppend = false
    }
}

Your Environment
------------------------------------------------------------
Gradle 4.7
------------------------------------------------------------

Build time:   2018-04-18 09:09:12 UTC
Revision:     b9a962bf70638332300e7f810689cb2febbd4a6c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_92 (Oracle Corporation 25.92-b14)
OS:           Mac OS X 10.13.3 x86_64

We would love to change the default for append in the Jacoco plugin, but that would be a breaking change :(
So we need to wait for Gradle 5.0 to change the default to append = false, so caching would be enabled by default for the Test task with JaCoCo enabled.

If you are willing to work on a solution in the JaCoCo plugin to support parallel test execution with caching and the Jacoco plugin enabled, then we would be happy to assist you in building the corresponding PR.
I think the basic approach would be to interpret append = false in the JaCoCo extension to mean:

clean up the coverage file when the Test task starts
pass append = true to the JaCoCo agent

We would need some test coverage making sure that parallel test execution works well with the Jacoco plugin and append = true.
When this works, we would set append = false in Gradle 5.0 and thereby enable caching of Test tasks with JaCoCo coverage by default.

@wolfs If we're making a breaking change in 5.0, we may also just want to remove configuration options that don't make sense or make it difficult to do the right thing.
Even though there's a JacocoMerge task that can take multiple JaCoCo reports and generate a single execution file, some builds accomplish the same thing by using the same output file.   This could be from multiple Test tasks or multiple executions of the same Test task with different parameters.

@wolfs What about simply having each worker generate their own JaCoCo report?
As the Jacoco task is today, it already supports merging multiple JaCoCo execution report outputs into one.
We do that here at Plexxi to create our uber coverage report from all of our sub-projects.
val jacocoRootReport = task<JacocoReport>("jacocoRootReport") {
    group = LifecycleBasePlugin.VERIFICATION_GROUP
    description = "Generates code coverage report for all sub-projects."

    val jacocoReportTasks =
        subprojects
            .filter {
                // Filter out source sets that don't have tests in them
                // Otherwise, Jacoco tries to generate coverage data for tests that don't exist
                !it.java.sourceSets["test"].allSource.isEmpty
            }
            .map { it.tasks[jacocoTestResultTaskName] as JacocoReport }
    dependsOn(jacocoReportTasks)

    val allExecutionData = jacocoReportTasks.map { it.executionData }
    executionData(*allExecutionData.toTypedArray())

    // Pre-initialize these to empty collections to prevent NPE on += call below.
    additionalSourceDirs = files()
    sourceDirectories = files()
    classDirectories = files()

    junit5Projects.forEach { testedProject ->
        val sourceSets = testedProject.java.sourceSets
<EMAIL_ADDRESS>= this@task.additionalSourceDirs?.plus(files(sourceSets["main"].allSource.srcDirs))
<EMAIL_ADDRESS>+= files(sourceSets["main"].allSource.srcDirs)
<EMAIL_ADDRESS>+= files(sourceSets["main"].output)
    }

    reports {
        html.isEnabled = true
        xml.isEnabled = true
        csv.isEnabled = false
    }
}

Is there a release/5.0 branch where a PR of this nature could be pointed?

@big-guy @w4tson The implications of this bug are a bit wider reaching than originally captured by this bug.
Gathering from what you've stated here, it seems that if you choose to have multiple workers for your tests, and you want to capture Jacoco code-coverage data, there is no way to also get build cache support.
So your options are, build cache support, or tests on multiple workers, but not both.
Does this merit another issue being opened as this implication seems to be of slightly wider concern than this issue originally tried to capture?

@JLLeitschuh You are exactly right.
When using the java and jacoco plugins, users have the complicated and unclear choice of...

Accepting the defaults and not being able to cache their Test execution at all.
Reconfiguring jacoco.append=false so that Test will be cacheable. But this comes at the cost of not using parallel test execution.

It would be better if someone could have jacoco analysis, parallel test execution, Test cacheability -- all by default or easily configurable.
I wouldn't open a new issue but change the name of the current issue. I gave the rename a shot. WDYT?

@wolfs Unfortunately, I don't think I'm going to have the time to fix this myself. Is there any possibility that someone from the team will get the chance to tackle this before 5.0?

According to this issue append = true should work.
The build cache is disabled if you didn't explicitly enable it and it will be disabled for all Test tasks with the JaCoCo agent configured with append=true.
I don't know about any issue regarding using parallel forks and append = true.
Writing different report files per test worker is not supported, yet.
The build cache shouldn't have any effect on whether tests are executed or not. Are you talking about single tests within the same Test task or whole Test tasks not being executed?

Thanks for yourvanswer.
It's a test job of about 8000 tests. Last time less then 2000 tests were executed. So whole testsuites in junit jargon are missing.

@cal101 That sounds like a bug. Could you open another issue with some instructions how to reproduce the problem?

@wolfs I will try to make a reproducible case but that's difficult. It's on a closed source legacy project. It may be easier for me trying to debug the issue. I will start trying to debug.

Fixed via https://github.com/gradle/gradle/pull/6419.

@wolfs Thank you for fixing this!!! Is append now simply ignored?

Hi Every one ,
I have a scenario, where i want to execute multiple test cases on same code in parallel , issue in this if i have execute multiples test cases at a same , generated exec file don't have proper mapping of test case with java class.(as in background other java files also get loaded which are evoked by other test cases).
i want for one test case , only single exec file is generated having mapping of java classes which are touched by this tests case only. (this is possible , if i execute test cases in serial). In order to save time, i want to execute multiple test cases at same time, and in exec only those java classes covered which is touched by test case specific to it.
Is there any way to achieve this ?


Low performance when running benchmark code on a different PC than database server

If I run the benchmark directly on the same server as the one with the database, the performance is good; I get an ingestion rate of 3.5M/s.
However, since the the benchmark uses a lot of the cpu, I decided to run the benchmark on another PC which connects to the same server with the database. But now, the ingestion rate is 2M/s.
Note that this other PC is more powerful than the server with the database. So, the speed at which it can generate the SQL commands is not an issue, and I would expect that the ingestion rate on the server should stay the same or increase since a lot of CPU usage is freed when the benchmark code is not running on the server directly.
By running htop on the server, I can see that the max network rx speed is around 25MBps, so it seems that the benchmark can't transmit the sql command batches fast enough.
The actual bandwidth between the PC and the server is also not an issue, I tested the speed with iperf and it is around 1Gbit = 125MBps.
This is the configuration I used in both tests:
BENCHMARK_WORK_MODE=testWithDefaultPath
OPERATION_PROPORTION=1:0:0:0:0:0:0:0:0:0:0
GROUP_NUMBER=10
DEVICE_NUMBER=1000
SENSOR_NUMBER=3
CLIENT_NUMBER=8
BATCH_SIZE_PER_WRITE=30000
POINT_STEP=200
LOOP=1

I think it's better that you can provide more details about other PC and your server which can help me to get your points~


Failed to retrieve list of speedtest.net servers

I've opened a new issue because #155  is closed. I found that this error only occurs on the second execution on the same day. I guess Speedtest is blocking connections on the second request from the same device. This doesn't occur with this node js client. https://github.com/sindresorhus/speed-test
Perhaps that helps..

Please test with the current devel version: https://raw.githubusercontent.com/sivel/speedtest-cli/devel/speedtest_cli.py

I've been able to replicate the issue with the current master version and get correct behaviour with the current devel version.
$ wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest_cli.py

Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Failed to retrieve list of speedtest.net servers

$ wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/devel/speedtest_cli.py

Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from TalkTalk (...)...
Selecting best server based on latency...
Hosted by UK Broadband/PCCW (Ealing) [28.42 km]: 57.241 ms
Testing download speed........................................
Download: 14.48 Mbit/s
Testing upload speed..................................................
Upload: 0.49 Mbit/s

Sounds good to me.  I'll look at releasing devel soon.


Update comments in editOnInput.js

The inline comments about editOnInput are no longer accurate - this method is called on every keystroke and is the main way that we update editorState ever since https://github.com/facebook/draft-js/commit/07892ba479bd4dfc6afd1e0ed179aaf51cd138b1
If you're trying to understand how events are handled and updates are processed in Draft.js this could be a good first bug.

I'm new but I'd like to help.

Hi @morrme - thanks for commenting. Were you still interested in this? Any questions?

@flarnie if this is still open, I can take a stab..


make zabbix service start/enable optional

Description of PR
related issue: https://github.com/dj-wasabi/ansible-zabbix-server/issues/173
Type of change

Feature Pull Request
Fixes an issue
fixed yamllint a bit :)

Thanks! 👍


Added support for push notification permissions

Added support for push notification permissions

@rsattar please take a look.

it's not merged yet? I can't see the changes

Thanks @confile for writing this up.
TL;DR I'm going to merge this in (with some changes), but add a warning about using it (I don't recommend recommend using it).
I'm extremely hesitant about adding push notifications permissions, because it differs from ALL the other permissions-based flows on iOS in significant ways:

You can't reliably know if you have push notifications permissions.

In a library like ClusterPrePermissions, you have to use some sort of local "flag", like in NSUserDefaults. However this is not great because if you uninstall the app and re-install it, the NSUserDefaults are cleared (but your push notifications authorization doesn't change for 24 hours), so your state is lost.

You can't reliably tell when the Push Notification request has finished being made to the user.

Checking for UIApplicationDidBecomeActive is nice, but:

It's not guaranteed to fire.

The user may have explicitly denied permission to the app previously, or you uninstall/reinstall the app (see 1.). And now you are expecting a dialog to come and go (firing the notification), but it will never fire. Your completion block will not be called, and the app developer will never get a callback about the flow finishing.

It can fire prematurely. For example, the user could receive a calendar alert and then dismisses it, before the push notification alert is shown.

--
In my opinion, the most reliable way to do push notification pre-permissions is to be part of the AppDelegate callbacks (- application:didRegisterUserNotificationSettings:), and even then you may have to record some NSUserDefaults to know if the USER has asked for permissions before (declaring an intent, like "should-register-always-from-now").
I'm going to merge this in, but with a disclaimer: I don't recommend using it. You should handle "pre-permission" for push notifications yourself. If folks are having issues with this change, then I might remove push notifications support in the future.

@rsattar Interesting though could you please be more specific how you would do it in application:didRegisterUserNotificationSettings?